Author Topic: Force Camera Rotation  (Read 1345 times)

Offline Kernle 32DLL

  • byte
  • *
  • Posts: 20
    • View Profile
Force Camera Rotation
« on: March 28, 2011, 11:05:32 pm »
Hi,

Is there a way I may have overlooked to "forcerotate" a camera? What I mean is essentially forcing a certain rotation opon the camera, instead rotation it piece by piece via rotateX/Y/Z. I was able to "emulate" that behavior with an Object3D, but the first method is missing for the camera object, so it wont work this way:

Code: [Select]
mWorldObject.clearRotation();
mWorldObject.rotateY((float)Math.toRadians(mWorldRotationY));

So, any toughts, or did I overlook something?

So long,
Kernle

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11965
    • View Profile
    • http://www.jpct.net
Re: Force Camera Rotation
« Reply #1 on: March 29, 2011, 08:11:03 am »
It's almost the same thing:

Code: [Select]
mWorldObject.getCamera().getBack().setIdentity();
mWorldObject.getCamera().rotateY((float)Math.toRadians(mWorldRotationY));

Offline Kernle 32DLL

  • byte
  • *
  • Posts: 20
    • View Profile
Re: Force Camera Rotation
« Reply #2 on: March 29, 2011, 07:27:45 pm »
Tahnks! Exact the thing I was looking for (except for mWorldObject, which is a Object3D, and not the world, but I got your idea ;-))