POV-Ray : Newsgroups : povray.newusers : mesh2: vertex_vectors and normal_vectors Server Time
1 Jun 2024 07:40:52 EDT (-0400)
  mesh2: vertex_vectors and normal_vectors (Message 1 to 9 of 9)  
From: Ansgar
Subject: mesh2: vertex_vectors and normal_vectors
Date: 16 Jul 2012 04:15:00
Message: <web.5003cc13bfc2ad88940d19d60@news.povray.org>
Hi there.

I have several mesh2 objects (generated from 3ds files with Rheingold3D) which
work just fine when I use them in Povray scenes.
However, I'd also like to import them into a realtime 3D engine (Irrlicht) to do
a kind of preview.
I'm currently writing a parser to do just that.

Now the problem: I noticed that several of the meshes have fewer normal_vectors
than vertex_vectors. How is the assignment done in these cases, meaning, how do
I know which normal vectors belong to which vertex vectors?


Post a reply to this message

From: Le Forgeron
Subject: Re: mesh2: vertex_vectors and normal_vectors
Date: 16 Jul 2012 07:22:39
Message: <5003f97f$1@news.povray.org>
Le 16/07/2012 10:12, Ansgar a écrit :
> Hi there.
> 
> I have several mesh2 objects (generated from 3ds files with Rheingold3D) which
> work just fine when I use them in Povray scenes.
> However, I'd also like to import them into a realtime 3D engine (Irrlicht) to do
> a kind of preview.
> I'm currently writing a parser to do just that.
> 
> Now the problem: I noticed that several of the meshes have fewer normal_vectors
> than vertex_vectors. How is the assignment done in these cases, meaning, how do
> I know which normal vectors belong to which vertex vectors?

Greetings,

Mesh2 is a syntax which delights in using indexes.

vertex_vectors are/is the raw set of vertex's/vertices' position.

normal_vectors are/is the raw set of normal's vector.

Usually, there is no duplicate entry in a set: let's take a mesh2 of a
torus. Every vertex is different. Yet, some vertices have exactly the
same normal (e.g. on the top circle, every point has a normal pointing up).

*answer to question*:
The real description of the association between vertices (to form
triangle or smooth_triangle) themselves and between vertices and
normales happens in face_indices{} and normal_indices{}

face_indices can become more complex with textures (including the
capability that each vertex of a triangle get its own texture, and that
the texture associated with a vertex might change along with each
triangle it is part of).

See >
http://wiki.povray.org/content/Documentation:Tutorial_Section_3.1#Mesh2_Object


Post a reply to this message

From: clipka
Subject: Re: mesh2: vertex_vectors and normal_vectors
Date: 16 Jul 2012 07:47:05
Message: <5003ff39$1@news.povray.org>
Am 16.07.2012 10:12, schrieb Ansgar:
> Hi there.
>
> I have several mesh2 objects (generated from 3ds files with Rheingold3D) which
> work just fine when I use them in Povray scenes.
> However, I'd also like to import them into a realtime 3D engine (Irrlicht) to do
> a kind of preview.
> I'm currently writing a parser to do just that.

Are you sure you want to go though all that pain, and not use some 
existing tool? PoseRay comes to my mind (AFAIK it can convert between 
.obj and POV-Ray mesh2 both ways.)


Post a reply to this message

From: Ansgar
Subject: Re: mesh2: vertex_vectors and normal_vectors
Date: 17 Jul 2012 02:20:01
Message: <web.5005038b1e53fec44f1bb22c0@news.povray.org>
Le_Forgeron <lef### [at] freefr> wrote:
> *answer to question*:
> The real description of the association between vertices (to form
> triangle or smooth_triangle) themselves and between vertices and
> normales happens in face_indices{} and normal_indices{}
>
> face_indices can become more complex with textures (including the
> capability that each vertex of a triangle get its own texture, and that
> the texture associated with a vertex might change along with each
> triangle it is part of).
>
> See >
> http://wiki.povray.org/content/Documentation:Tutorial_Section_3.1#Mesh2_Object


Well thanks for the answer, but I'm not sure what to make of this. Does it mean
that I scan the entire list of normal_indices, and when a particular index of a
vertex_vector never appears in it, it means that this particular vertex_vector
has no normal_vector?


