POV-Ray : Newsgroups : povray.windows : UV Coordinates Server Time
24 Nov 2024 05:32:25 EST (-0500)
  UV Coordinates (Message 1 to 2 of 2)  
From: John Raptis
Subject: UV Coordinates
Date: 2 Sep 2000 09:50:59
Message: <39b105c3@news.povray.org>
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

From: Warp
Subject: Re: UV Coordinates
Date: 3 Sep 2000 13:39:41
Message: <39b28cdd@news.povray.org>
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

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