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 Discussion / need help storing coodinate data

Author
Message
Gowmars
21
Years of Service
User Offline
Joined: 26th Sep 2003
Location: United States
Posted: 21st Aug 2004 05:36
Im trying to figure out how to get the program to return coordinates of a model.
For example say I load in a .x model and I make it move. I want the program to record what coordinates the object moves to (X,Y,Z) and also record its rotation as I make it turn. So that I can store that data into variables to use for calculations. If anyone can help me id greatly appreciate it.

Thanks
Gowmars
Balid
21
Years of Service
User Offline
Joined: 21st Nov 2003
Location: MI, USA
Posted: 21st Aug 2004 08:47
Gowmars,

For position,


ObjPosX# = object position x( object )
ObjPosY# = object position y( object )
ObjPosZ# = object position z( object )


How do you intend to rotate the object? Using the Rotate commands or the turn, roll, and pitch commands?

This should work for either,


ObjXrot# = wrapvalue(ObjXRot# + 'amount of rotation')
ObjYrot# = wrapvalue(ObjYrot# + 'amount of rotation')
ObjZrot# = wrapvalue(ObjZrot# + 'amount of rotation')

And then use minus 'amount of rotation' for the opposite direction.

I don't have my code in front of me but that is what I basicly use.

Gowmars
21
Years of Service
User Offline
Joined: 26th Sep 2003
Location: United States
Posted: 21st Aug 2004 16:36
ok Thanks, that should do just fine

Gowmars
Gowmars
21
Years of Service
User Offline
Joined: 26th Sep 2003
Location: United States
Posted: 25th Aug 2004 14:52
im still confused about the rotate stuff. I will be using the "rotate object" command to rotate my objects. I want to be able to store the X,Y,Z values for rotation of my objects in a variables. and then use those values for calculation or if i want another object to have the same rotation as the previous object, I want to use those stored values to give the second object its rotation.

thanks

gowmars
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 25th Aug 2004 19:37
if you have access to pro, you can use typed arrays.


here is an example of them in action



now with DBC the least elegant solution is to use arrays and lots of them, they are global across functions so they stand the merit of use, even tho its more work it can do the same thing.

instead of declaring the typed array u have to make arrays for each aspect.

eg: Dim MonsterNum(1) : MonsterNum(1) = 100
etc..

If no-one gives your an answer to a question you have asked, consider:- Is your question clear.- Did you ask nicely.- Are you showing any effort to solve the problem yourself

Login to post a reply

Server time is: 2025-05-25 01:33:16
Your offset time is: 2025-05-25 01:33:16