www.jpct.net
jPCT - a 3d engine for Java => Support => Topic started by: bgilb3 on March 13, 2005, 11:26:05 am
-
shape.translate(0f,0f,forwardSpeed);
shape.rotateY(turnSpeed);
i was wondering how i can make the rotatation permanent? Like how the cameras MoveIN thing works. Because no matter what the rotation is, the shape always just goes outward from the camera ( im trying to make it so when you rotate the object, its direction changes ) ie when you hit forward it goes another direction )
-
If i understand you correctly, try something like
shape.translate(shape.getZAxis());
-
Yeah I tried that, kinda works except ..
It doesn't allow me to define a speed :-(
-
Try something like this:
SimpleVector s=shape.getZAxis();
s.scalarMul(speed);
shape.translate(s);
-
Gotcha, thanks that worked :D
-
How can i get the camera to follow something around like 3rd person?
-
Depends on your actual needs. One way of doing it be found in sources of the car example.
-
so complicated :oops:
-
so complicated :oops:
Not really. It's in the CarTest.java in moveCamera. It's not that complicated...
-
Okay i got the camera to follow the object around, now im not sure how to get the camera to have the same rotation is the object
-
Depends on what you mean exactly. You may try to align them using Camera.align(<Object3D>) or use Camera.lookAt(<SimpleVector>) with the transformed center of the Object3D as point to look at.