newbie question, how to rotate around a designated axis in jPct ?

Started by guillaume, December 12, 2011, 01:27:59 AM

Previous topic - Next topic

guillaume

said I want to rotate a rectangle around a axis which is parallel to XAxis, how can I do this in jPCT,
can someone show me some code ? I am new to opengl and jPCT programming. thanks.


guillaume


EgonOlsen

x=4 is no axis. I'm not sure what you are after...maybe setRotationPivot() is more what you want?

guillaume

Quote from: EgonOlsen on December 12, 2011, 12:34:21 PM
x=4 is no axis. I'm not sure what you are after...maybe setRotationPivot() is more what you want?
oh, I mean a line parallel to Y axis and pass through  point (4,0,0). how can I rotate around this ?

EgonOlsen

By offsetting the rotation pivot. Try object.setRotationPivot(4,0,0) and do a rotateY() afterwards.