POV-Ray : Newsgroups : povray.newusers : absolute coordinates : Re: absolute coordinates Server Time
2 Jul 2024 11:20:44 EDT (-0400)
  Re: absolute coordinates  
From: Alain
Date: 11 Feb 2011 12:08:37
Message: <4d556d15@news.povray.org>

> Hello! My name is Sergey.
>
> How to translate a texture of object to absolute coordinates? For example,
> to beginning of coordinates.
>
>

ALL textures originate from the origin and fill space to infinity.
ALL texture always follow the object to whitch it's applyed as that 
object is transformed, as long as the transformation appens AFTER the 
texture is applyed.

If you apply a texture to an object that is defined at the origin, 
around coordinate <0,0,0>, then the texture is also from around the origin.
In this case, absolute and relative are the same.

If you then rotate, scale or translate the object, the texture will follow.

If the texture is applyed to an object that is not created at the 
origin, you should do the following:
- Evaluate the position of the object relative to the origin.
- Translate the texture by minus that position: the texture is now 
centered at <0,0,0>, or translate the object to the origin.
- Apply any other transformation you want to the texture.
- Translate it back to the desired location.

If you apply an image_map to an object, it's lower left corner is at 
<0,0> and it extent to <1,1> and repeats to fill that plane. It extend 
along the Z axis from minus infinity to infinity. You can then scale the 
texture as needed.
In that case, place the object to witch it's applied accordingly.
If you use any maping option other than planar, the object MUST reside 
centered at coordinate <0,0,0> when you apply the image_map.

Generaly, you should apply the texture to the object before you rotate 
ant translate it. That way, if you then rotate or move the object, it's 
texture will stay identical. It will also stretch with the object is you 
scale it after the texture is applyed.

It's also a goo idea to create all your objects at or around the origin 
then translate them to the desired location. It's particularly important 
if you want to rotate or scale the object without those affecting the 
location of the object.
A chair, table or lamp with it's base on the X-Z plane, a door with it's 
hinge on the Y axis, a gear or wheel with it rotation axis along one of 
the axis, a shelving unit or cabinet with it's back on the Y-Z or Y-X 
plane,...




Alain


Post a reply to this message

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