Rotateable cameras

  ... the case you feel the need for a new feature or want to submit one.

Re: Rotateable cameras

Postby Nicolas Gramlich » Wed Aug 25, 2010 11:10 pm

Oh man, that last bug almost made me scratch my eyes out :twisted: ... but I got it working now :)

[Edit]Ok trust me now it works :lol: :oops: :? [/Edit]

So... 100x stupid sign-errors later you can do stupid stuff like, rotating menus upside down or this:

You can see that you don't have to care about the touch coordinates as they get converted for you :!:


Let me know if you find a bug :)

Best Regards,
Nicolas
Nicolas Gramlich
Site Admin
 
Posts: 1734
Joined: Mon Jun 07, 2010 6:20 pm
Location: Schriesheim, Germany

Re: Rotateable cameras

Postby WalterSear » Thu Aug 26, 2010 4:47 am

Oh crap! This is awesome.

I'm going to stop my other progress on the game and figure out how to implement this tonight.

thanks! thanks! thanks!
_,.-+=~'"`'"~=+-.,_,.-+=~'"`'"~=+-.,_
MUSIC AND SOUND DESIGN
Music, SFX and voice overs.
Clients include Id software, Microsoft and Nicolas's Farm Tower :) Moo-ooo!
PM me, let's talk.
`'"~=+-.,_,.-+=~'"`
WalterSear
 
Posts: 43
Joined: Sat Jul 17, 2010 4:46 am

Re: Rotateable cameras

Postby Nicolas Gramlich » Thu Aug 26, 2010 6:00 pm

I had quickly had hacked above demo using this code:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. this.mEngine.registerUpdateHandler(new TimerHandler(0.01f, true, new ITimerCallback() {
  2.         @Override
  3.         public void onTimePassed(TimerHandler pTimerHandler) {
  4.                 mCamera.setCameraSceneRotation(mCamera.getCameraSceneRotation() + 0.2f);
  5.         }
  6. }));
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


Best Regards,
Nicolas
Nicolas Gramlich
Site Admin
 
Posts: 1734
Joined: Mon Jun 07, 2010 6:20 pm
Location: Schriesheim, Germany

Re: Rotateable cameras

Postby WalterSear » Thu Aug 26, 2010 10:05 pm

Ok, I managed to compile the source, and implement the single line of code in my protogame that makes this work (sorta).

However, rotation is still jerky. I will play with this over the weekend and see how much of the jerkiness is my hack code, and what I can do to smooth things out.
_,.-+=~'"`'"~=+-.,_,.-+=~'"`'"~=+-.,_
MUSIC AND SOUND DESIGN
Music, SFX and voice overs.
Clients include Id software, Microsoft and Nicolas's Farm Tower :) Moo-ooo!
PM me, let's talk.
`'"~=+-.,_,.-+=~'"`
WalterSear
 
Posts: 43
Joined: Sat Jul 17, 2010 4:46 am

Re: Rotateable cameras

Postby Nicolas Gramlich » Sat Aug 28, 2010 1:17 pm

Hi,

WalterSear wrote:Ok, I managed to compile the source, and implement the single line of code in my protogame that makes this work (sorta).

However, rotation is still jerky. I will play with this over the weekend and see how much of the jerkiness is my hack code, and what I can do to smooth things out.


What is the FPS your game is running at :?:

Above code was just a quick hack and definitely not the best solution. Sth like this should work better:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.     this.mEngine.registerUpdateHandler(new IUpdateHandler() {
  2.             @Override
  3.             public void onUpdate(final int pSecondsElapsed) {
  4.                     mCamera.setCameraSceneRotation(mCamera.getCameraSceneRotation() + pSecondsElapsed * ROTATION_PER_SECOND_DEGREES);
  5.             }
  6.     });
Parsed in 0.032 seconds, using GeSHi 1.0.8.4



Best Regards,
Nicolas
Nicolas Gramlich
Site Admin
 
Posts: 1734
Joined: Mon Jun 07, 2010 6:20 pm
Location: Schriesheim, Germany

Re: Rotateable cameras

Postby drjava72 » Fri Jul 22, 2011 3:15 pm

Nicolas Gramlich wrote:Hi,

WalterSear wrote:Ok, I managed to compile the source, and implement the single line of code in my protogame that makes this work (sorta).

However, rotation is still jerky. I will play with this over the weekend and see how much of the jerkiness is my hack code, and what I can do to smooth things out.


What is the FPS your game is running at :?:

Above code was just a quick hack and definitely not the best solution. Sth like this should work better:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.     this.mEngine.registerUpdateHandler(new IUpdateHandler() {
  2.             @Override
  3.             public void onUpdate(final int pSecondsElapsed) {
  4.                     mCamera.setCameraSceneRotation(mCamera.getCameraSceneRotation() + pSecondsElapsed * ROTATION_PER_SECOND_DEGREES);
  5.             }
  6.     });
Parsed in 0.035 seconds, using GeSHi 1.0.8.4



Best Regards,
Nicolas

How to set rotation back to normal. ?? like reset( ) but in Camera it is just an empty mothod.
Best Regards,
drJava72
drjava72
 
Posts: 287
Joined: Fri Apr 29, 2011 8:03 am

Re: Rotateable cameras

Postby rf1982 » Wed Jul 27, 2011 1:25 pm

drjava72 wrote:How to set rotation back to normal. ?? like reset( ) but in Camera it is just an empty mothod.

Not 100% sure but how about
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. mCamera.setCameraSceneRotation(0.0f);
Parsed in 0.035 seconds, using GeSHi 1.0.8.4
rf1982
 
Posts: 30
Joined: Wed Jul 27, 2011 11:15 am

Previous

Return to Features

Who is online

Users browsing this forum: distance880, Hiteshc and 5 guests