Tutorial on drawing a 3D solid

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
zomp

Tutorial on drawing a 3D solid

Post by zomp »

Is there anybody so kind to explain me how to use command-line tools and draw a 3D cylinder like the following one:
http://tbn0.google.com/images?q=tbn:vf9 ... linder.gif
but glass made (i.e., with some level of transparency)?
Many many thanks.

Your program is wonderful (even if a bit hard for a newbie as I am).
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Tutorial on drawing a 3D solid

Post by Bonzo »

This is the sort of thing you want to do. You could probably add the gradiant by using a mask and overlaying it over a gradiant image.
Code to create a simple blue cylinder

Code: Select all

convert -size 300x500 xc:none -stroke black -strokewidth 1 -fill blue -draw \"rectangle 0,100 200,300\" -draw \"ellipse 100,300 100,50 0,180 \" -draw \"ellipse 100,100 100,50 0,360 \" test.png
After expanding the code to add a gradiant you can get this:
Image
zomp

Re: Tutorial on drawing a 3D solid

Post by zomp »

Bonzo wrote:This is the sort of thing you want to do. You could probably add the gradiant by using a mask and overlaying it over a gradiant image.
Code to create a simple blue cylinder

Code: Select all

convert -size 300x500 xc:none -stroke black -strokewidth 1 -fill blue -draw \"rectangle 0,100 200,300\" -draw \"ellipse 100,300 100,50 0,180 \" -draw \"ellipse 100,100 100,50 0,360 \" test.png

Thanks. I will open a new thread about transparent gradient.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Tutorial on drawing a 3D solid

Post by anthony »

Of course if you are wanting to deal with actual 3D objects (in the computer memory) then you are better off with a ray tracer. which is whole different kettle of fish.

POV (povray) is actually quite good at this, and is simple for simple objects. But getting though the language and 'possibilities' it provides, that is a problem. There are also lots ray tracing editors and other tools to help, but often still require you to know the fundamentals of ray tracing to use.

Not of these suggestions has anything to do with Image Magick, though IM is very good for preparation and post-processing work.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply