# www.jpct.net

## jPCT-AE - a 3d engine for Android => Support => Topic started by: sushobhit on March 29, 2014, 07:08:58 am

Title: Camera Problem
Post by: sushobhit on March 29, 2014, 07:08:58 am
Hi ,

There is a problem coming when i try to translate  my object and move the camera along with it

When both are done simultaiously there is a SHAKE

to be more specific if I do :
{
Object.translate(0,0,2);
Camera.moveCamera(new SimpleVector(0,0,2),1f);
} // There is a shake the engine tends to retaiate the object traslation are seem to shake

Plz tell me how i can smooth the camera movements....
Title: Re: Camera Problem
Post by: EgonOlsen on March 29, 2014, 08:36:29 am
The direction vector should be a normalized vector. Try to translate by (0,0,1),2 instead and see if that changes anything.
Title: Re: Camera Problem
Post by: sushobhit on March 29, 2014, 11:32:21 am
I am just using a SimpleVector
i.e
world.getcamera().moveCamera(new SimpleVector(0,0,2),1f); //Changing 0,0,1 2f doesnt help it just gets very little smooth

How am I suppose to normalise it what's the EQN
Title: Re: Camera Problem
Post by: sushobhit on March 29, 2014, 11:36:43 am
Do you mean i divide all the three direction by their magitude....

In that case how do  get the mag ?????
Title: Re: Camera Problem
Post by: sushobhit on March 29, 2014, 11:41:41 am

mag = sqrt(9 + 1 + 4) = 3.742
will this do the trick
Title: Re: Camera Problem
Post by: EgonOlsen on March 29, 2014, 11:47:48 am
SimpleVector has a normalize-method. However, i'm not sure what the actual issue should be here. It's almost impossible to tell what you mean with 'shake' without seeing it for myself. Can you provide some test case for this?