Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / How to rotate 3 spheres on external axis??

Author
Message
Vues3d on Kalimee
21
Years of Service
User Offline
Joined: 12th May 2004
Location: NYON (SWITZERLAND)
Posted: 3rd Dec 2004 19:28
Here's my problem - that's just a matematic problem :

I have 3 spheres & would like to rotate them around a point. (See picture)
What kind of formula have I to use??

A little code should be really helpful...
Thanx in advance for all of you that will help.



Guido
http://www.vues3d.com
French gui
21
Years of Service
User Offline
Joined: 11th May 2004
Location: France
Posted: 3rd Dec 2004 21:13 Edited at: 3rd Dec 2004 21:16
hmmm....

d is distance between spheres and center point
x and z are your center point:
a1,a2 and a3 are the angles of each sphere (for ex: 0,120,240)

position object (sphere1),x+cos(a1)*d,0,z+sin(a1)*d
idem for sphere2 and 3

You just have to increase a1,a2 and a3 to rotate them.
Note that they will turn only around the y axis.(If you have to turn around any axis better buy EZ rotate... )

My English is not so good I'm just French
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 3rd Dec 2004 21:25 Edited at: 3rd Dec 2004 21:27
You could offset limb 0 - then rotate the object, you'd offset on the Y axis by your desired radius you see, then the mesh is like a lollipop without the stick . The problem is that it can be quite tricky to avoid occlusion problems, like the bounding box does'nt change - it might work nicely if you make a spere 5 times as big as you need it, then scale it down to 20,20,20 - this might leave the bounding box in a usable state.

You'd probably make good use of EZRotate anyway, did you buy the special offer thing?


Van-B


It's c**p being the only coder in the village.
Mnemonix
22
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: Skaro
Posted: 4th Dec 2004 04:32
Im not very good at 3d, but would it work if you used an invisible object in the middle and then made the spheres limbs of the invisible object or something to that effect. If this is wrong then please ignore me because I am not good at 3D.

The 3d chat is coming...
Rights For Traffic Cones!
Benjamin
22
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 4th Dec 2004 04:45
Do what French gui said, thats how I normally do it.

Raven: That said, I DO say 'that said' a lot. 'Nuf said.
Lost in Thought
21
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 4th Dec 2004 11:26
Yeah I just cheat as well because I don't know much about 3d math.


But as soon as I find a way to get EZRotate to work with NGC properly I wil buy it and just use the rotate object around point command

Vues3d on Kalimee
21
Years of Service
User Offline
Joined: 12th May 2004
Location: NYON (SWITZERLAND)
Posted: 6th Dec 2004 17:00
Hi there!!

Thanx to everybody for the help.
I will manage the use of the code done by "Lost in Thought" & adapt it on my purposes.
I've to study the Limb commands to better understand the way it works, (Also because I've to manage the rotation of each sphere around the center point).
Will post the result as soon as I finish the code.
This will take place in the L5.

Guido
http://www.vues3d.com
Lost in Thought
21
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 6th Dec 2004 17:50 Edited at: 6th Dec 2004 18:00
Here is a better version. Just change the first 4 variables and it does all the work.

Orbit_Diam
Orb_Obj_Num
Orbit_x#
Orbit_z#

[edit] edited code to recolor all limbs no matter how many you set
and increased the number of orbit objects and the orbit diameter



Vues3d on Kalimee
21
Years of Service
User Offline
Joined: 12th May 2004
Location: NYON (SWITZERLAND)
Posted: 6th Dec 2004 18:24
Yes!! Lost, with your last post, you solved all the problem I should encounter & indirectly answered to all the questions I would have.
The code is perfect & now I also know HOW to handle limbs.
This helped me a lot & I won at least 1 day of coding!!!!

REALLY REALLY THANX!!!

Guido
http://www.vues3d.com
Lost in Thought
21
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 7th Dec 2004 02:55
Glad I could help.

Login to post a reply

Server time is: 2025-06-07 09:29:07
Your offset time is: 2025-06-07 09:29:07