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 / Searching a compass code using XZ coords

Author
Message
Alduce
23
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 12th Mar 2013 01:00
Dudes I am searching hard a compass code that someone posted here in DBPro forum time ago.

I remember he was using the XZ coordinates to get the correct compass degrees.

If I remember good, the code was posted inside a "make smoke" topic thread

Somebody can help me to find or make a compass using XZ coordinates?
pcRaider
19
Years of Service
User Offline
Joined: 30th May 2007
Location:
Posted: 12th Mar 2013 01:24
The compasses which I made.

Alduce
23
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 12th Mar 2013 08:32 Edited at: 12th Mar 2013 09:03
Hi pcRaider and thx for code,
my objective is to obtain especially the code to obtain 0-359° but not using object angles.
If I remember good the code I am searching for was written to obtain compass degrees handling the XZ coordinates...

EDIT:
Solved guys! and thx again for help pcRaider
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 12th Mar 2013 11:11
Hi there.
Doesn't newxvalue/newzvalue give us the angle to final coords.?

I'm not a grumpy grandpa
Alduce
23
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 12th Mar 2013 11:54
Quote: "
Hi there.
Doesn't newxvalue/newzvalue give us the angle to final coords.?
"


Mmm interesting!
But I don't understand well the logic about..:

newxvalue(Current X Value, Angle Value, Step Value)

Is the "current X value" the main object X position?
And the angle value?

Can you make me an example please?
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 12th Mar 2013 12:12
Now I'm out....I think I've got an example from the forum somewhere...

I'm not a grumpy grandpa
Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 12th Mar 2013 14:37
x = newxvalue(x, angle, distance)
This moves a co-ordinate a given distance in a given direction with respect to the x axis.

It's similar to: x = x + ( sin(angle) * distance )


chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 12th Mar 2013 16:03
Hi again...Somehow you are right...we have to refer an angle, but we can get the same result just refering both x,z of starting point and ending point. Here you can see that with the x,z coords of two points( objects )...perhaps ATANFULL is the way you are looking for.





Cheers.

I'm not a grumpy grandpa
Alduce
23
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 13th Mar 2013 09:51
chafari thank you very much for code! and thx to OBese87 too!

Login to post a reply

Server time is: 2026-07-07 04:09:31
Your offset time is: 2026-07-07 04:09:31