Three intersecting Cylinders in Povray

Can you imagine how three cylinders, each aligned along one axis, intersect? It is very difficult. So I took Povray for a the job. Here is the result.

Three cylinders

I am absolutely no expert for Povray, more a beginner. It took me two or three hours studying the documentation and introduction pages in the net, before I got my result.

However, maybe I should use this tool more often. It might even be a good idea to add an export for Povray to the Euler Math Toolbox. If you look at my page about 3D geometry, you will find other programs to do 3D stuff. But none would produce the result as nicely as Povray.

Since you probably still cannot imagine the intersection, here is the union of the three cylinders. I hope this helps

Three cylinders

Here is the code. It took me the most time to find out how to increase the ambient light. This is done by the assumed_gamma parameter below. I also used the 640×480 rendering with anti-aliazing. For the blog, the image was cropped and saved as PNG by Photoshop.

#include "colors.inc"
#include "stones.inc"

camera
{ location <5, 3, -3>
look_at <0, 0, 0>
angle 30 // opening angle of the lens
}

global_settings
{ ambient_light White
assumed_gamma 1.4
}

background
{ color Gray }

light_source
{ <2, 4, -3>
White
}

#declare cylobject = cylinder
{  <-2,0,0>, <2,0,0>, 1 }

intersection
{ object
{ cylobject
pigment { Red }
}
object
{ cylobject
pigment { Green }
rotate 90*y
}
object
{ cylobject
pigment { Blue }
rotate 90*z
}
}

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.

Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.