POV-Ray : Newsgroups : povray.advanced-users : 2 mesh2 questions : Re: 2 mesh2 questions Server Time
5 Jul 2024 16:04:27 EDT (-0400)
  Re: 2 mesh2 questions  
From: Tom York
Date: 19 Oct 2007 13:20:01
Message: <web.4718e6353d8f78ef7d55e4a40@news.povray.org>
"gregjohn" <pte### [at] yahoocom> wrote:
> http://www.povray.org/documentation/view/3.6.1/68/
>
> 1) I'm trying to wrap my head around the concept of a UV mesh.  Could
> someone help me by explaining what they mean when they wrote things like,
> "/*as 8*/ /*as 0*/  /*as 2*/" in the doc?

I found that documentation a bit confusing, but what it's getting at is that
adjacent triangles in mesh2 can share vertices. On that page the example is
a mesh2 having 8 triangles. If you list every vertex as if the triangles
are separate objects you'll have 8*3 = 24 vertices. Compare the mesh2 of 24
vertices listed after the line "The complete mesh:", with the mesh2
containing 9 vertices that follows it. The duplicate vertices have been
removed and replaced with the /* as n */ (means "this has been removed
because it's a duplicate of vertex n").

In the example, all 8 triangles share the central vertex; we can record it
once and avoid 7 duplicates. Each pair of triangles also share a vertex on
the outer boundary of the shape, so instead of recording 16 vertices in the
vertex_vectors list to make up the outer boundary we only need to store 8
unique vertices. With the central vertex that's 9.

To still have a valid mesh you then use the face_indices list to build the
triangles - in the example you can see the advantage of the /* as n */
comments if you were building this mesh by hand, since if you read it line
by line, converting each line into a triangle index vector, you get your
face_indices list.

> 2) I've got a macro where I sweep my own mesh2.  I have a strategy question
> about computing power.

I would calculate the normals. It will allow smoother-looking meshes for
fewer triangles even if you have still have to use quite a few to beat the
shadow line artefact, and fewer triangles to parse and render => more
speed. In my experience increasing numbers of triangles don't slow down
rendering as much as they do parsing (not really surprising). With large
numbers of triangles the parse time can become as significant as the
rendering time if the materials and lighting used are simple.

Tom


Post a reply to this message

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