POV-Ray : Newsgroups : povray.newusers : How to apply a different imagemap to different sides of a cube Server Time
26 Nov 2024 01:53:10 EST (-0500)
  How to apply a different imagemap to different sides of a cube (Message 1 to 4 of 4)  
From: Neil Kolban
Subject: How to apply a different imagemap to different sides of a cube
Date: 3 Dec 2004 21:03:43
Message: <41b11aff$1@news.povray.org>
Folks,
Still a newbie here ...

I have 6 images that I would like to apply to the 6 different faces of a
cube.  Is there I way I can achieve that task?

Neil


Post a reply to this message

From: Jim Charter
Subject: Re: How to apply a different imagemap to different sides of a cube
Date: 3 Dec 2004 22:29:47
Message: <41b12f2b$1@news.povray.org>
Neil Kolban wrote:
> Folks,
> Still a newbie here ...
> 
> I have 6 images that I would like to apply to the 6 different faces of a
> cube.  Is there I way I can achieve that task?
> 
> Neil
> 
> 
I posted one solution on p.b.scene-files

It uses handcoded mesh and uv's and a composite image for the image map


Post a reply to this message

From: Captain Chemistry
Subject: Re: How to apply a different imagemap to different sides of a cube
Date: 4 Dec 2004 16:45:00
Message: <web.41b22efaf420974d6fa80cd40@news.povray.org>
"Neil Kolban" <kol### [at] kolbancom> wrote:
> Folks,
> Still a newbie here ...
>
> I have 6 images that I would like to apply to the 6 different faces of a
> cube.  Is there I way I can achieve that task?
>
> Neil

I suppose you could use csg difference to cut off small amounts of your cube
on each face and put a different texture on each face.

For example:

difference
{
   box{0 1} // no texture needed
   plane{y,0.0001 texture{bottom_face}}
   plane{-y,-0.9999 texture{top_face}}
   plane{x,0.0001 texture{left_face}}
   plane{-x,-0.9999 texture{right_face}}
   plane{z,0.0001 texture{front_face}}
   plane{-z,-0.9999 texture{back_face}}
}

This code has not been tested, but the following has:
difference
{
 box{0 1}
 plane{y,0.0001 texture{pigment{rgb<1,0,0>}}}
 plane{-y,-0.9999 texture{pigment{rgb<0,0,1>}}}
 plane{x,0.0001 texture{pigment{rgb<0,1,0>}}}
 plane{-x,-0.9999 texture{pigment{rgb<1,0,1>}}}
 plane{z,0.0001 texture{pigment{rgb<1,1,0>}}}
 plane{-z,-0.9999 texture{pigment{rgb<0,1,1>}}}
}

Hope this helps!

Nathan Jolly (Captain Chemistry)


Post a reply to this message

From: Rafal 'Raf256' Maj
Subject: Re: How to apply a different imagemap to different sides of a cube
Date: 5 Dec 2004 18:24:13
Message: <Xns95B7461785D2raf256com@203.29.75.35>
njj### [at] studentmonasheduau 
news:web.41b22efaf420974d6fa80cd40@news.povray.org

> For example:

Wouldnt it be better to combine polygons?

My solution:


#macro BoxTex(A,B, Af,Aw,Ac)
  union {
    polygon { 4
      <A.x,A.y,A.z> <B.x,A.y,A.z>
      <B.x,A.y,B.z> <A.x,A.y,B.z>
      texture { Af rotate x*90 }
    }
    
    polygon { 4
      <A.x,A.y,A.z> <B.x,A.y,A.z>
      <B.x,B.y,A.z> <A.x,B.y,A.z>
      texture { Aw rotate z*90 }
    }
    polygon { 4
      <A.x,A.y,B.z> <B.x,A.y,B.z>
      <B.x,B.y,B.z> <A.x,B.y,B.z>
      texture { Aw rotate z*90 }
    }
    
    polygon { 4
      <A.x,A.y,A.z> <A.x,B.y,A.z>
      <A.x,B.y,B.z> <A.x,A.y,B.z>
      texture { Aw rotate y*90 }
    } 
    polygon { 4
      <B.x,A.y,A.z> <B.x,B.y,A.z>
      <B.x,B.y,B.z> <B.x,A.y,B.z>
      texture { Aw rotate y*90 }
    }
    
    polygon { 4
      <A.x,B.y,A.z> <B.x,B.y,A.z>
      <B.x,B.y,B.z> <A.x,B.y,B.z>
      texture { Ac rotate x*90 }
    //  scale 0.10
    }
  }  
#end

Call it usign two vectors, and three textures - for floor, walls and 
celing.

It is neede to:
  A.x < B.x
  A.y < B.y
  A.z < B.z

btw, povray complains about not closed polygon, how to fix it (just add 5-
th point?)




-- 
http://www.raf256.com/3d/
Rafal Maj 'Raf256', home page - http://www.raf256.com/me/
Computer Graphics


Post a reply to this message

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