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.

AppGameKit Classic Chat / Does any one perhaps have angle from one point to another code

Author
Message
3d point in space
14
Years of Service
User Offline
Joined: 30th Jun 2009
Location: Idaho
Posted: 15th Jul 2013 15:45
This is for the bvh exporter. My angles are incorrect. An example would be (4,3,1) to (5,8,9) I would like the angles in theta x and theta z cord system. If no one has that piece of code I know that Tan-1 would work.

Developer of Space Chips, pianobasic, zipzapzoom, and vet pinball apps. Developed the tiled map engine seen on the showcase. Veteran for the military.
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 15th Jul 2013 16:23 Edited at: 15th Jul 2013 16:24
at first you have a difference(delta) between two points.
(this subtract move two points that one point is at 0,0 and the other is dx,dy)
dx=x2-x1
dy=y2-y1

with atanfull you should get a angle in degree.

you can get a angle from
x,y
y,z
x,z
3d point in space
14
Years of Service
User Offline
Joined: 30th Jun 2009
Location: Idaho
Posted: 15th Jul 2013 16:54 Edited at: 15th Jul 2013 16:59
actually i tried that and I think I like the look at object option works better.

but it looks like the cylinder is not pointing to the next point. but it makes the correct angles at least

Developer of Space Chips, pianobasic, zipzapzoom, and vet pinball apps. Developed the tiled map engine seen on the showcase. Veteran for the military.

Login to post a reply

Server time is: 2024-05-03 23:12:00
Your offset time is: 2024-05-03 23:12:00