POV-Ray : Newsgroups : povray.advanced-users : image_map problem :( : Re: image_map problem :( Server Time
2 Nov 2024 03:14:01 EDT (-0400)
  Re: image_map problem :(  
From: Margus Ramst
Date: 19 May 2000 13:36:40
Message: <39256DD3.1B8C1453@peak.edu.ee>
? wrote:
> 
> Hello Guys,
> 
> I am currently trying to use Pov to make a virtual box, My troube comes
> with the "image_map" functionality .

A planar image_map is by default projected on the XY plane, going from x=0; y=0
to x=1; y=1
In order to apply it to a surface facing up or to the side, you have rotate it
accordingly (or create the object along the XY plane, apply the texture and then
rotate the object in place).
Here's a skeleton example; I'll use polygons for the faces of the box:

#declare Tex=
texture{image_map... translate <-0.5,-0.5,0> scale 2}
//The transformation is there to align the image with the face

#declare Face=
polygon{4, <-1,-1,-1>, <-1,1,-1>, <1,1,-1>, <1,-1,-1>}

union{
  object{Face texture{Tex}}
  object{Face texture{Tex} rotate y*90}
  object{Face texture{Tex} rotate y*-90}
  object{Face texture{Tex} rotate x*90}
  object{Face texture{Tex} rotate x*-90}
  object{Face texture{Tex} rotate x*180}
}

-- 
Margus Ramst

Personal e-mail: mar### [at] peakeduee
TAG (Team Assistance Group) e-mail: mar### [at] tagpovrayorg


Post a reply to this message

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