Painting tris/faces

Blitz3D Forums/Blitz3D Programming/Painting tris/faces

SabataRH(Posted 2008) [#1]
Hi, I'm currently working on a game editor within blitz3d.
I've been stumped now for a few days on something.

In my editor I allow for surface painting, just pick a textured brush and click on a surface.. The paint routine returns the triangle that was picked and paints it with the brush.

Obviously the mesh is broken apart and a new surface is added per brush each brush applied. When this happens I lose reference to the tris I painted.

My question, how does one go about painting a triangle and the triangle it shares the longest side with? I haven't given up on this because i recall terabit had achieved this in Decorator but I've yet to achieve this in my own application.

The painting quad insert in the code arc is of little good to me as it doesn't preform the procedure im wishing to achieve.

Ultimately I would love to be able to paint the entire face of a surface.

Any help or point in the right direction would be greatly appreciated.. thanks.




Ross C(Posted 2008) [#2]
Well, you could easily find the edge with the longest edge, with some simple maths. If you know the triangle you have, you can find the triangles vertices. Using this information, and upon finding the triangle with the longest edge, you can search the entire meshes triangles and find one that has the two of your vertices in it. There should only be one in the mesh at most.


SabataRH(Posted 2008) [#3]
Thanks Ross C, going to try that now.