POV-Ray : Newsgroups : povray.newusers : povray and 3D graphs Server Time
28 Jul 2024 20:20:52 EDT (-0400)
  povray and 3D graphs (Message 8 to 17 of 17)  
<<< Previous 7 Messages Goto Initial 10 Messages
From: Alain
Subject: Re: povray and 3D graphs
Date: 18 Apr 2008 11:42:34
Message: <4808c16a@news.povray.org>
> //Light to case shadows:
> light_source{
>     <15,25,-15>
>     rgb 0.7
>     area_light 4*x,4*y,8,8
>     circular
>     orient
>     jitter
>     adaptive 2
> }
> 
What kind of adaptive area_light is that? Adaptive 2 tries to start with a 5 by 
5 array, but your's is only 4 by 4... So the adaptive does nothing.
adaptive 0 start with a 2 by 2 array.
adaptive 1 with a 3 by 3
adaptive 2 with 5 by 5
adaptive 3 with 9 by 9
adaptive 4 with 17 by 17

The optimum array dimentions are: 5, 9, 17, 33, 65, 129, 257,...

-- 
Alain
-------------------------------------------------
OFFICE ARITHMETIC
Smart boss + smart employee = profit
Smart boss + dumb employee = production
Dumb boss + smart employee = promotion
Dumb boss + dumb employee = overtime


Post a reply to this message

From: Sherry Shaw
Subject: Re: povray and 3D graphs
Date: 18 Apr 2008 11:56:31
Message: <4808c4af@news.povray.org>
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.

Hope this helps,

--Sherry Shaw


-- 
#macro T(E,N)sphere{x,.4rotate z*E*60translate y*N pigment{wrinkles scale
.3}finish{ambient 1}}#end#local I=0;#while(I<5)T(I,1)T(1-I,-1)#local I=I+
1;#end camera{location-5*z}plane{z,37 pigment{granite color_map{[.7rgb 0]
[1rgb 1]}}finish{ambient 2}}//                                   TenMoons


Post a reply to this message

From: Daniel C  Bastos
Subject: Re: povray and 3D graphs
Date: 20 Apr 2008 00:00:18
Message: <slrng0lft6.oa2.dbast0s@yahoo.com.br>
In article <48071e5a@news.povray.org>,
Tim Attwood wrote:

>> What I would like to do on your code is to keep the plane where it is
>> --- that would be my xy-plane --- and make the helix start from the
>> plane and spiral up, because that's how this helix should be as x varies
>> according to cos(t) and y to sin(t) and z = t. That is, while x and y
>> circle around, z keeps on going up (or down.)
>
> You can rotate unions like any other object, there's a good tutorial in
> the manual too.

That's true. I have already read that, when they talk about that green
cube. This seems better to write than swaping coordinates which might
seem a bit misleading.

>> So what I think it's happening here is that while I keep on thinking on
>> the xyz-axis as I do, the povray puts the z axis as going from outside
>> my screen into it. So if I swap y and z I should get what I'd like, and
>> apparently I do.
>
> POV uses a left handed coordinate system, like if you point with
> your left hand, thumb up is y, pointer finger in is z, and middle
> finger right is x. Rotations are the same way, if you trace from your
> left palm looping around your fingers that is the direction of rotation
> used for each axis.

Got it.

>> I also took your code and plotted it from -25pi to 25pi and it spirals
>> just right. Cool. I'm impressed. This is what I'm looking for. Thanks
>> for the introduction.
>
> Yeah, Warp knows his stuff =)
> I fiddled with his scene a bit...

Looks good. I took 

                    #declare Z = function(T) { T };

and made it 

                   #declare Z = function(T) { T/3 };

so that we can see it looking more like a spring. Looks pretty
good. This is the kind of function graph I'd like to have. :-) Cool
stuff.

>
> #include "colors.inc"
>
> camera {
>    location <0,2.5,-7>
>    right    x*image_width/image_height
>    look_at  <0,2,0>
> }
>
> light_source {
>    <-20, 30, 0>
>    White
> }
> light_source {
>    <0,2.5,-8>
>    White
> }
>
> sky_sphere {
>    pigment {
>       gradient y
>       color_map {
>          [0 Black]
>          [0.5 Gray75]
>          [1 Black]
>       }
>    }
> }
>
> #declare X = function(T) { sin(T) };
> #declare Y = function(T) { cos(T) };
> #declare Z = function(T) { T };
>
> #declare CylRadius = 0.1;
> #declare MinT = 0;
> #declare MaxT = 2*pi;
> #declare Steps = 100;
>
> union {
>
>    #declare Ind = 0;
>    #while(Ind < Steps)
>       #declare T1 = MinT + (MaxT-MinT)*Ind/Steps;
>       #declare T2 = MinT + (MaxT-MinT)*(Ind+1)/Steps;
>       #declare P1 = <X(T1), Y(T1), Z(T1)>;
>       #declare P2 = <X(T2), Y(T2), Z(T2)>;
>       sphere { P1, CylRadius }
>       cylinder { P1, P2, CylRadius }
>       #declare Ind = Ind+1;
>    #end
>
>    texture {
>       pigment {Orange}
>       normal {bumps scale 0.02}
>       finish {
>          specular 0.3
>          roughness 0.005
>       }
>    }
>
>    rotate <-90,0,0>
>    translate <0,-1,2.5>
> }
>
> plane { y, -1
>    pigment {
>       cells
>       color_map {
>          [0 Blue]
>          [1 ForestGreen]
>       }
>    }
> }
>
>


Post a reply to this message

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 7 Messages Goto Initial 10 Messages

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