Camera Problem

Started by sushobhit, March 29, 2014, 07:08:58 AM

Previous topic - Next topic

sushobhit

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

The direction vector should be a normalized vector. Try to translate by (0,0,1),2 instead and see if that changes anything.

sushobhit

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

Do you mean i divide all the three direction by their magitude....

In that case how do  get the mag ?????

sushobhit


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

EgonOlsen

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?