POV-Ray : Newsgroups : povray.newusers : povray and 3D graphs Server Time
28 Jul 2024 20:31:08 EDT (-0400)
  povray and 3D graphs (Message 11 to 17 of 17)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Daniel C  Bastos
Subject: Re: povray and 3D graphs
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

From: Alain
Subject: Re: povray and 3D graphs
Date: 20 Apr 2008 11:19:45
Message: <480b5f11@news.povray.org>
> 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.

Since when any object, whatever it's dimentions, will apears in front of 
everything else if not part of an union?
The order in whitch the various objects are defined and ther apartenance, or 
non-apartenance, to any union have absolutely no effect on it's placement or 
apearence.
If the axis are closer to the camera than the other objects, they will be in 
front of them. If they are farther away, they will apears behind the other objects.

When I want to show axis, I create an axis object made of 3 long and thin 
cylinders, completely separated from the rest of the objects of the scene.

-- 
Alain
-------------------------------------------------
You *know* you've been raytracing far too long when you look at a heap of dirt 
and go "wow, that looks really realistic..."


Post a reply to this message

From: Larry Hudson
Subject: Re: povray and 3D graphs
Date: 20 Apr 2008 19:07:28
Message: <480bccb0$1@news.povray.org>
Alain wrote:
> ...    <snip>
> 
> When I want to show axis, I create an axis object made of 3 long and 
> thin cylinders, completely separated from the rest of the objects of the 
> scene.
> 

And the obvious added comment:  writing this as a #declare'd union makes 
it very easy to display them or not.  eg.

#declare Axes = union {...}

      then use either

object { Axes }       //  To display them
      or
// object { Axes }    //  To hide them

      -=- Larry -=-


Post a reply to this message

From: Daniel C  Bastos
Subject: Re: povray and 3D graphs
Date: 21 Apr 2008 17:10:52
Message: <slrng0q0ls.oa2.dbast0s@yahoo.com.br>
In article <4808c4af@news.povray.org>,
Sherry Shaw wrote:

> Daniel C. Bastos wrote:
>
> There are some very good tutorials here:
>
> http://www.f-lohmueller.de/pov_tut/pov__eng.htm
>
> Tutorials number VI, IX through XIV, and XXI look like they might be 
> especially relevant.

Indeed.

> Hope this helps,

It sure does. This might be all I will ever need, but let's not
understimate my needs. The pictures are beautiful.


Post a reply to this message

From: Alain
Subject: Re: povray and 3D graphs
Date: 22 Apr 2008 13:52:10
Message: <480e25ca@news.povray.org>
Larry Hudson nous illumina en ce 2008/04/20 19:07 -->
> Alain wrote:
>> ...    <snip>
>>
>> When I want to show axis, I create an axis object made of 3 long and 
>> thin cylinders, completely separated from the rest of the objects of 
>> the scene.
>>
> 
> And the obvious added comment:  writing this as a #declare'd union makes 
> it very easy to display them or not.  eg.
> 
> #declare Axes = union {...}
> 
>      then use either
> 
> object { Axes }       //  To display them
>      or
> // object { Axes }    //  To hide them
> 
>      -=- Larry -=-
I prefer this:
#declare ShowAxis = 1;
.
.
.
#if(ShowAxis) Axes  #end

-- 
Alain
-------------------------------------------------
WARNING: The consumption of alcohol may leave you wondering what the hell 
happened to your bra and panties.


Post a reply to this message

From: Warp
Subject: Re: povray and 3D graphs
Date: 22 Apr 2008 14:38:09
Message: <480e3091@news.povray.org>
Alain <ele### [at] netscapenet> wrote:
> I prefer this:
> #declare ShowAxis = 1;

  I prefer:

#declare ShowAxis = yes;

  Much more readable. :)

-- 
                                                          - Warp


Post a reply to this message

From: Alain
Subject: Re: povray and 3D graphs
Date: 24 Apr 2008 10:56:42
Message: <48109faa$1@news.povray.org>
Warp nous illumina en ce 2008/04/22 14:38 -->
> Alain <ele### [at] netscapenet> wrote:
>> I prefer this:
>> #declare ShowAxis = 1;
> 
>   I prefer:
> 
> #declare ShowAxis = yes;
> 
>   Much more readable. :)
> 
It's the same for me. In my eyes, zero means "no" and anything non-zero means 
"yes" ;)

-- 
Alain
-------------------------------------------------
When we get piled upon one another in large cities, as in Europe, we shall
become as corrupt as Europe.
Thomas Jefferson


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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