POV-Ray : Newsgroups : povray.binaries.images : The ghost of a box : The ghost of a box Server Time
5 Nov 2024 16:38:29 EST (-0500)
  The ghost of a box  
From: Thomas de Groot
Date: 29 Jul 2023 08:34:35
Message: <64c5075b@news.povray.org>
Some time ago and entirely by chance, I came across this site/image: 
https://www.printables.com/model/431413-illusion-cube

I thought this was an interesting shape and I built my own version in 
POV-Ray code:

//==========================================================
#declare BaseBox =
box {
   <-1.00, -1.00, -1.00>,< 1.00, 1.00, 1.00>
}

#declare InsideHollow =
union {
   box {< 0.00, -0.899, -0.70>,< 1.01, 0.70, 0.899>}//+x
   box {<-1.01, -0.70, -0.899>,< 0.00, 0.899, 0.70>}//-x

   box {<-0.70, -0.70,  0.00>,< 0.899, 0.899, 1.01>}//+z
   box {<-0.899, -0.899, -1.01>,< 0.70, 0.70, 0.00>}//-z

   box {<-0.899,  0.00, -0.70>,< 0.70, 1.01, 0.899>}//+y
   box {<-0.70, -1.01, -0.899>,< 0.899, 0.00, 0.70>}//-y

   box {<-0.90, -0.90, -0.90>,< 0.90, 0.90, 0.90> }
}

#declare EdgeHollow = box {<-1.01, -0.2, -0.2>,< 1.01, 0.2, 0.2>}

#declare EdgeHollowsTop =
union {
   object {EdgeHollow translate <0.00, 1.00,-1.00>}
   object {EdgeHollow rotate 90*y translate < 1.00, 1.00, 0.00>}
}

#declare EdgeHollowsBase =
union {
   object {EdgeHollow translate <0.00, -1.00, 1.00>}
   object {EdgeHollow rotate 90*y translate <-1.00, -1.00, 0.00>}
}

#declare EdgeHollowsSides =
union {
   object {EdgeHollow rotate 90*z translate <-1.00, 0.00, 1.00>}
   object {EdgeHollow rotate 90*z translate <1.00, 0.00,-1.00>}
}

#declare IllusionBox =
difference {
   object {BaseBox}
   object {InsideHollow /*pigment {rgb <0,1,0>}*/}
   object {EdgeHollowsTop /*pigment {rgb <1,0,0>}*/}
   object {EdgeHollowsBase /*pigment {rgb <1,0,0>}*/}
   object {EdgeHollowsSides /*pigment {rgb <1,0,0>}*/}

   pigment {rgb 0.9}
}

object {IllusionBox}
//==========================================================

Adding a spaceship I built years ago using Silo, and a media (portal?) I 
composed the present scene.

-- 
Thomas


Post a reply to this message


Attachments:
Download 'tdg_illusion box_final.jpg' (213 KB)

Preview of image 'tdg_illusion box_final.jpg'
tdg_illusion box_final.jpg


 

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