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.

3 Dimensional Chat / angle x

Author
Message
crighton
19
Years of Service
User Offline
Joined: 5th Nov 2005
Location: In your soup.
Posted: 20th Jul 2007 13:22
hay all,

I'm hoping this is the correct place to ask this and sorry if it has been asked before, but I am seriously stumped on this.(not to good with trig ect)

Anyway, how do you get the x angle between two 3d co-ords?
i get how to get the y angle,
atanfull(mex#-mobx#,mez#-mobz#)
but now how do you get the x angle.
I have tryed just
atanfull(mey#,enemyy#)
but obviously that isnt correct, because from my understanding, I need the distance in x and z aswell.

Well, thanks in advance.

crighton


Why are the forgotten always remembered? But no-one remembers me?!
Image All
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: Home
Posted: 20th Jul 2007 18:38


crighton
19
Years of Service
User Offline
Joined: 5th Nov 2005
Location: In your soup.
Posted: 21st Jul 2007 05:19
thanks image all.
Going to try it now, but I have never used vectors before so this will be interesting.


cheers
crighton


Why are the forgotten always remembered? But no-one remembers me?!
crighton
19
Years of Service
User Offline
Joined: 5th Nov 2005
Location: In your soup.
Posted: 21st Jul 2007 05:59
ok that worked but I needed to take the final value from 360 to get it to shoot in the right direction (EG. down or up depending on where I was).

But I have another problem that seems rather silly,
when I or the enemy shoots we both seem to max out our xangle at a certain ....well... angle.

So, I tryed to cheat alittle to make the task as simple as possible and I still get the exact same thing.
heres the mob ai to get the anglex


As it says, there isnt any restrictions at all, but.... heres the fireball routine. This just finds the first free fireball to use then returns.


Again, no restriction
anyway I hope someone knows or can figure out whats goin on, this is getting frustrating. Again thanks in advance.

cheers
crighton



Why are the forgotten always remembered? But no-one remembers me?!
crighton
19
Years of Service
User Offline
Joined: 5th Nov 2005
Location: In your soup.
Posted: 22nd Jul 2007 09:21
Ok, I just had a major brain spasm(fart some might call it).

Now the speed to gain height would be directionally proportional to the speed along the x and z plains wouldnt it?

eg.
If the bullet travels at a speed of 200 with 0 xangle, then increasing the xangle would slow the speed of the x and z?

so this is how it would work



and so far this works, it appears that the newx and newz value's do not take into consideration the x angle.

cool huh?!

but if im totally off track and theres still a better solution, please feel free to respond.


cheers
crighton


Why are the forgotten always remembered? But no-one remembers me?!

Login to post a reply

Server time is: 2024-11-26 06:30:02
Your offset time is: 2024-11-26 06:30:02