POV-Ray : Newsgroups : povray.general : Meshes and Textures : Re: Meshes and Textures Server Time
12 Aug 2024 03:21:34 EDT (-0400)
  Re: Meshes and Textures  
From: John VanSickle
Date: 28 Mar 1999 14:21:26
Message: <36FE82A8.76D4DEBF@erols.com>
Ken wrote:
> 
> Rick wrote:
> >
> > Yes, go, simplifiy!!, prefrable in terms the layman can understand :)
> >
> > Rick
> 
>  Ok let us look at it this way. All pigment patterns in pov are 1 x 1 x 1
> units in size. When you apply a pigment to a 1 x 1 x 1 scaled object that
> is centred at the origin (xyz = 0) then it will be completely covered by
> one repetition of the pattern (unless it is scaled). If you apply the same
> pigment pattern to a 1 unit object that is say offset from the origin by
> 0.5 the pigment pattern will only apply to 1/2 of the object and the rest
> of the object will be covered by the second repetition of the pigment
> pattern.
> 
>   Think of it this way - you have a picture in your hands that is 1 x 1.
> You need to paste it on to a wall that is 1 x 1. Unfortunately the picture
> is stuck physically at xyz 0 but your wall is off center. Now you are going
> to need a half of a second picture to cover what the first would not.
> 
>   We can get around this by translating our pigments to align with the
> location of the object it's to be attached to. If the object is rotated
> and not sitting at the origin and we apply the pattern without taking
> this into account then when we move the object it is now covered by a
> different part of the pattern. This is because they are not aligned at
> origin together with respect to their rotations and transformations.
> 
>   To solve his triangle problem he needs to rotate and translate each
> pigment he has applied to the individual triangles so they match in
> location and the direction they are pointing. If he doesn't then when
> he goes to move the object or scale it they will not act in unison and
> the pattern will predictably change from one location to another. I is
> a useful trick when one does not want identical looking objects but a
> pain if not accounted for when you want identical objects in different
> locations.

This is all well and good, but it doesn't really address the reported
problem.  All of POV-Ray's other objects, when textured and then rotated
or translated, maintain their appearance, most particularily the location
of the pattern relative to the object.  The sole exception is the
inidivdually-textured triangle in a mesh.

The only work-around is the one you specify, but requires a separate
texture declared for each and every patterned triangle in every mesh, and
meshes define cannot be copied, but the whole process has to be repeated
for every mesh, even if the same object is to be identically modelled.
And if the user wants to tweak the location of the mesh, every patterned
texture must be identically tweaked.  The memory requirements are huge, and
the ability to make separately translated and/or rotated but otherwise
idenical copies of a mesh, with minimal memory requirements, is one of the
chief benefits of the mesh.  Suppose the original poster wants to make
an object with 2000 triangles in it, and then use that object 2000 times
in a scene.  That's a few dozen kilobytes if the mesh transformed
as does every other object, but will take hundreds of megabytes to work
around the bug.

The only real solution is to fix the bug; translations, and rotations are
not supposed to affect the appearance of an object that is translated
*AFTER* the texture is applied, and this is stated explicitly in the docs.
They slipped up on the mesh.

Regards,
John


Post a reply to this message

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