POV-Ray : Newsgroups : povray.general : Rendering meshes with unique color per face : Rendering meshes with unique color per face Server Time
2 Nov 2024 13:20:04 EDT (-0400)
  Rendering meshes with unique color per face  
From: Marc Ellenrieder
Date: 29 Feb 2004 04:43:06
Message: <4041b429@news.povray.org>
Hi, 

I'm trying to render a PovRay mesh with different colors for each face. The
colors are numbered from 0 to NumberofFaces.I have split up the
color-number longint value into three bytes for each RGB color. So the
first face gets the color <0 , 0, 1/255>, the second <0,0,2/255>, the 256th
face the color <0, 1/255,0> and so on. 

Basically, the idea is to know in the final image, which face is visible in
a particular pixel by using the color value as an index.

Now I have the problem, that I am not able to tell PovRay to perform no
shading. That results in a problem, as PovRay renders neighbouring faces
with e.g. color 1 and 2 in the same color. Thus I am no longer able to
differntiate between the faces in the image. 

I tried to turn off all anti-aliasing, buffering etc. and even tried to
render with -Q0. The result was, that I got unique colors per face but now
the color-value did no longer correspond to the face number. 

What more can I do? Is PovRay the right tool to use for this task?

I have attached a sample .pov file and the command line I used to this
message. Any suggestions are welcome.

    Thank you, 

        Marc 


povray +Imodel.pov +O model.bmp +W640 +H480 -A -UL -UV -Q0 

============================================================================== 

// a simple cube

#declare model = mesh2 { 

vertex_vectors { 
   8 
   < +2972.72000 , -2972.71900 , -2972.72000 > 
   < +2972.72000 , +2972.72000 , -2972.72000 > 
   < -2972.72000 , +2972.71900 , -2972.72000 > 
   < -2972.71900 , -2972.72100 , -2972.72000 > 
   < +2972.72100 , -2972.71800 , +2972.72000 > 
   < -2972.71900 , -2972.72000 , +2972.72000 > 
   < -2972.72100 , +2972.71900 , +2972.72000 > 
   < +2972.71800 , +2972.72100 , +2972.72000 > 
    } 
texture_list { 
   12 
   texture{pigment{rgb <0,0,3.921569e-003>}} 
   texture{pigment{rgb <0,0,7.843137e-003>}} 
   texture{pigment{rgb <0,0,1.176471e-002>}} 
   texture{pigment{rgb <0,0,1.568627e-002>}} 
   texture{pigment{rgb <0,0,1.960784e-002>}} 
   texture{pigment{rgb <0,0,2.352941e-002>}} 
   texture{pigment{rgb <0,0,2.745098e-002>}} 
   texture{pigment{rgb <0,0,3.137255e-002>}} 
   texture{pigment{rgb <0,0,3.529412e-002>}} 
   texture{pigment{rgb <0,0,3.921569e-002>}} 
   texture{pigment{rgb <0,0,4.313725e-002>}} 
   texture{pigment{rgb <0,0,4.705882e-002>}} 
    } 
face_indices { 
   12 
   <   0 ,   1 ,   2 >,0 
   <   2 ,   3 ,   0 >,1 
   <   4 ,   5 ,   6 >,2 
   <   6 ,   7 ,   4 >,3 
   <   0 ,   4 ,   7 >,4 
   <   7 ,   1 ,   0 >,5 
   <   1 ,   7 ,   6 >,6 
   <   6 ,   2 ,   1 >,7 
   <   2 ,   6 ,   5 >,8 
   <   5 ,   3 ,   2 >,9 
   <   4 ,   0 ,   3 >,10 
   <   3 ,   5 ,   4 >,11 
    } 
} 
camera { 
        perspective 
        location  < -5352.586, -50926.453, +5382.069 > 
        direction < +0.104, +0.989, -0.105 > 
        up        < +0.011, +0.103, +0.989 > 
        sky       < +0.011, +0.103, +0.989 > 
        right     < +0.989, -0.104, +0.000 > 
        angle     7.772 
       } 

background { color rgb <1, 1, 1> } 

global_settings { assumed_gamma 1.0 ambient_light rgb <1, 1, 1> } 

// Show the model 

model


Post a reply to this message

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