www.jpct.net
jPCT - a 3d engine for Java => Support => Topic started by: Jonas on November 14, 2007, 07:29:13 pm
-
Hi
Having trouble with what i think is pretty basic ;D. I most probably just dont understand how rotation works.. :).
Im trying to draw some axis arrows..so I made my own arrow object3d and added it to a scene(see picture..the negativ y one is the original).
Now Id like to rotate that arrow to align it with the other axis. When i do the following:
o3ds[0] = createArrow();
o3ds[1] = createArrow();
o3ds[1].rotateZ((float)Math.toRadians(-90));
o3ds[2] = createArrow();
o3ds[2].rotateX((float)Math.toRadians(90));
it looks like this:
(http://web72.pi.ibone.ch/1w.JPG)
Now..is there a way to rotate these arrow so I dont have to translate them back in position(sphere is 0,0,0)? I tried setting the pivot and center of the arrow inside the sphere(which is the origin of the axis arrow too) but it doesent seem to work either.
-
Pivot should do the job, but be sure to set it after calling build() because build() resets the pivot. Maybe that causes the problem!?
-
Hi
Thanks, that helped pin down the error. I actually built the object and reset the pivot, but had another buildAllObjects() in the scene load code, which reset the pivot again ;D.
Works now.