|
![](/i/fill.gif) |
Jim Kress wrote:
>
> > Looking from which side?
>
> I am presented with a list of vertices (and their Cartesian coordinates) and
> a set of triples that specify the vertex numbers for each triangle. That is
> all the information I have
>
> How would I find out which side I am looking and then the direction?
>
> Jim
First, you need your location (let's it be O).
Then compute the normal at one vertex (using vector product of
the edge of the triangle),
and lastly use the sign of the scalar product of the normal with
the vector O-vertex.
Clockwise will have one sign, and anti the other one.
Another use/convention of clockwise/anticlockwise orientation is
to indicate hole in mesh, but then they provide the normal of the
triangle too (because hole do not depent on view point). This
is obviously not the case here.
At best, all you could have in your case is a fast scanline engine,
removing the triangle which are facing the wrong direction
(assuming the mesh is closed and without holes). Or a dual texturing of
the triangles.
--
Non Sine Numine
http://grimbert.cjb.net/
Etiquette is for those with no breeding;
fashion for those with no taste.
Post a reply to this message
|
![](/i/fill.gif) |