• ### What is your GameDev Story?

#### Archived

This topic is now archived and is closed to further replies.

# Angles and 3d lines

This topic is 6854 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

ok I''m getting read to work on a 3d game and I was wondering how I could find the path of a line through 3d space. I was planning on using the angle off of the xy plane and xz plane to figure out how an object is facing then use a line to look ahead to see if theres anything in the way... I''m wondering what a formual for that would be.... Great Milenko

Words Of Wisdom:
"Never Stick A Pretzel In Your Butt It Might Break Off In There."

http://www.crosswinds.net/~milenko
http://www.crosswinds.net/~pirotech

##### Share on other sites
You have the normal of your object?
and is rotating it along with the object?
if not just make it 0,0,1 from the begining (or 0,1,0 if you are a 3ds freak )
if you have it your line will be starting from the objects position and extends in the normals direction
Ox,Oy,Oz = object position
nx,ny,nz = the normal
x=Ox + t(nx)
y=Oy + t(ny)
z=Oz + t(nz)
damn i´m bad on explaining things..but I hope this helps a bit

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 10
• 11
• 13
• 9
• 11
• ### Forum Statistics

• Total Topics
634091
• Total Posts
3015435
×