Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Home
Help
Search
Login
Register
www.jpct.net
»
jPCT-AE - a 3d engine for Android
»
Support
»
newbie question, how to rotate around a designated axis in jPct ?
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: newbie question, how to rotate around a designated axis in jPct ? (Read 3733 times)
guillaume
int
Posts: 67
newbie question, how to rotate around a designated axis in jPct ?
«
on:
December 12, 2011, 01:27:59 am »
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.
Logged
EgonOlsen
Administrator
quad
Posts: 12297
Re: newbie question, how to rotate around a designated axis in jPct ?
«
Reply #1 on:
December 12, 2011, 07:43:22 am »
Like so:
http://www.jpct.net/jpct-ae/doc/com/threed/jpct/Object3D.html#rotateAxis(com.threed.jpct.SimpleVector, float)
Logged
guillaume
int
Posts: 67
Re: newbie question, how to rotate around a designated axis in jPct ?
«
Reply #2 on:
December 12, 2011, 11:15:25 am »
http://www.jpct.net/jpct-ae/doc/com/threed/jpct/Object3D.html#rotateAxis(com.threed.jpct.SimpleVector
, float)
if I use this api, how should I represent a axis (for example x=4) in vector form ? thanks.
Logged
EgonOlsen
Administrator
quad
Posts: 12297
Re: newbie question, how to rotate around a designated axis in jPct ?
«
Reply #3 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?
Logged
guillaume
int
Posts: 67
Re: newbie question, how to rotate around a designated axis in jPct ?
«
Reply #4 on:
December 12, 2011, 12:37:45 pm »
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 ?
Logged
EgonOlsen
Administrator
quad
Posts: 12297
Re: newbie question, how to rotate around a designated axis in jPct ?
«
Reply #5 on:
December 12, 2011, 12:42:50 pm »
By offsetting the rotation pivot. Try object.setRotationPivot(4,0,0) and do a rotateY() afterwards.
Logged
Print
Pages: [
1
]
Go Up
« previous
next »
www.jpct.net
»
jPCT-AE - a 3d engine for Android
»
Support
»
newbie question, how to rotate around a designated axis in jPct ?