|
|
"David E Nedrow" <dne### [at] mecom> wrote:
> I have an object that can be easily described as a 6-sided polygon, but I need
> it to have depth as well. I've seen a couple of suggestions that a polygon
> can't be used for this, but a prism can.
>
> This could also be done by differencing multiple cubes, but that seems less than
> elegant.
>
> Suggestions? If prism IS the way to go, could someone provide a simple example?
>
> -David
You should be able to place cursor on the word prism and hit F1.
If thats too complex, here's another problem, POV needs a bezier spline editor
with very little to nothing available 'til now.
Import SVG, read pov-bezier files, edit bezier spline, export lathe and prism:
http://home.earthlink.net/~openuniverse/
If you know nothing of mirc you may still have no bezier editor.
Post a reply to this message
|
|
|
|
"David E Nedrow" <dne### [at] mecom> wrote in message
news:web.497fb3983a7db7ff5f83ce310@news.povray.org...
>I have an object that can be easily described as a 6-sided polygon, but I
>need
> it to have depth as well. I've seen a couple of suggestions that a polygon
> can't be used for this, but a prism can.
Yes. That's correct. The POV-Ray polygon primitive is really just a 2D
surface.
> This could also be done by differencing multiple cubes, but that seems
> less than
> elegant.
> Suggestions? If prism IS the way to go, could someone provide a simple
> example?
Correct on both counts, you could, but it's not elegant. The prism object is
the one to use and it's really straight-forward for linear splines. I've
pasted in a short scene description below showing 2 different ways to do the
same sort of thing. The first lets you specify coordinates by hand, the
second calculates them programmatically.
The first prism uses a 4-sided linear spline. The line '0,1,5,' just tells
POV-Ray to extrude the shape from y=0 to y=1 and to expect 5 coordinates.
The following lines specify 5, 2D coordinates on the XZ plane, with the
first coordinate being the same as the last.
The second example is a little more complex, but allows you to easily create
a regular figure with any number of sides. It interweaves some POV-Ray
directives to build the prism object definition using a loop, so that the
positions of the corners are calculated programmatically. In this case it
loops round 7 times to give you 6 sides. The variable 'I' changes from '0'
to '7' during the loop. The coordinates are calculated by rotating the
vector 'z' (which is shorthand for <0,0,1>) around the 'y' axis by an amount
that is a multiple of 60. The 'x' and 'z' components of the MyPosition
variable are then used to define the prism.
Hope this helps.
Regards,
Chris B.
camera {location <-1,3,-3> look_at y }
light_source {<-10,20,50>, rgb 1}
prism {
linear_spline
0, 1, 5,
<0,0>, <0.6,0>, <0.6,0.8>, <0,0.8>, <0,0>
pigment {rgb <1,0,0>}
translate <1,0,0>
}
#local Sides = 6;
#local I = 0;
prism {
0,1,Sides+1,
#while (I<=Sides)
#local MyPosition = vrotate(z,I*y*360/Sides);
<MyPosition.x,MyPosition.z>
#if (I<Sides-1) , #end
#local I = I + 1;
#end
pigment {rgb <1,1,0>}
translate <-0.5,0,0>
}
Post a reply to this message
|
|