POV-Ray : Newsgroups : povray.general : image map problem : Re: image map problem Server Time
4 Aug 2024 20:15:07 EDT (-0400)
  Re: image map problem  
From: Anthony D  Baye
Date: 19 Feb 2003 23:24:03
Message: <3E545924.3BF0F18B@Rapidnet.com>
This is because the texure maps have a planar map default, map_type 0.  Try
something like this, I know it looks complicated for what you want to do, but
it's effective.

/*
 Persistence of Vision Ray Tracer Scene Description File
 File: CubeMacro.pov
 Vers: 3.5
 Desc:
 Date:
 Auth: Anthony D. Baye
*/

#include "colors.inc"
#include "textures.inc"

#declare ft = 12 ;

/* Change location or look_at point before rendering */
camera {
 location  <-5.0, 5.0, -5.0>
 look_at   <0.0, 0.0, 0.0>
 }

light_source {
 <-25.0, 15.0*ft, -10.0*ft>
 color rgb 1.0
 }

#macro Face(l, w, thi, tex)

object {
    union {
        difference {
            box { <-(w/2), 0.0, -(l/2)> <(w/2), thi, (l/2)> }
    #local fc = 0 ;
    #while(fc < 360)
            box { <-(w/2), 0.0, -(l/2)> <(w/2), thi, (l/2)> rotate 45*z
translate -(w/2)*x  rotate fc*y }
    #local fc = fc + 90.0 ;
    #end
            }
        box { <-((w/2)*0.6875), thi, -((l/2)*0.6875)> <((w/2)*0.6875),
thi*(4/3), ((l/2)*0.6875)> }
        }
        texture { tex }
            translate -(w/2)*y
    }

#end

#local fr = 0 ;
#while(fr < 360)

object { Face(4.0, 4.0, 0.25, texture { pigment { White } }) rotate fr*x }

#local fr = fr + 90.0 ;
#end

object { Face(4.0, 4.0, 0.25, texture { pigment { Red } }) rotate 90*z }
object { Face(4.0, 4.0, 0.25, texture { pigment { NeonBlue } }) rotate -90*z }

// End object description.

    This will render a cube with six individually textured faces.  simply make
sure that your image map is oriented in the x,z plane as if projected from the
-y direction.


A.D.B.

DL wrote:

> I want to add an image map to four sides of the cube (excluding the top and
> bottom).  Currently, I can only see the image map from one side of the cube.
> If I move the camera around to the other sides, it is just black.  I rotate
> the cube and I still see black on all sides.  I know in the documentation it
> says the image map is projected onto the xy plane from the -z direction.
> How do I make it project onto the other planes?  Thanks.


Post a reply to this message

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