POV-Ray : Newsgroups : povray.general : Mesh/Triangle 3D texture mapping : Mesh/Triangle 3D texture mapping Server Time
19 May 2024 20:45:18 EDT (-0400)
  Mesh/Triangle 3D texture mapping  
From: jceddy
Date: 29 Mar 2006 06:35:01
Message: <web.442a6fe16260549766ffc7a50@news.povray.org>
Okay...I'm trying to do something here and I'm wondering if anyone has come
up with a technique for doing it before me.  If so, please let me know, if
not, maybe I'll come up with something and post it here.  Or maybe someone
smarter/faster than me will beat me to it.

I am looking for a way to specify coordinates in a 3D texture for corners of
trangles (in a mesh or not) to map to.

In other words, something like:

triangle {
  Vertex_1, Vertex_2, Vertex_3
  texture_coords Coord_1, Coord_2, Coord_3
}

What I'm looking for is not UV mapping (I think), which I know is now
available in POV-Ray...the texture coordinates would be 3D coordinates
within a 3D texture, and the texture would then be interpolated along the
surface of the triangle.

What I'm trying to do is to have a mesh whose vertices are attached to
MegaPOV mechsim masses, textured by a normal POV 3D texture, but allow the
texture to "follow" the triangles as the mesh deforms over time.

The only two solutions that I've thought of so far (but not yet to the point
of implementation) are:

1) Assign a copy of the texture to each triangle in the mesh separately,
then when drawing the deformed version of the mesh, figure out how each
triangle in the mesh has been transformed from its current position (how we
do that, I have no idea, yet, but I have a sneaking suspicion that it is
possible), and then apply that transformation to that triangle's copy of
the texture.

2) Generate a small image for each triangle in the original mesh, containing
what the texture looks like for that triangle in its original position, and
then set UV coordinates for the triangle using that image as its
texture...which should result in the same texture being applied to each
triangle after the mesh was deformed.  (There should be some way to put all
of this in a single texture image)

Both of these seem fairly complicated, not to menion memory/processor/disk
space intensive...does anyone else have a better idea?

Or, of course, I could just stick with UV mapping and just create images
with approximations to the 3D textures I want to use...

Cheers,
Joe


Post a reply to this message

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