POV-Ray : Newsgroups : povray.programming : About the Mesh Server Time
23 Dec 2024 10:36:29 EST (-0500)
  About the Mesh (Message 1 to 9 of 9)  
From: Wu Yang
Subject: About the Mesh
Date: 23 Oct 2002 23:49:12
Message: <3db76db8@news.povray.org>
Hi, all
    In mesh.cpp, there is a Intersect_Mesh() function. In this function,
there is a Mesh pointer and I found that  Mesh->Data->Vertices is the x
values of a triangle corners. Is that right? How can I get the x, y, z
values of the corners?

Thanks
Wu Yang


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: About the Mesh
Date: 24 Oct 2002 04:48:09
Message: <3db7b3c9@news.povray.org>
In article <3db76db8@news.povray.org> , "Wu Yang" <wya### [at] cswrightedu> 
wrote:

>     In mesh.cpp, there is a Intersect_Mesh() function. In this function,
> there is a Mesh pointer and I found that  Mesh->Data->Vertices is the x
> values of a triangle corners. Is that right? How can I get the x, y, z
> values of the corners?

No offense, but given the kind of questions you ask you may want to learn a
bit more C first and maybe gain experience with less complex applications
before you start looking into the POV-Ray source code.

As you should be able to see easily from the source code, Mesh->Data is
pointer to Mesh_Data_Struct and Vertices is an array of SNGL_VECT...

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Wu Yang
Subject: Re: About the Mesh
Date: 24 Oct 2002 08:52:47
Message: <3db7ed1f@news.povray.org>
Thank you for your reply. What I mean is that: when I see the value of
Mesh->Data->Vertices, I can get three values. These three values is the x
values of a triangle's three corners, not (x,y,z) of a corner. I want get
the (x,y,z) of every corner. Could you please give me some advice? Thanks
Wu Yang
"Thorsten Froehlich" <tho### [at] trfde> wrote in message
news:3db7b3c9@news.povray.org...
> In article <3db76db8@news.povray.org> , "Wu Yang" <wya### [at] cswrightedu>
> wrote:
>
> >     In mesh.cpp, there is a Intersect_Mesh() function. In this function,
> > there is a Mesh pointer and I found that  Mesh->Data->Vertices is the x
> > values of a triangle corners. Is that right? How can I get the x, y, z
> > values of the corners?
>
> No offense, but given the kind of questions you ask you may want to learn
a
> bit more C first and maybe gain experience with less complex applications
> before you start looking into the POV-Ray source code.
>
> As you should be able to see easily from the source code, Mesh->Data is
> pointer to Mesh_Data_Struct and Vertices is an array of SNGL_VECT...
>
>     Thorsten
>
> ____________________________________________________
> Thorsten Froehlich, Duisburg, Germany
> e-mail: tho### [at] trfde
>
> Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Le Forgeron
Subject: Re: About the Mesh
Date: 24 Oct 2002 10:14:19
Message: <3DB80055.6050701@free.fr>
Wu Yang wrote:

> Thank you for your reply. What I mean is that: when I see the value of
> Mesh->Data->Vertices, I can get three values. These three values is the x
> values of a triangle's three corners, not (x,y,z) of a corner. I want get
> the (x,y,z) of every corner. Could you please give me some advice? Thanks
> Wu Yang


No offense again, but you do not understand the Mesh data structure.
The three values of a line of the Mesh->Data->Vertices are the (x,y,z) 
of a single Vertex.

I believe you are not yet ready to play with the mesh code!


Post a reply to this message

From: Christopher James Huff
Subject: Re: About the Mesh
Date: 24 Oct 2002 10:31:17
Message: <chrishuff-BA6C20.10243124102002@netplex.aussie.org>
In article <3db7ed1f@news.povray.org>, "Wu Yang" <wya### [at] cswrightedu> 
wrote:

> Thank you for your reply. What I mean is that: when I see the value of
> Mesh->Data->Vertices, I can get three values. These three values is the x
> values of a triangle's three corners, not (x,y,z) of a corner.

No, it isn't. It's what he said it was, and what the code says it is: a 
SNGL_VECT, a single-precision vector.


> I want get the (x,y,z) of every corner. Could you please give me some 
> advice? Thanks

I'd have to agree with the advice he has already given: learn C. Your 
questions indicate that you don't know it, and messing around with 
anything but the most basic things without knowing the language POV is 
written in is just not going to work.
Ideally, get a simple primer book on C++, POV was originally written in 
C, so most of it is structured like a C program, but it now uses C++. I 
have a book called the "C++ Primer Plus" by the Waite group that I'd 
recommend.
Once you've got the basics down, then you have a chance of understanding 
the POV code...but don't expect to have everything handed to you on a 
silver platter, you will have to carefully read the code and look at the 
structure of the different parts. And when someone tells you something 
or asks you a question, don't just ignore what they said.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: About the Mesh
Date: 24 Oct 2002 10:31:24
Message: <3db8043c$1@news.povray.org>
In article <3db7ed1f@news.povray.org> , "Wu Yang" <wya### [at] cswrightedu> 
wrote:

