|
|
Hi everyone,
I have a utility that I wrote in C to generate 3d models. I have also
written an exporter that turns the models into 3d scripts that I can pass to
povray for final rendering.
The only problem is that I used openGL to make the modeler. It carries a
vertex format like this:
x,y,z,u,v
With u and v being texture coordinates (from 0.0 to 1.0) on a vertex. So, a
triangle in my format looks like this:
0,0,0, 0.0, 0.0
1,0,0, 1.0, 0.0
0,1,0 0.0, 1.0
After fiddling with povray, I didn't see any way to create a triangle and
specify how the texture goes onto it, except with SCALE and TRANSLATE. In
an emergency, I think I could figure out a formula to scale and translate my
textures to fit my format, but I was wondering if povray offers any way to
specify the u and v of texture coordinates at the corners of a single
triangle.
Even if I had to make a 'mesh' of one triangle, that would be okay. Speed
isn't crucial, so if anyone can tell me how to specify what coordinate of
the texture goes at each corner of the triangle, I would be very grateful!
Post a reply to this message
|
|
|
|
You should use the mesh2 format used in MegaPov (and povray 3.5).
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
|