|
|
Hi all.
I'm after some help with POV transformations.
I want to place an image map on a mesh object I've imported from Rhino.
I have the overall normal of the mesh object. Therefore given the
default image map normal of <0,0,1>, and the normal of the mesh object
<x1,y1,z1> how can I transform the image map from its existing normal to
the new normal ? I want to do this all in POV code if possible.
Please email me directly with any help.
--
regards
Nathan O'Brien
no1### [at] ozemailcomau
http://www.ozemail.com.au/~no13
Post a reply to this message
|
|
|
|
Nathan O'Brien wrote:
>
> Hi all.
>
> I'm after some help with POV transformations.
>
> I want to place an image map on a mesh object I've imported from Rhino.
> I have the overall normal of the mesh object. Therefore given the
> default image map normal of <0,0,1>, and the normal of the mesh object
> <x1,y1,z1> how can I transform the image map from its existing normal to
> the new normal ? I want to do this all in POV code if possible.
I'm afraid that you need more information than just the one normal.
If you picture the plane that is normal to the vector you have, you
see that an image can lie anywhere in this plane, and be rotate freely
within the plane. So you also need a point to determine where
the image lies in the plane, and another vector (parallel to the plane)
that indicates the orientation of the image. Once you have this,
it can all be done with a matrix transform.
If, for example, you have F as the vector normal to the plane, and
U is the vector parallel to the horizontal axis of the image, and
P is the origin of the image, then use the following code:
#declare V=vnormalize(F,U)
pigment {
image_map { gif "picture.gif" }
scale <Sx,Sy,1> // for the size you want
matrix <U.x,U.y,U.z, V.x,V.y,V.z, F.x,F.y,F.z, P.x,P.y,P.z >
}
Read more about the matrix transform at
http://www.erols.com/vansickl/matrix.htm
Hope this helps,
John
--
"What can I say? Everyone likes flowers, even us evildoers." -- Zorak
Post a reply to this message
|
|