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 - a 3d engine for Java
»
Support
»
How to Rotate a 3D Object continuousl along its axis when button is pressed ?
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: How to Rotate a 3D Object continuousl along its axis when button is pressed ? (Read 2179 times)
CharlieAkki
byte
Posts: 1
How to Rotate a 3D Object continuousl along its axis when button is pressed ?
«
on:
November 24, 2016, 10:33:53 pm »
Hello,
I am working on 3D viewer project which uses JPCT 3D and LWJGL Library. My application is a JFrame application in which I created a Framebuffer and added a 3D box object in it. I want to rotate that 3D object along its axis in all the directions using J-Buttons. For Example : If I press and hold the JButton named 'Left' then 3D object should rotate along y axis in left direction continously until the mouse button is released and when I press JButton named 'Right' the 3D Object should rotate along y axis in right direction.
Please guide me and help me with suitable code example.
Thanking You
Regards
CharlieAkki
Logged
EgonOlsen
Administrator
quad
Posts: 12287
Re: How to Rotate a 3D Object continuousl along its axis when button is pressed ?
«
Reply #1 on:
November 25, 2016, 08:49:56 am »
Just use one of the rotate...()-methods in Object3D. Depending on your needs, you can either rotate around a fixed axis or around an axis relative to the current rotation, which would be something like
Code:
[Select]
obj.rotateAxis(obj.getXAxis(), ...);
Logged
Print
Pages: [
1
]
Go Up
« previous
next »
www.jpct.net
»
jPCT - a 3d engine for Java
»
Support
»
How to Rotate a 3D Object continuousl along its axis when button is pressed ?