### Author Topic: Camera Problem  (Read 1187 times)

#### sushobhit

• long
• Posts: 109
• future is now
##### Camera Problem
« 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....

#### EgonOlsen

• Posts: 11910
##### Re: Camera Problem
« Reply #1 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.

#### sushobhit

• long
• Posts: 109
• future is now
##### Re: Camera Problem
« Reply #2 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

#### sushobhit

• long
• Posts: 109
• future is now
##### Re: Camera Problem
« Reply #3 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 ??

#### sushobhit

• long
• Posts: 109
• future is now
##### Re: Camera Problem
« Reply #4 on: March 29, 2014, 11:41:41 am »

mag = sqrt(9 + 1 + 4) = 3.742
will this do the trick