开发者

Finding the 'foot' of an altitude of a triangle in 3D space

A little 开发者_如何学JAVAbackstory, currently I'm working on implementing a triangle rendering system in Expression2 to create .obj models.

One of the limitations I'm currently experiencing is that I cannot create polygons the old-fashioned way, rather, I'm having to create Isosceles triangles, and cut part of it off.

My current problem is that I'm working on how and where to place the Isosceles triangle. (I have everything else like angle already sorted out)

http://img22.imageshack.us/img22/3251/trianglem.png (Ignore the blue triangle)

v0, v1 and v2 are 3 co-ordinates in 3D space which make up the desired triangle.

The red line is a line that goes from v1 and meets the hypotenuse at right-angles along the plane of the triangle. I wish to calculate p1, which is essentially a point exactly half way between v1 and where the altitude meets the hypotenuse, aka the 'foot'.

My current attempt doesn't work what-so-ever:

Dot =   (v0-v1):dot(v0-v2)
P1 = v0 + Dot*((v0-v2):normalized())

I appreciate any help. Thank you.


I have no clue on the language you're using, What i undersood is that you have a certain triangle with these certain lines in somewhere in a space and you want the exact position of a certain dot.

If that is what you want, I guess a good approach would be (in nonexistant language..):

p.x = v0.x - v1.x   
p.y = v0.y + v1.y / 2
p.z = v0.z + v1.z / 2

I hope it helps.. sorry for posting an answer on something I absolutely don't know about, just trying to help =)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