|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Le 30.04.2007 21:29, Lukas Winter nous fit lire :
> 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.
Been there, done that for GTS in 3.1...
> At the moment I do the following things:
[SNIP]
>
>
> 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.
Best approach is probably to look at the parsing code of mesh{} and
mesh2{} objects, and possibly mimics them.
--
The superior man understands what is right;
the inferior man understands what will sell.
-- Confucius
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Am Tue, 01 May 2007 09:43:20 +0200 schrieb Le Forgeron:
> Le 30.04.2007 21:29, Lukas Winter nous fit lire :
>> 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.
>
> Been there, done that for GTS in 3.1...
>
>> At the moment I do the following things:
> [SNIP]
>>
>>
>> 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.
>
> Best approach is probably to look at the parsing code of mesh{} and
> mesh2{} objects, and possibly mimics them.
I have already done that, but all the parsing work obscures what is really
done with the mesh structure itself. I think povray 3.6.1 has a lot of
unreadable code and parse.cpp is one of the messiest files... However, I
think I have found a bug in my code and I'll see what will happen, if I
fix it ;)
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I think now I found out how to do it correctly :)
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|