> Thank you for your reply. What I mean is that: when I see the value of
> Mesh->Data->Vertices, I can get three values. These three values is the x
> values of a triangle's three corners, not (x,y,z) of a corner.

No, a vertex is a "corner".  And "vertices" is the plural of "vertex".

> I want get
> the (x,y,z) of every corner. Could you please give me some advice? Thanks

You need to know the index of the three triangle vertices, as the whole
mesh.cpp code does all over the place:

MESH *Mesh = ...;
MESH_TRIANGLE *Triangle = &(Mesh->Triangles[index]);

Mesh->Data->Vertices[Triangle->P1][X]
Mesh->Data->Vertices[Triangle->P1][Y]
Mesh->Data->Vertices[Triangle->P1][Z]

Mesh->Data->Vertices[Triangle->P2][X]
Mesh->Data->Vertices[Triangle->P2][Y]
Mesh->Data->Vertices[Triangle->P2][Z]

Mesh->Data->Vertices[Triangle->P3][X]
Mesh->Data->Vertices[Triangle->P3][Y]
Mesh->Data->Vertices[Triangle->P3][Z]

Really, I don't want to be discouraging, but if you have such problems, it
will be a very frustrating experience to look at the POV-Ray source code.
And you won't be learning much from it...

    Thorsten


Post a reply to this message

From: Wu Yang
Subject: Re: About the Mesh
Date: 24 Oct 2002 10:32:12
Message: <3db8046c@news.povray.org>
Thank you for your reply. But the following is what I did.
In *.pov file
     .......
     mesh {
   smooth_triangle { <-18.2369, 57.4258, 115.298>,
<-0.333333, -0.666667, -0.666667>, <-32.0698, 57.4258, 99.813>,
<0.449391, -0.887923, 0.098189>, <-32.0698, 57.4258, 115.298>,
<0.816497, -0.408248, -0.408248> }
              }
And the Mesh->Data->Vertices I saw is<-18.2369, -32.0698, -32.0698>. Is this
the (x,y,z) of a single Vertex?Thank you.

Wu Yang

"Le Forgeron" <jgr### [at] freefr> wrote in message
news:3DB### [at] freefr...
> Wu Yang wrote:
>
> > Thank you for your reply. What I mean is that: when I see the value of
> > Mesh->Data->Vertices, I can get three values. These three values is the
x
> > values of a triangle's three corners, not (x,y,z) of a corner. I want
get
> > the (x,y,z) of every corner. Could you please give me some advice?
Thanks
> > Wu Yang
>
>
> No offense again, but you do not understand the Mesh data structure.
> The three values of a line of the Mesh->Data->Vertices are the (x,y,z)
> of a single Vertex.
>
> I believe you are not yet ready to play with the mesh code!
>
>
>


Post a reply to this message

From: Wu Yang
Subject: Re: About the Mesh
Date: 24 Oct 2002 10:49:33
Message: <3db8087d@news.povray.org>
I got it. Thank you very much.
Best Regard
Wu Yang

"Thorsten Froehlich" <tho### [at] trfde> wrote in message
news:3db8043c$1@news.povray.org...
> In article <3db7ed1f@news.povray.org> , "Wu Yang" <wya### [at] cswrightedu>
> wrote:
>
> > Thank you for your reply. What I mean is that: when I see the value of
> > Mesh->Data->Vertices, I can get three values. These three values is the
x
> > values of a triangle's three corners, not (x,y,z) of a corner.
>
> No, a vertex is a "corner".  And "vertices" is the plural of "vertex".
>
> > I want get
> > the (x,y,z) of every corner. Could you please give me some advice?
Thanks
>
> You need to know the index of the three triangle vertices, as the whole
> mesh.cpp code does all over the place:
>
> MESH *Mesh = ...;
> MESH_TRIANGLE *Triangle = &(Mesh->Triangles[index]);
>
> Mesh->Data->Vertices[Triangle->P1][X]
> Mesh->Data->Vertices[Triangle->P1][Y]
> Mesh->Data->Vertices[Triangle->P1][Z]
>
> Mesh->Data->Vertices[Triangle->P2][X]
> Mesh->Data->Vertices[Triangle->P2][Y]
> Mesh->Data->Vertices[Triangle->P2][Z]
>
> Mesh->Data->Vertices[Triangle->P3][X]
> Mesh->Data->Vertices[Triangle->P3][Y]
> Mesh->Data->Vertices[Triangle->P3][Z]
>
> Really, I don't want to be discouraging, but if you have such problems, it
> will be a very frustrating experience to look at the POV-Ray source code.
> And you won't be learning much from it...
>
>     Thorsten


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: About the Mesh
Date: 24 Oct 2002 10:58:53
Message: <3db80aad@news.povray.org>
In article <3db8046c@news.povray.org> , "Wu Yang" <wya### [at] cswrightedu> 
wrote:

> And the Mesh->Data->Vertices I saw is<-18.2369, -32.0698, -32.0698>. Is this
> the (x,y,z) of a single Vertex?Thank you.

Well, if you see that you don't understand what the debugger is showing you.
Not knowing which IDE you are using, I am going to guess it is Visual
Studio:  You should be able to expand (the little box with the plus sign)
each of those rows to see all entries.

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

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