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.

Newcomers DBPro Corner / Orbiting problem

Author
Message
Twu Kai
19
Years of Service
User Offline
Joined: 2nd Oct 2005
Location:
Posted: 31st Dec 2005 21:59 Edited at: 5th May 2007 20:04
I am using DarkBasic Pro,
and I'm wondering how to get an object to orbit around a certain point?
At the moment, I'm using "POINT OBJECT objnum,OBJECT POSITION X(objnum),OBJECT POSITION Y(objnum),OBJECT POSITION Z(objnum)".

And then I type in "MOVE OBJECT LEFT objnum,speed",
the only problem is that the orbiting object moves out in
an orbit that is ever-increasing in size.

Does anyone know how to change this, or get a better method?
Thanks.

Attachments

Login to view attachments
MMORPG programs
19
Years of Service
User Offline
Joined: 12th Nov 2005
Location:
Posted: 1st Jan 2006 02:15
You could get the range
x=object position x(orbit point)
y=object position y(orbit point)
z=object position z(orbit point)
y2=object position y(orbiter)
z2=object position z(orbiter)
x2=object position x(orbiter)
range=sqrt((x-x2)^2+(y-y2)^2+(z-z20^2)
if range>10
range=10
print "The orbiter is at its maximum orbit"
endif

[img]http://www.savefile.com/files/4182721 [/img]
smoked
19
Years of Service
User Offline
Joined: 2nd Oct 2005
Location: USA - california
Posted: 1st Jan 2006 08:23
I used the second post on this thread... works great


http://forum.thegamecreators.com/?m=forum_view&t=639&b=1

Twu Kai
19
Years of Service
User Offline
Joined: 2nd Oct 2005
Location:
Posted: 1st Jan 2006 21:01 Edited at: 4th Jul 2007 01:21
Thanks for the help!

I've actually found out how to do it using cosine and sine.
The code follows, to help other people:


Thanks again!

Show off your no Shader effects at the No Shader Effects Thread!

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-11-27 07:35:44
Your offset time is: 2024-11-27 07:35:44