POV-Ray : Newsgroups : povray.programming : mesh structure : mesh structure Server Time
2 May 2024 03:53:59 EDT (-0400)
  mesh structure  
From: Lukas Winter
Date: 30 Apr 2007 15:29:03
Message: <pan.2007.04.30.19.28.56.734905@removeit.geloescht.net>
I'm trying to make a mesh from the data a library, that I found on
the net, generates, but I'm not exactly sure, what I should fill in each
field of the structures.
At the moment I do the following things:

I fill Object->Data->Vertices with a POV_MALLOCated array of SNGL_VECTs.

Object->Data->Normals holds a POV_MALLOCated array of SNGL_VECTs which
holds the smooth normals (one for each vertex) as well as the triangle
normals (one for each triangle). (size = num_of_vertices +
num_of_triangles)

Object->Data->Triangles holds a POV_MALLOCated array of
MESH_TRIANGLEs. Each of it has P1, P2, P3 set to a index of a vertex, N1,
N2, N3 set to the same values as the smooth normals have the same indices
as the vertices, Three_Tex is false, Texture2 and Texture3 are
unitialised, Texture is set to -1 (???), Normal_Ind is set to the index of
a normal, the normal corresponding to Normal_Ind was calculated using
Compute_Mesh_Triangle, which hopefully also fills in the rest of the
values.

I don't want to use UV mapping, is it safe to simply set
Object->Data->UVCoords to NULL? Is it safe to set Object->Textures to
NULL, if I want to texture the whole mesh with one texture? Will
Object->Data->Tree be fully created by Build_Mesh_BBox_Tree(Object)? Do I
have to fill in other values after Create_Mesh if I use Parse_Object_Mods()?
Thanks in advance,
Lukas

PS:
Code version is 3.6.1. If everything works I will post my result to
povray.binaries.images and the patch to povray.binaries.programming.


Post a reply to this message

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