Results 1 to 8 of 8
Thread: Java 3D circular movement?
 08112011, 02:18 PM #1Member
 Join Date
 Aug 2011
 Posts
 4
 Rep Power
 0
Java 3D circular movement?
Hello,
I'm working on a 3D game and I'm trying to move my object roundly. It must follow a circumference when it's moving.
I've got the following variables/function:
motionX, motionY, motionZ
posX, posY, posZ
"onupdate()" function which update the state, the position and the movement of the object
the coords of the circumference's centre
the size of the radius
How can I move this object roundly around the centre?
Is there a function in GL11 or in another library? Can you write an example?
Thanks really much,
AXELTOPOLINO
 08112011, 02:45 PM #2
 Join Date
 Sep 2008
 Location
 Voorschoten, the Netherlands
 Posts
 14,126
 Blog Entries
 7
 Rep Power
 24
Think spherical coordinates:
x= r*cos(a)*sin(b)
y= r*sin(a)*sin(b)
z= r*cos(b)
where r is a constant value (the radius of your sphere) and both a and b move in the intervals [amin, amax] and [bmin, bmax] in a linear way.
kind regards,
JosLast edited by JosAH; 08112011 at 03:02 PM.
The only person who got everything done by Friday was Robinson Crusoe.
 08112011, 10:12 PM #3Member
 Join Date
 Aug 2011
 Posts
 4
 Rep Power
 0
Thanks JosAH for your reply.
What do you mean for [amin, amax] ?
 08122011, 01:23 AM #4
 Join Date
 Dec 2010
 Location
 Stockholm, Sweden
 Posts
 222
 Blog Entries
 9
 Rep Power
 5
That is the closed (inclusive beginning and end; i.e. not clopen) interval tor which the variable 'a' is bound.
'a' cannot be less than 'amin' [radians] and not more than 'amax' [radians].
The values are probably 0 and 2π. Jumping to 0 when reaching 2π (2π modular), and jumping to 2π + a, when a < 0
The interval should probably [actually] be clopen: [0; 2π[
(i.e. 2π is exclusive as describe 2 lines above.)Ex animo! Hibernate
Java, Arch Linux, C, GPL v3, Bash, Eclipse, Linux VT, GNOME 2 and many buttons on windows.
 08122011, 07:53 AM #5
 Join Date
 Sep 2008
 Location
 Voorschoten, the Netherlands
 Posts
 14,126
 Blog Entries
 7
 Rep Power
 24
 08122011, 12:45 PM #6Member
 Join Date
 Aug 2011
 Posts
 4
 Rep Power
 0
Really thanks, it works!
May I ask how I can do a "tornado" movement? I mean a spiral movement: a circular movement, but the radius increase and the object go up until the "top" of the tornado.
Thanks again for the great support
 08122011, 02:52 PM #7
 Join Date
 Sep 2008
 Location
 Voorschoten, the Netherlands
 Posts
 14,126
 Blog Entries
 7
 Rep Power
 24
 08122011, 04:31 PM #8Member
 Join Date
 Aug 2011
 Posts
 4
 Rep Power
 0
Similar Threads

help me with this ! circular doubly linked list
By someone in forum Advanced JavaReplies: 1Last Post: 04112011, 10:35 AM 
CIrcular Arrays
By Bgreen7887 in forum New To JavaReplies: 1Last Post: 03252011, 08:30 AM 
Help with doubly circular linked list Exception in thread "main" java.lang.NullPoint
By ecorvo07 in forum New To JavaReplies: 5Last Post: 02042011, 05:29 AM 
Need help with circular arrays
By bap2 in forum New To JavaReplies: 6Last Post: 11042010, 09:39 PM 
Problem prioritizing a circular queue
By Metastar in forum New To JavaReplies: 1Last Post: 10032010, 11:40 PM
Bookmarks