www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: Kernle 32DLL on March 28, 2011, 11:05:32 pm

Title: Force Camera Rotation
Post by: Kernle 32DLL 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
Title: Re: Force Camera Rotation
Post by: EgonOlsen 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));
Title: Re: Force Camera Rotation
Post by: Kernle 32DLL 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 ;-))