views:

76

answers:

1

A little backstory, 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.

A: 

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 =)

MarceloRamires
The language is doesn't really matter :P, the mathematics behind the problem is the same. Regardless I'll give your equation a go, thank you.
Fascia
Do'h, no that doesn't work, the triangle can be any orientation in 3D space so taking the Z value of v1 wouldn't work. Thanks for your help though.
Fascia
Ok, I thought everything was in the same plan (vx.z = 0) but as it isn't necessarely so, I've edited it.
MarceloRamires
@Fascia Is it easy working with 3D ? I'd love to give it a try.. but I ain't got the guts, but I somehow comprehended your question (I like spacial geometry) and I'll probably make my first move in it soon. What do you recommend ? like.. a bouncing 3d ball or anything. I have experience in .NET. BTW, did it really help in any way? haha
MarceloRamires