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 / Orbiting an object around another object?

Author
Message
Yodaman Jer
User Banned
Posted: 24th Dec 2011 19:38 Edited at: 24th Dec 2011 20:16
Hi guys,

I've tried everything I can think of, but unfortunately my lack of math skills has proved to be a nuisance in this case.

I want to rotate an object around a certain area, somewhat similar to the buzzy electric monsters in Super Mario 64 (links to a video showing what I mean). In other words, an orbiting object. I just can't figure out how to offset the object's orientation to do this!

I've tried everything from creating a hidden object, rotating said object, and positioning the object (a sphere) I want to rotate to the hidden object's angle, but it gives me bizarre results. The sphere pops in and out of existence.

So, does anyone know of a way to do this successfully? Code examples would be greatly appreciated but are not necessary. Just tell me the technique and I'll see if I can figure it out!

Thanks,
Yodaman Jer

EDIT:

Ahh jeeze, I found the "Offset Limb" command. It works like a charm.

Disregard this question as I have found my answer! And it was much easier than I thought.


Click to go to my blog!
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 24th Dec 2011 20:19
Well just for the record, if you don't want it to be a limb but an object positioned, this is what you'd do:

x# = cos(angle)*radius + CenterPosX
y# = whatever
z# = sin(angle)*radius + CenterPosZ

position object OrbitObj , x# , y# , z#


TheComet


Don't click.
Yodaman Jer
User Banned
Posted: 24th Dec 2011 21:53
Thanks Comet! That looks pretty simple.


Click to go to my blog!
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 25th Dec 2011 02:01
Or try EZ Rotate

Yodaman Jer
User Banned
Posted: 25th Dec 2011 04:15
For now I'll just stick with offset limb. But someday I will definitely look into EZ Rotate!


Click to go to my blog!
Daniel TGC
Retired Moderator
19
Years of Service
User Offline
Joined: 19th Feb 2007
Location: TGC
Posted: 28th Dec 2011 01:18

Login to post a reply

Server time is: 2026-07-10 00:43:39
Your offset time is: 2026-07-10 00:43:39