POV-Ray : Newsgroups : povray.general : from quad to triangle ...? : Re: from quad to triangle ...? Server Time
2 Nov 2024 05:21:49 EDT (-0400)
  Re: from quad to triangle ...?  
From: John VanSickle
Date: 26 May 2004 19:04:32
Message: <40B52279.1BA96716@hotmail.com>
ingo wrote:
> 
> While working on a mesh2 to *obj converter I ran into a problem. It
> seems that is important to the obj file and applications that use it how
> a quad is dividen in triangles. Or better, in what order the vertices
> should be specified, counteclockwise.
> 
> D     C
> ------
> |   /|
> |  / |
> | /  |
> |/   |
> ------
> A     B
> 
> It wants <A,B,C>, <D,A,C>. Otherwise the normals get messed up, even if
> no normals are specified in the obj file. I only have to Poseray to test
> this and assume it works the right way.
> 
> Is there a consensus on how to specify quads>triangles in the CG world?
> 
> Is there a way to figure out from a list of face_indices and vertices in
> what way the faces are written?

My New Surface Subdivision Suite contains code that does this.  It was
posted to p.b.scene-files a few days ago.

Basically you look at each edge, and see the way the vertices of that edge
are specified in the faces bordering on that edge.  If they are named in
opposite order, you're cool.

So if one triangle has the vertices A, B, and C, then the other triangle can
have vertices B,A,D, D,B,A, or A,D,B (assuming that A and B are the shared
vertices).

Regards,
John



Regards,
John


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.