POV-Ray : Newsgroups : povray.general : Mesh question Server Time
6 Nov 2024 22:14:42 EST (-0500)
  Mesh question (Message 1 to 3 of 3)  
From: Court-Jus
Subject: Mesh question
Date: 4 Mar 2004 03:21:18
Message: <4046e6fe$1@news.povray.org>
Hello,

I've downloaded an object file that consists as a list of vertices with 
color in this format :

x y z r g b

and then a list of triangles with references to the vertices like that :

id_vert1 id_vert2 id_vert3

is there a way to use that sort of object in povray ???

thanks

-- 
:wq
Court-Jus


Post a reply to this message

From: Warp
Subject: Re: Mesh question
Date: 4 Mar 2004 05:55:48
Message: <40470b34@news.povray.org>
Court-Jus <new### [at] court-jusnet> wrote:
> I've downloaded an object file that consists as a list of vertices with 
> color in this format :

> x y z r g b

> and then a list of triangles with references to the vertices like that :

> id_vert1 id_vert2 id_vert3

> is there a way to use that sort of object in povray ???

  If you append a comma to every value, you can read them from POV-Ray
and create an appropriate mesh.
  For reading the values, see the help about #fopen and #read.

-- 
plane{-x+y,-1pigment{bozo color_map{[0rgb x][1rgb x+y]}turbulence 1}}
sphere{0,2pigment{rgbt 1}interior{media{emission 1density{spherical
density_map{[0rgb 0][.5rgb<1,.5>][1rgb 1]}turbulence.9}}}scale
<1,1,3>hollow}text{ttf"timrom""Warp".1,0translate<-1,-.1,2>}//  - Warp -


Post a reply to this message

From: Florian Brucker
Subject: Re: Mesh question
Date: 5 Mar 2004 11:23:47
Message: <4048a993@news.povray.org>
>>I've downloaded an object file that consists as a list of vertices with 
>>color in this format :
>>x y z r g b

>   If you append a comma to every value, you can read them from POV-Ray

You may want to use a text editor to replace spaces with commas :) And 
if you've got a good text editor, replace newlines with commas, too (not 
all so-called text-editors can replace newlines, though).

Creating the mesh could be done in several ways. Best way would propably 
be to try to convert the data to mesh2-format which is only slightly 
different from the one you've got (just add some brackets and some 
keywords and get rid off the colour information).
You could do this in a text editor or via pov-script (first one is 
simpler, latter one lets you redo the job for several files once you've 
got it running).
The only problem I see is with the unique colour for each triangle: IMHO 
POV only supports 1) one texture for the whole mesh or 2) one 
_predefined_ texture for each triangle (MESH2). Therefore you could 
predefine all occuring textures (could be automated and could be quite 
an overhead depending on the number of different textures) or you can 
use a union of triangles where you can apply your texture on the fly but 
you'll lose the advantages of meshes that way. It really depends on what 
you want to do with the stuff.

HTH,
Florian


Post a reply to this message

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