POV-Ray : Newsgroups : povray.general : image map problem Server Time
4 Aug 2024 18:22:16 EDT (-0400)
  image map problem (Message 1 to 3 of 3)  
From: DL
Subject: image map problem
Date: 19 Feb 2003 19:02:36
Message: <3e541b1c@news.povray.org>
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

From: Anthony D  Baye
Subject: Re: image map problem
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

From: Mike Williams
Subject: Re: image map problem
Date: 20 Feb 2003 00:17:50
Message: <g40AiMAHPGV+Ewug@econym.demon.co.uk>
Wasn't it DL who 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.

You could try drawing six copies of the image you want onto your image
map and using uv mapping

box {0,1 uv_mapping pigment {image_map {png "image.png"}}}

If you don't care how your image_map aligns with the edges of the cube
(e.g. if it's a repeating texture), then you could use the original
image scaled down

box {0,1 uv_mapping pigment {image_map {png "image.png" }scale 1/3}}


-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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