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 / Can't get object or limb angles on Z axis DBC

Author
Message
D18AGON
20
Years of Service
User Offline
Joined: 25th Sep 2004
Location:
Posted: 11th Jan 2006 05:42
I have been tring to get a return value for and object or limb's x,y,and z angles (in world OR object relativity).
x and y axis return values; y is good, x is inacurate.
Z onle EVER returns zero.

this is the same for both getting limb and object angles using:
"returnvalue=object angle z(obj no#)"
"returnvalue=limb angle z(obj no#)"

I've tried using "ATANFull" which does return angle values for Z axis, but I am still reading it as inacurate.

Using a "light" pos'd @ 1 limb and "POINTING" to another limb has does return angle values which I had to convert into 0 to 360'.
I was hoping to use my lights for other things....

I want to know: if anybody else has the same problem with get'n/returning Zaxis Angles for object or limb?
or not?
I'm sort of reling on it; else I have to compromise.
I like DB so far; and would appreciate your input.
smallg
Valued Member
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 11th Jan 2006 14:59
works fine for me for objects.....and for limbs..... so don't know whats wrong for u, can u post some code?

just noticed
Quote: ""returnvalue=limb angle z(obj no#)""
, that should actually read;
"returnvalue=limb angle z(obj no#, limb no#)"
but i don't think that's your problem, um are you sure the limb isn't meant to read 0? have you tried "rotate limb obj #,limb #, x,y,z" and then reading the value of z?

life's one big game
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 11th Jan 2006 15:05
The limb angles are the relative angles to it's parent limb. If you have a gun, linked to the player's hand and rotate the limb 90 degrees. It will be turned 90 degrees relative to the hand.
If your limb hasn't a parent limb, the limb parent would be the object itself.

If you want world angles, use limb direction x/y/z(objnr, limbnr).

If it still doesn't work, it has to be something with your code or the structure of your object.

cheers

Sven B

It's the programmer's life:
Have a problem, solve the problem, and have a new problem to solve.
Milkman
19
Years of Service
User Offline
Joined: 30th Nov 2005
Location: United States
Posted: 13th Jan 2006 00:12
you probably know this... but if you havn't specifically rotated the object on it's z axis, then your z angle will always be zero
by pointing an object, it does not change the z angle of an object. try this:



works fine for me...

"Genius is 1% inspiration and 99% perspiration"
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 13th Jan 2006 00:46
There used to be a bug where angle Z would always return 0, but this was fixed in an update.

Make sure you're using the latest version (1.13)

Login to post a reply

Server time is: 2025-05-22 23:42:02
Your offset time is: 2025-05-22 23:42:02