POV-Ray : Newsgroups : povray.newusers : How to apply a different imagemap to different sides of a cube : Re: How to apply a different imagemap to different sides of a cube Server Time
30 Jul 2024 00:22:16 EDT (-0400)
  Re: How to apply a different imagemap to different sides of a cube  
From: Rafal 'Raf256' Maj
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.