POV-Ray : Newsgroups : povray.newusers : povray and 3D graphs : Re: povray and 3D graphs Server Time
28 Jul 2024 22:27:27 EDT (-0400)
  Re: povray and 3D graphs  
From: Daniel C  Bastos
Date: 20 Apr 2008 01:23:33
Message: <slrng0lkp6.oa2.dbast0s@yahoo.com.br>
In article <web.4806a5dfc9f0a145ae42298f0@news.povray.org>,
triple_r wrote:

> "Daniel C. Bastos" <dba### [at] yahoocombr> wrote:
>> Hi there. I'm interested in plotting some graphs in povray. I have been
>> reading the documentation in the help file, but it is not going torwards
>> telling me how to plot, say, x = cos(t), y = cos(t), z = t. Could
>> someone point me in some direction where I can learn the basics of
>> getting some parametric equations plotted?
>
> Strictly speaking, POV-Ray is a program for creating 3-D images, so there aren't
> really 'plot' functions.  But that's certainly not to say you can't plot things.
>  On the contrary, it's not too hard and very, very flexible.  The most basic way
> is just to draw a set of cylinders between consecutive points.  This can be done
> with a function or a macro, as defined below.  If there's a gap you'll see it
> though, so you can add a sphere at each point too.  Of course you have to add a
> camera and lights to make it a true 3-D scene, but that's pretty
> straightforward.  Rather than describe it all, you can just test out the code
> below and modify it to your needs.  Text and ticmarks could be added too.
>

[...]

> //draw some axes:
> cylinder{-100*x,100*x,rad/2 pigment{rgb x} no_shadow}
> cylinder{-100*y,100*y,rad/2 pigment{rgb y} no_shadow}
> cylinder{-100*z,100*z,rad/2 pigment{rgb z} no_shadow}

Great. Axes are always useful. But I actually inserted the axes inside
the union where we plot. Otherwise, the axes would always be in front of
everything. If we plot the parametric equations above, we probably want
the function to go around the z-axis, so I achieved that by putting the
axes inside the union. Looks really neat.


Post a reply to this message

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