clipka <ano### [at] anonymousorg> wrote:
> Are you sure you want to go though all that pain, and not use some
> existing tool? PoseRay comes to my mind (AFAIK it can convert between
> .obj and POV-Ray mesh2 both ways.)


Well currently my program is using .3ds files for the preview and POV mesh2
files for the final raytracing in POV. Works, sure thing. It would just be more
elegant if the preview renderer could read the pov files as well, then I
wouldn't have to deliver the geometry files twice in two different formats. :)
Clearer now? :)

Btw, thanks for your replies so far. :)


Post a reply to this message

From: Le Forgeron
Subject: Re: mesh2: vertex_vectors and normal_vectors
Date: 17 Jul 2012 02:36:54
Message: <50050806$1@news.povray.org>
Le 17/07/2012 08:17, Ansgar a écrit :
>> *answer to question*:
>> > The real description of the association between vertices (to form
>> > triangle or smooth_triangle) themselves and between vertices and
>> > normales happens in face_indices{} and normal_indices{}
>> >
>> > See >
>> > http://wiki.povray.org/content/Documentation:Tutorial_Section_3.1#Mesh2_Object
> 
> Well thanks for the answer, but I'm not sure what to make of this. Does it mean
> that I scan the entire list of normal_indices, and when a particular index of a
> vertex_vector never appears in it, it means that this particular vertex_vector
> has no normal_vector?

Nop.


face_indices{} lists, with order, all the triangles (true or smooth) of
the mesh.

normal_indices{} uses the same order as face_indices{} to described the
faked normal attached at a vertex for a triangle. When the number of
entries in normal_indices{} is smaller than the number of entries in
face_indices{}, the end of the list are just flat triangles without
faked normales.

face_indices{} references the vertex_vector{}
normal_indices{} reference the normal_vector{}

Triangle#23 in face_indices{} has the same position in normal_indices{}.


Post a reply to this message

From: Ansgar
Subject: Re: mesh2: vertex_vectors and normal_vectors
Date: 17 Jul 2012 03:00:00
Message: <web.50050d1b1e53fec44f1bb22c0@news.povray.org>
Blargh. Got it. Thanks a lot for your help! :)


Post a reply to this message

From: Thomas de Groot
Subject: Re: mesh2: vertex_vectors and normal_vectors
Date: 17 Jul 2012 03:04:21
Message: <50050e75@news.povray.org>
On 17-7-2012 8:17, Ansgar wrote:

> Well currently my program is using .3ds files for the preview and POV mesh2
> files for the final raytracing in POV. Works, sure thing. It would just be more
> elegant if the preview renderer could read the pov files as well, then I
> wouldn't have to deliver the geometry files twice in two different formats. :)
> Clearer now? :)

Poseray can read (and preview) mesh2 files, in addition to .obj, .3ds, 
.lwo, .dxf, .raw, .wrl, .gz


Thomas


Post a reply to this message

From: Ansgar
Subject: Re: mesh2: vertex_vectors and normal_vectors
Date: 17 Jul 2012 03:25:00
Message: <web.500512771e53fec44f1bb22c0@news.povray.org>
Thomas de Groot <tho### [at] degrootorg> wrote:
>
> Poseray can read (and preview) mesh2 files, in addition to .obj, .3ds,
> .lwo, .dxf, .raw, .wrl, .gz
>
>
> Thomas


Thanks for the info, but I kinda need my own program to do it. :)
It's a uniform creator for an online gaming club, it gathers all the rank/award
info and compiles it to a uniform. You can preview it in OpenGL or Direct3D and
raytrace it with POV.
So I'm not trying to build another Poseray but something entirely different.


Post a reply to this message

From: Thomas de Groot
Subject: Re: mesh2: vertex_vectors and normal_vectors
Date: 17 Jul 2012 03:28:05
Message: <50051405$1@news.povray.org>
On 17-7-2012 9:21, Ansgar wrote:
>
> Thanks for the info, but I kinda need my own program to do it. :)
> It's a uniform creator for an online gaming club, it gathers all the rank/award
> info and compiles it to a uniform. You can preview it in OpenGL or Direct3D and
> raytrace it with POV.
> So I'm not trying to build another Poseray but something entirely different.
>
You are welcome. Just in case you were not trying to reinvent the wheel 
so to speak ;-) Personally, I sure would hate to do that.

Thomas


Post a reply to this message

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