POV-Ray : Newsgroups : povray.general : Mesh - how to... : Mesh - how to... Server Time
2 Nov 2024 13:17:12 EDT (-0400)
  Mesh - how to...  
From: Yansen
Date: 23 Feb 2004 06:12:33
Message: <4039e021@news.povray.org>
Hello.
I wrote a program that export geometry to POV file and I have a problem.
POV-Ray want something like that:

#declare Red = texture {
    pigment { color rgb<1.0, 0.0, 0.0> }
    finish { ambient 0.2 diffuse 0.5 }
  } 
mesh {
   triangle {<0, 0, 0>, <0, 10, 0>, <10, 0, 0>
   texture { Red }
  }  
 texture {
  pigment { color rgb<0.9, 0.9, 0.9> }
  finish { ambient 0.2 diffuse 0.7 }
 }}
and I don't like this becouse that mean I must know color of my triangle BEFORE i
create geometry. What I wana do is somthing similar to OpenGL commands:
glBegin(GL_TRIANGLES);
 glColor3f(something...);glNormal3f(something...);glVertex3f(something...);
 glColor3f(something...);glNormal3f(something...);glVertex3f(something...);
 glColor3f(something...);glNormal3f(something...);glVertex3f(something...);
glEnd(); 
Which mean I have color, and normal vector assigned to each vertex. How to do
something like that in POV-Ray? If someone can give me simple answer (witch mean
simple code :-) ) I be greatful.

Yansen.
PS Sorry for may poor english skill...


Post a reply to this message

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