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 / Z X axis problems

Author
Message
GermitoX
21
Years of Service
User Offline
Joined: 3rd Sep 2003
Location:
Posted: 3rd Sep 2003 17:32
I'm having some problems with these axis. When i tell DB to turn 90 degrees a 3d object, the Z and X axis become one. Because of this, i can't make the object respond correctly to the matrix slopes. What i make is take ground height 50 units in fornt of the object, and 50 units on the back of the object. I do the same with the sides. With this i calculate the angles for both axis.

If you have a better code, plz send it to me
Plz replly.
FNG
21
Years of Service
User Offline
Joined: 25th Jul 2003
Location: United States
Posted: 3rd Sep 2003 22:19
germitox, without seeing your actual code it may be hard for someone to help you. Are you using the wrapvalue() function, or are you using the xrotate() function. IF not look into these commands. Otherwise please post your code for movemnet.
GermitoX
21
Years of Service
User Offline
Joined: 3rd Sep 2003
Location:
Posted: 3rd Sep 2003 22:25
Ok. I'll see if i can post it. Thx for the reply.
GermitoX
21
Years of Service
User Offline
Joined: 3rd Sep 2003
Location:
Posted: 4th Sep 2003 19:09
Well. Here's the code. The rotation of the tank is made on the Y axis. Plz help me.

Im thinking on multplying the groun height coordinates per the sinus or cosinus of the object Y angle instead of the process i'm using now. I hope that's the error, but i'm not sure about that.
ReD_eYe
22
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 4th Sep 2003 19:44
use newxvalue and newzvalue to get the ground height in front and to the sides of the tank, the object position x/z uses the ?world? axis that don't change so if you turn it won't work, i think?


GermitoX
21
Years of Service
User Offline
Joined: 3rd Sep 2003
Location:
Posted: 5th Sep 2003 20:45
Yeah. Thx for the tip. I'll see, but the newxvalue is for a new x value whith angle correction included. What i need is some way of rptating an object always in the axis X and Z, and they don´t do the same rotation, when i turn the object in Y. Thats the problem. Use the code i´ve posted. The object 1 is the object that moves over the matrix. Angx# is the value for the X axis angle. Angz# is the value for the Z axis angle.

I'll update the code. I've a new idea. Just changing a couple of things. If it funcs, i'll post it for the ones who want it to use it.
GermitoX
21
Years of Service
User Offline
Joined: 3rd Sep 2003
Location:
Posted: 8th Sep 2003 19:28
Well, here`s the same code a bit better than the last one. The problem is still bothering me, but this version is prepared to calculate the right values for the X and Z angles.

Login to post a reply

Server time is: 2025-05-20 13:58:05
Your offset time is: 2025-05-20 13:58:05