#Double Click & Area Q's
7 messages in this thread
A few questions to anyone…
1) Has anyone created a function to handle double clicking the mouse in an
IPAS3 program? I would like to use this feature but don't know how to
implement it.
2) Does anyone know how to calculate the AREA of a triangle in 3 space? For
example I would like to create a function to which you pass 3 3d vertices and
it returns the area of the triangle formed by those verticies, i.e.
float tri_area(float x1, float y1, float z1, float x2, float y2, float z2,
float x3, float y3, float z3)
Thanks to anyone who can help,
Mark
< AREA of a triangle in 3 space? >
If a, b and c are the lengths of the sides, then the area is:
sqrt(s *(s-a) *(s-b)*(s-c) ) where s = 1/2(a+b+c)
Compute a, b, and c using the fact that the distance between two points is
sqrt( (x2-x1)squared + (y2-y1) squared + (z2-z1) squared )
Ed K
< AREA of a triangle in 3 space? >
Here's a way to do it with 1 sqrt():
Construct the vectors A and B as any two edges of the triangle.
A = < x2-x1, y2-y1, z2-z1 > B = < x3-x2, y3-y2, z3-z2 >
then the area is: 1/2 * |AxB|
– Rolf
Wow! Rolf, are you gonna be contributing on CIS regularly now? Heck, the
power of this forum just keeps growing! (Or are you just goofing off cause
Gary's on vacation?<g>)
Dave
I wish I had time to contribute more regularly. I browse through messages
fairly regularly, I just don't have time to post often. If only I didn't need
to sleep…
– Rolf
Well, it's still good to know you're here, lurking in the shadows….
"Say! What's that strange sound coming from the dark corner of the room?"
"Oh, that's just Rolf. He's just lurking and catching a few Z's!"
<g>
Dave
Ed,
<<Area>>
Thanks alot! I used your algorithm and coded up a routine this morning to
compute the surface area of any 3ds object at any frame of an animation. Works
great.
Mark
PS: I enjoyed your article in Planet Studio.