POV-Ray : Newsgroups : povray.advanced-users : Macro in POV-ray : Re: Macro in POV-ray Server Time
16 May 2024 13:58:47 EDT (-0400)
  Re: Macro in POV-ray  
From: Bald Eagle
Date: 19 Oct 2014 01:10:01
Message: <web.544346f35ae0f3ce5e7df57c0@news.povray.org>
> Can we make a macro for a box? In which box is formed using 8 vertex?

Boxes are traditionally just made with the BOX directive, specifying the two
opposing corners.
box {<0, 0, 0>, <1, 1, 1> pigment {Red}}

You can also get a box shape with a superquadratic ellipsoid:
superellipsoid {<0, 0> texture {pigment {Green} finish {phong 0.2}} }

Changing either zero to another value changes the shape, and you can get rounded
boxes, cylinders, spheres, etc.  It's a fun shape to use, but can be slow to
render.

There are also the Round Box and Wire Box shapes:
http://www.f-lohmueller.de/pov_tut/all_shapes/shapes330e.htm

Good Luck,

//==============================Bald Eagle====================================
cylinder{z,z*1.1,.65 pigment{cylindrical rotate x*90 color_map{[0 rgb<1,.2,0>]
[1 rgb xy]}}}#macro C(D,S,F,M)sin(radians(D+(F*90)+(i*S)))*A+M#end#local L=.9;
#local A=0.3125;#local i=0;#local T=.014;#macro
R(X,Y,D,S,M,N)cylinder{<X,Y,L>,<C(D,S,1,M),C(D,S,0,N),L>T}#end#macro
V(X,Y,Z,P,J,K,Q,U)cone{<X,Y,Z>P<J,K,Z>Q pigment{rgb U}}#end#while(i<8)#local
F=R(-0.243,.113,170,20,-.415,.069) #local
W=difference{R(-.172+(i/80),.328,250,5,-0.18,0.18)sphere {<-.14,.22,L>A/2.4}}
union{object{F}object{F scale-x*1}object{W}object{W scale-x*1}
cylinder{<.004,.095,L>,<-.007,-.18,L>,.1}pigment{Brown}}
cylinder{<-.008,-0.03,L>,<C(240,10,1,-.028),C(240,10,0,-.09),L>.014 pigment{rgb
1}}V(-.01,.095,L,.08,.003,.28,.021,1)V(-.001,.2,.85,0,.01,.26,.028,0)
V(.019,.23,.83,0,.026,.25,.01,xy)sphere{<.005,.25,.82>.002 pigment{rgb
1}}#declare i=i+1;#end
//=============================================================================


Post a reply to this message

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