POV-Ray : Newsgroups : povray.general : questions on parametric objects and 3d splines Server Time
3 Aug 2024 14:16:54 EDT (-0400)
  questions on parametric objects and 3d splines (Message 5 to 14 of 14)  
<<< Previous 4 Messages Goto Initial 10 Messages
From: andrel
Subject: Re: questions on parametric objects and 3d splines
Date: 15 Mar 2004 16:44:18
Message: <40562386.5030700@hotmail.com>
lars petter wrote:

> Hello!
> 
> At school, we're developing a modelling tool that will generate shapes such
> as bezier curves, parabolas, ellipses and such in povray.
> 
> In the tool we have the parametrisised functions for all the shapes, so when
> it comes to the Pov-Ray script-generation, we're thinking about using the
> Parametric Object.
> 
> However, our shapes are supposed to have thickness and a height as well, and
> the Pov-Ray online documentation says; "The parametric object is not a solid
> object it is "hollow", like a thin shell."
> 
> So then we're wondering if there is some way to make these objects have a
> thickness as well.. Like one does with the isosurfaces, just subtract the
> thickness from the equation or something...?
> 
> The perfect solution however, would be that something like this can be done:
> http://hovedprosjekter.hig.no/v2004/data/gruppe11/param_obj.gif
> 
> A rectangle is swept along a parametrisised 3d spline to construct the solid
> object.. is this possible?
> 
In a sense it can be done for bezier patches. If you have
a start bezier surface and a final bezier surface and move
the surface from initial to final position along a bezier
spline (possibly modulating by moving control points
each along different bezier splines) then the 'side-surface'
will be a set of bicubic patches again. (as you wil only
have the true positions in 3D space, you have to compute
the positions of the controlpoints 'backwards', but that
can be done).
So, yes, what the link shows can be done in POV (provided
the curve has a cubic equation.)

I would not be able to do an elepsis along a parabolic
path myself. I have not studied the required equations
in depth. ( I guess I would approximate the ellipses and
oparabolas with bezier splines and patches, but that
would be cheating ;) ).

   Andrel


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: questions on parametric objects and 3d splines
Date: 15 Mar 2004 18:47:04
Message: <40564078@news.povray.org>
Hei Lars Petter.

Here's a norwegian page about Frenet frames and a little about
sweeping along Bezier curves:

http://www.ia.hiof.no/~borres/gb/ma-frames/p-frames.html

The modelling is done with OpenGL.

I hope this page has some relevance to your project.


Btw.:
POV-Ray's parametric obejct renders very slow, so I recommend
you to have a look at Ingo's macros if you need render
parametric shapes.


-- 
Tor Olav
http://subcube.com
http://subcube.net


Post a reply to this message

From: Mike Williams
Subject: Re: questions on parametric objects and 3d splines
Date: 16 Mar 2004 02:55:40
Message: <mlbRVDA4KrVAFwkh@econym.demon.co.uk>
Wasn't it lars petter who wrote:
>Hello!
>
>At school, we're developing a modelling tool that will generate shapes such
>as bezier curves, parabolas, ellipses and such in povray.
>
>In the tool we have the parametrisised functions for all the shapes, so when
>it comes to the Pov-Ray script-generation, we're thinking about using the
>Parametric Object.
>
>However, our shapes are supposed to have thickness and a height as well, and
>the Pov-Ray online documentation says; "The parametric object is not a solid
>object it is "hollow", like a thin shell."
>
>So then we're wondering if there is some way to make these objects have a
>thickness as well.. Like one does with the isosurfaces, just subtract the
>thickness from the equation or something...?
>
>The perfect solution however, would be that something like this can be done:
>http://hovedprosjekter.hig.no/v2004/data/gruppe11/param_obj.gif
>
>A rectangle is swept along a parametrisised 3d spline to construct the solid
>object.. is this possible?

All objects in POV are "hollow" in the sense meant in that part of the
documentation. The only difference with parametric objects is that many
sets of parametric equations result in surfaces that are open.

I guess that you're only thinking of using the "parametric object"
because you're working with "parameterisised functions" and they sound a
bit like they might be the same sort of thing. The tricky bit is going
to be that the "parameterisised functions" that create your curves are
likely to be three one-dimensional functions, whereas the POV parametric
object requires three two-dimensional functions.

Do take a look at the "bent prism" and the "sweepspline" in my
isosurface tutorial. 
<http://www.econym.demon.co.uk/isotut/more.htm>
<http://www.econym.demon.co.uk/isotut/splines.htm>

but you might be better off just doing exactly what is drawn in that gif
image you mentioned. Draw a large number of rounded rectangles that
follow the curve. If you draw them so that they are closer than a pixel
then they look like a continuous shape.

Here's some code that does that. Note the "Turn" parameter which
determines whether the rectangles are placed perpendicular to the path
or perpendicular to the z-axis.

#version 3.5;
global_settings {assumed_gamma 1.0}
camera {location  <0,0,-10> look_at <0,0,0> angle 30}
background {rgb 1}
light_source {<30, 100, -30> color rgb 1}
#include "transforms.inc"

// The "spline" parameters
#declare fx=function(u){sin(u)+cos(2*u)}
#declare fy=function(u){sin(3*u)}
#declare fz=function(u){u}

#declare Height=0.5;            // Rectangle Height
#declare Width=0.3;             // Rectangle Width
#declare Radius=0.05;           // Rectangle roundness
#declare Step = Radius/50;      // Make this smaller for larger images
                                // and smaller for quick tests

#declare Turn=1;             // set to 0 for the Rectangle to not turn

#declare Rect = union {
  sphere {<Width,Height,0>,Radius}
  sphere {<-Width,Height,0>,Radius}
  sphere {<-Width,-Height,0>,Radius}
  sphere {<Width,-Height,0>,Radius}
  cylinder {<Width,Height,0><-Width,Height,0>,Radius}
  cylinder {<-Width,Height,0><-Width,-Height,0>,Radius}
  cylinder {<-Width,-Height,0><Width,-Height,0>,Radius}
  cylinder {<Width,-Height,0><Width,Height,0>,Radius}
  pigment {rgb 1}
}

#declare E=0.00001;
#declare i=-1;
#while (i<1)
  //Use this to show the track of the "spline"
  //sphere {<fx(i),fy(i),fz(i)>,0.01 pigment {rgb x}}
  
  #if (Turn)
    // calculate the direction
    #declare D=<fx(i),fy(i),fz(i)> - <fx(i-E),fy(i-E),fz(i-E)>;
    // sweep out with turning rounded rectangle
    object {Rect
      transform {Reorient_Trans(z,D)}
      translate <fx(i),fy(i),fz(i)>
    }
  #else
    // sweep out with rounded rectangle
    object {Rect translate <fx(i),fy(i),fz(i)>}
  #end
  #declare i=i+Step;
#end

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: lars petter
Subject: Re: questions on parametric objects and 3d splines
Date: 16 Mar 2004 04:49:32
Message: <4056cdac@news.povray.org>
"Florian Brucker" <tor### [at] torfboldcom> wrote in message
news:40561bc3$1@news.povray.org...
> So here's the relevant thread:
>
>
http://news.povray.org/povray.binaries.scene-files/thread/%3C3fb73d9e@news.povray.org%3E/
>
> HTH,
> Florian
>

Hi!

That .zip file attached in that threaddoesnt work here.. anyone got it and
can attach it in a new post or something?

Thanks in advance
Lars Petter


Post a reply to this message

From: lars petter
Subject: Re: questions on parametric objects and 3d splines
Date: 16 Mar 2004 04:54:49
Message: <4056cee9$1@news.povray.org>
"Mike Williams" <nos### [at] econymdemoncouk> wrote in message
news:mlb### [at] econymdemoncouk...
> Wasn't it lars petter who wrote:
> >Hello!
> >
> >At school, we're developing a modelling tool that will generate shapes
such
> >as bezier curves, parabolas, ellipses and such in povray.
> >
> >In the tool we have the parametrisised functions for all the shapes, so
when
> >it comes to the Pov-Ray script-generation, we're thinking about using the
> >Parametric Object.
> >
> >However, our shapes are supposed to have thickness and a height as well,
and
> >the Pov-Ray online documentation says; "The parametric object is not a
solid
> >object it is "hollow", like a thin shell."
> >
> >So then we're wondering if there is some way to make these objects have a
> >thickness as well.. Like one does with the isosurfaces, just subtract the
> >thickness from the equation or something...?
> >
> >The perfect solution however, would be that something like this can be
done:
> >http://hovedprosjekter.hig.no/v2004/data/gruppe11/param_obj.gif
> >
> >A rectangle is swept along a parametrisised 3d spline to construct the
solid
> >object.. is this possible?
>
> All objects in POV are "hollow" in the sense meant in that part of the
> documentation. The only difference with parametric objects is that many
> sets of parametric equations result in surfaces that are open.
>
> I guess that you're only thinking of using the "parametric object"
> because you're working with "parameterisised functions" and they sound a
> bit like they might be the same sort of thing. The tricky bit is going
> to be that the "parameterisised functions" that create your curves are
> likely to be three one-dimensional functions, whereas the POV parametric
> object requires three two-dimensional functions.
>
> Do take a look at the "bent prism" and the "sweepspline" in my
> isosurface tutorial.
> <http://www.econym.demon.co.uk/isotut/more.htm>
> <http://www.econym.demon.co.uk/isotut/splines.htm>
>
> but you might be better off just doing exactly what is drawn in that gif
> image you mentioned. Draw a large number of rounded rectangles that
> follow the curve. If you draw them so that they are closer than a pixel
> then they look like a continuous shape.
>
> Here's some code that does that. Note the "Turn" parameter which
> determines whether the rectangles are placed perpendicular to the path
> or perpendicular to the z-axis.
>
> #version 3.5;
> global_settings {assumed_gamma 1.0}
> camera {location  <0,0,-10> look_at <0,0,0> angle 30}
> background {rgb 1}
> light_source {<30, 100, -30> color rgb 1}
> #include "transforms.inc"
>
> // The "spline" parameters
> #declare fx=function(u){sin(u)+cos(2*u)}
> #declare fy=function(u){sin(3*u)}
> #declare fz=function(u){u}
>
> #declare Height=0.5;            // Rectangle Height
> #declare Width=0.3;             // Rectangle Width
> #declare Radius=0.05;           // Rectangle roundness
> #declare Step = Radius/50;      // Make this smaller for larger images
>                                 // and smaller for quick tests
>
> #declare Turn=1;             // set to 0 for the Rectangle to not turn
>
> #declare Rect = union {
>   sphere {<Width,Height,0>,Radius}
>   sphere {<-Width,Height,0>,Radius}
>   sphere {<-Width,-Height,0>,Radius}
>   sphere {<Width,-Height,0>,Radius}
>   cylinder {<Width,Height,0><-Width,Height,0>,Radius}
>   cylinder {<-Width,Height,0><-Width,-Height,0>,Radius}
>   cylinder {<-Width,-Height,0><Width,-Height,0>,Radius}
>   cylinder {<Width,-Height,0><Width,Height,0>,Radius}
>   pigment {rgb 1}
> }
>
> #declare E=0.00001;
> #declare i=-1;
> #while (i<1)
>   //Use this to show the track of the "spline"
>   //sphere {<fx(i),fy(i),fz(i)>,0.01 pigment {rgb x}}
>
>   #if (Turn)
>     // calculate the direction
>     #declare D=<fx(i),fy(i),fz(i)> - <fx(i-E),fy(i-E),fz(i-E)>;
>     // sweep out with turning rounded rectangle
>     object {Rect
>       transform {Reorient_Trans(z,D)}
>       translate <fx(i),fy(i),fz(i)>
>     }
>   #else
>     // sweep out with rounded rectangle
>     object {Rect translate <fx(i),fy(i),fz(i)>}
>   #end
>   #declare i=i+Step;
> #end
>
> -- 
> Mike Williams
> Gentleman of Leisure


Okay, i see.. But will the rectangles function as a continous shape as well?
I'm asking since we are going to place some lights and such to generate
caustics.. and the objects ought to be solid then.. No light should go
through them :)

Thanks,
Lars Petter


Post a reply to this message

From: andrel
Subject: Re: questions on parametric objects and 3d splines
Date: 16 Mar 2004 05:17:50
Message: <4056D423.5040001@hotmail.com>
It doesn't work here either :(.
There is a SweepMesh.zip macro in mike's post a day before.
that one does work (but is probably not the same).

	Andrel

lars petter wrote:

> "Florian Brucker" <tor### [at] torfboldcom> wrote in message
> news:40561bc3$1@news.povray.org...
> 
>>So here's the relevant thread:
>>
>>
> 
>
http://news.povray.org/povray.binaries.scene-files/thread/%3C3fb73d9e@news.povray.org%3E/
> 
>>HTH,
>>Florian
>>
> 
> 
> Hi!
> 
> That .zip file attached in that threaddoesnt work here.. anyone got it and
> can attach it in a new post or something?
> 
> Thanks in advance
> Lars Petter
> 
>


Post a reply to this message

From: andrel
Subject: Re: questions on parametric objects and 3d splines
Date: 16 Mar 2004 05:18:57
Message: <4056D466.8020106@hotmail.com>
If you do not want the interior surfaces, use
merge in stead of union.


lars petter wrote:

> "Mike Williams" <nos### [at] econymdemoncouk> wrote in message
> news:mlb### [at] econymdemoncouk...
> 
>>Wasn't it lars petter who wrote:
>>
>>>Hello!
>>>
>>>At school, we're developing a modelling tool that will generate shapes
> 
> such
> 
>>>as bezier curves, parabolas, ellipses and such in povray.
>>>
>>>In the tool we have the parametrisised functions for all the shapes, so
> 
> when
> 
>>>it comes to the Pov-Ray script-generation, we're thinking about using the
>>>Parametric Object.
>>>
>>>However, our shapes are supposed to have thickness and a height as well,
> 
> and
> 
>>>the Pov-Ray online documentation says; "The parametric object is not a
> 
> solid
> 
>>>object it is "hollow", like a thin shell."
>>>
>>>So then we're wondering if there is some way to make these objects have a
>>>thickness as well.. Like one does with the isosurfaces, just subtract the
>>>thickness from the equation or something...?
>>>
>>>The perfect solution however, would be that something like this can be
> 
> done:
> 
>>>http://hovedprosjekter.hig.no/v2004/data/gruppe11/param_obj.gif
>>>
>>>A rectangle is swept along a parametrisised 3d spline to construct the
> 
> solid
> 
>>>object.. is this possible?
>>
>>All objects in POV are "hollow" in the sense meant in that part of the
>>documentation. The only difference with parametric objects is that many
>>sets of parametric equations result in surfaces that are open.
>>
>>I guess that you're only thinking of using the "parametric object"
>>because you're working with "parameterisised functions" and they sound a
>>bit like they might be the same sort of thing. The tricky bit is going
>>to be that the "parameterisised functions" that create your curves are
>>likely to be three one-dimensional functions, whereas the POV parametric
>>object requires three two-dimensional functions.
>>
>>Do take a look at the "bent prism" and the "sweepspline" in my
>>isosurface tutorial.
>><http://www.econym.demon.co.uk/isotut/more.htm>
>><http://www.econym.demon.co.uk/isotut/splines.htm>
>>
>>but you might be better off just doing exactly what is drawn in that gif
>>image you mentioned. Draw a large number of rounded rectangles that
>>follow the curve. If you draw them so that they are closer than a pixel
>>then they look like a continuous shape.
>>
>>Here's some code that does that. Note the "Turn" parameter which
>>determines whether the rectangles are placed perpendicular to the path
>>or perpendicular to the z-axis.
>>
>>#version 3.5;
>>global_settings {assumed_gamma 1.0}
>>camera {location  <0,0,-10> look_at <0,0,0> angle 30}
>>background {rgb 1}
>>light_source {<30, 100, -30> color rgb 1}
>>#include "transforms.inc"
>>
>>// The "spline" parameters
>>#declare fx=function(u){sin(u)+cos(2*u)}
>>#declare fy=function(u){sin(3*u)}
>>#declare fz=function(u){u}
>>
>>#declare Height=0.5;            // Rectangle Height
>>#declare Width=0.3;             // Rectangle Width
>>#declare Radius=0.05;           // Rectangle roundness
>>#declare Step = Radius/50;      // Make this smaller for larger images
>>                                // and smaller for quick tests
>>
>>#declare Turn=1;             // set to 0 for the Rectangle to not turn
>>
>>#declare Rect = union {
>>  sphere {<Width,Height,0>,Radius}
>>  sphere {<-Width,Height,0>,Radius}
>>  sphere {<-Width,-Height,0>,Radius}
>>  sphere {<Width,-Height,0>,Radius}
>>  cylinder {<Width,Height,0><-Width,Height,0>,Radius}
>>  cylinder {<-Width,Height,0><-Width,-Height,0>,Radius}
>>  cylinder {<-Width,-Height,0><Width,-Height,0>,Radius}
>>  cylinder {<Width,-Height,0><Width,Height,0>,Radius}
>>  pigment {rgb 1}
>>}
>>
>>#declare E=0.00001;
>>#declare i=-1;
>>#while (i<1)
>>  //Use this to show the track of the "spline"
>>  //sphere {<fx(i),fy(i),fz(i)>,0.01 pigment {rgb x}}
>>
>>  #if (Turn)
>>    // calculate the direction
>>    #declare D=<fx(i),fy(i),fz(i)> - <fx(i-E),fy(i-E),fz(i-E)>;
>>    // sweep out with turning rounded rectangle
>>    object {Rect
>>      transform {Reorient_Trans(z,D)}
>>      translate <fx(i),fy(i),fz(i)>
>>    }
>>  #else
>>    // sweep out with rounded rectangle
>>    object {Rect translate <fx(i),fy(i),fz(i)>}
>>  #end
>>  #declare i=i+Step;
>>#end
>>
>>-- 
>>Mike Williams
>>Gentleman of Leisure
> 
> 
> 
> Okay, i see.. But will the rectangles function as a continous shape as well?
> I'm asking since we are going to place some lights and such to generate
> caustics.. and the objects ought to be solid then.. No light should go
> through them :)
> 
> Thanks,
> Lars Petter
> 
>


Post a reply to this message

From: andrel
Subject: Re: questions on parametric objects and 3d splines
Date: 16 Mar 2004 06:09:38
Message: <4056E047.6060307@hotmail.com>
One other thing you might consider. If you use
cylinders and spheres to approximate the outer
surface, you get discontinuous normals when using
caustics and photons.

For the rectangle moving along a spline I would
relay use bicubic patches for the side surfaces.
If the spline is cubic, it is nearly trivial
and otherwise do a piece wise cubic approximation,
That would be more in style and you get smooth
normals everwhere.

	Andrel

lars petter wrote:

> "Mike Williams" <nos### [at] econymdemoncouk> wrote in message
> news:mlb### [at] econymdemoncouk...
> 
>>Wasn't it lars petter who wrote:
>>
>>>Hello!
>>>
>>>At school, we're developing a modelling tool that will generate shapes
> 
> such
> 
>>>as bezier curves, parabolas, ellipses and such in povray.
>>>
>>>In the tool we have the parametrisised functions for all the shapes, so
> 
> when
> 
>>>it comes to the Pov-Ray script-generation, we're thinking about using the
>>>Parametric Object.
>>>
>>>However, our shapes are supposed to have thickness and a height as well,
> 
> and
> 
>>>the Pov-Ray online documentation says; "The parametric object is not a
> 
> solid
> 
>>>object it is "hollow", like a thin shell."
>>>
>>>So then we're wondering if there is some way to make these objects have a
>>>thickness as well.. Like one does with the isosurfaces, just subtract the
>>>thickness from the equation or something...?
>>>
>>>The perfect solution however, would be that something like this can be
> 
> done:
> 
>>>http://hovedprosjekter.hig.no/v2004/data/gruppe11/param_obj.gif
>>>
>>>A rectangle is swept along a parametrisised 3d spline to construct the
> 
> solid
> 
>>>object.. is this possible?
>>
>>All objects in POV are "hollow" in the sense meant in that part of the
>>documentation. The only difference with parametric objects is that many
>>sets of parametric equations result in surfaces that are open.
>>
>>I guess that you're only thinking of using the "parametric object"
>>because you're working with "parameterisised functions" and they sound a
>>bit like they might be the same sort of thing. The tricky bit is going
>>to be that the "parameterisised functions" that create your curves are
>>likely to be three one-dimensional functions, whereas the POV parametric
>>object requires three two-dimensional functions.
>>
>>Do take a look at the "bent prism" and the "sweepspline" in my
>>isosurface tutorial.
>><http://www.econym.demon.co.uk/isotut/more.htm>
>><http://www.econym.demon.co.uk/isotut/splines.htm>
>>
>>but you might be better off just doing exactly what is drawn in that gif
>>image you mentioned. Draw a large number of rounded rectangles that
>>follow the curve. If you draw them so that they are closer than a pixel
>>then they look like a continuous shape.
>>
>>Here's some code that does that. Note the "Turn" parameter which
>>determines whether the rectangles are placed perpendicular to the path
>>or perpendicular to the z-axis.
>>
>>#version 3.5;
>>global_settings {assumed_gamma 1.0}
>>camera {location  <0,0,-10> look_at <0,0,0> angle 30}
>>background {rgb 1}
>>light_source {<30, 100, -30> color rgb 1}
>>#include "transforms.inc"
>>
>>// The "spline" parameters
>>#declare fx=function(u){sin(u)+cos(2*u)}
>>#declare fy=function(u){sin(3*u)}
>>#declare fz=function(u){u}
>>
>>#declare Height=0.5;            // Rectangle Height
>>#declare Width=0.3;             // Rectangle Width
>>#declare Radius=0.05;           // Rectangle roundness
>>#declare Step = Radius/50;      // Make this smaller for larger images
>>                                // and smaller for quick tests
>>
>>#declare Turn=1;             // set to 0 for the Rectangle to not turn
>>
>>#declare Rect = union {
>>  sphere {<Width,Height,0>,Radius}
>>  sphere {<-Width,Height,0>,Radius}
>>  sphere {<-Width,-Height,0>,Radius}
>>  sphere {<Width,-Height,0>,Radius}
>>  cylinder {<Width,Height,0><-Width,Height,0>,Radius}
>>  cylinder {<-Width,Height,0><-Width,-Height,0>,Radius}
>>  cylinder {<-Width,-Height,0><Width,-Height,0>,Radius}
>>  cylinder {<Width,-Height,0><Width,Height,0>,Radius}
>>  pigment {rgb 1}
>>}
>>
>>#declare E=0.00001;
>>#declare i=-1;
>>#while (i<1)
>>  //Use this to show the track of the "spline"
>>  //sphere {<fx(i),fy(i),fz(i)>,0.01 pigment {rgb x}}
>>
>>  #if (Turn)
>>    // calculate the direction
>>    #declare D=<fx(i),fy(i),fz(i)> - <fx(i-E),fy(i-E),fz(i-E)>;
>>    // sweep out with turning rounded rectangle
>>    object {Rect
>>      transform {Reorient_Trans(z,D)}
>>      translate <fx(i),fy(i),fz(i)>
>>    }
>>  #else
>>    // sweep out with rounded rectangle
>>    object {Rect translate <fx(i),fy(i),fz(i)>}
>>  #end
>>  #declare i=i+Step;
>>#end
>>
>>-- 
>>Mike Williams
>>Gentleman of Leisure
> 
> 
> 
> Okay, i see.. But will the rectangles function as a continous shape as well?
> I'm asking since we are going to place some lights and such to generate
> caustics.. and the objects ought to be solid then.. No light should go
> through them :)
> 
> Thanks,
> Lars Petter
> 
>


Post a reply to this message

From: lars petter
Subject: Re: questions on parametric objects and 3d splines
Date: 24 Mar 2004 06:24:42
Message: <40616ffa$1@news.povray.org>
Okay, now i've been trying parametric objects.. they're so slow that they
wont meet our demands on rendering time.

so: i went on to try ingo's param.inc, i can get the objects to look as i
want, but i cant get the caustics right.. the surface of the object is kinda
faulty, i guess.. is this something i can fix? and how?

i've made little page with code and renders if someone would be so kind to
have a look at it, it shows one example of what i want, and one example of
what i dont want:) the two scenes have the same colours, lights, and other
effects, it's just the two objects that are different. they have the same
radius, though.

http://hovedprosjekter.hig.no/v2004/data/gruppe11/code_and_pic.html


Post a reply to this message

From: lars petter
Subject: Re: questions on parametric objects and 3d splines
Date: 24 Mar 2004 09:57:54
Message: <4061a1f2$1@news.povray.org>
Ok Mr Mike, now i've tried out your code example, and gotten a circle up and
running.. the problem now is the caustics, they do come up, but not as good
as i want them =)

The circle is constructed with csg, i pull a thin box along a parametrisised
curve, and union all the different translated boxes i get.

I've put the code and render up on a page, it's "the almost version" =)
http://hovedprosjekter.hig.no/v2004/data/gruppe11/code_and_pic.html

I get fewer photon maps on this one, i guess that is what makes the caustics
poorer.. tips anyone? =)
("the right version" is what i'm looking for quality-wise, or at least
closer)

best regards,
lars petter
----------------------------------------------------------------------------
-----------------------------------------------------------------

"Mike Williams" <nos### [at] econymdemoncouk> wrote in message
news:mlb### [at] econymdemoncouk...
> All objects in POV are "hollow" in the sense meant in that part of the
> documentation. The only difference with parametric objects is that many
> sets of parametric equations result in surfaces that are open.
>
> I guess that you're only thinking of using the "parametric object"
> because you're working with "parameterisised functions" and they sound a
> bit like they might be the same sort of thing. The tricky bit is going
> to be that the "parameterisised functions" that create your curves are
> likely to be three one-dimensional functions, whereas the POV parametric
> object requires three two-dimensional functions.
>
> Do take a look at the "bent prism" and the "sweepspline" in my
> isosurface tutorial.
> <http://www.econym.demon.co.uk/isotut/more.htm>
> <http://www.econym.demon.co.uk/isotut/splines.htm>
>
> but you might be better off just doing exactly what is drawn in that gif
> image you mentioned. Draw a large number of rounded rectangles that
> follow the curve. If you draw them so that they are closer than a pixel
> then they look like a continuous shape.
>
> Here's some code that does that. Note the "Turn" parameter which
> determines whether the rectangles are placed perpendicular to the path
> or perpendicular to the z-axis.
>
> #version 3.5;
> global_settings {assumed_gamma 1.0}
> camera {location  <0,0,-10> look_at <0,0,0> angle 30}
> background {rgb 1}
> light_source {<30, 100, -30> color rgb 1}
> #include "transforms.inc"
>
> // The "spline" parameters
> #declare fx=function(u){sin(u)+cos(2*u)}
> #declare fy=function(u){sin(3*u)}
> #declare fz=function(u){u}
>
> #declare Height=0.5;            // Rectangle Height
> #declare Width=0.3;             // Rectangle Width
> #declare Radius=0.05;           // Rectangle roundness
> #declare Step = Radius/50;      // Make this smaller for larger images
>                                 // and smaller for quick tests
>
> #declare Turn=1;             // set to 0 for the Rectangle to not turn
>
> #declare Rect = union {
>   sphere {<Width,Height,0>,Radius}
>   sphere {<-Width,Height,0>,Radius}
>   sphere {<-Width,-Height,0>,Radius}
>   sphere {<Width,-Height,0>,Radius}
>   cylinder {<Width,Height,0><-Width,Height,0>,Radius}
>   cylinder {<-Width,Height,0><-Width,-Height,0>,Radius}
>   cylinder {<-Width,-Height,0><Width,-Height,0>,Radius}
>   cylinder {<Width,-Height,0><Width,Height,0>,Radius}
>   pigment {rgb 1}
> }
>
> #declare E=0.00001;
> #declare i=-1;
> #while (i<1)
>   //Use this to show the track of the "spline"
>   //sphere {<fx(i),fy(i),fz(i)>,0.01 pigment {rgb x}}
>
>   #if (Turn)
>     // calculate the direction
>     #declare D=<fx(i),fy(i),fz(i)> - <fx(i-E),fy(i-E),fz(i-E)>;
>     // sweep out with turning rounded rectangle
>     object {Rect
>       transform {Reorient_Trans(z,D)}
>       translate <fx(i),fy(i),fz(i)>
>     }
>   #else
>     // sweep out with rounded rectangle
>     object {Rect translate <fx(i),fy(i),fz(i)>}
>   #end
>   #declare i=i+Step;
> #end
>
> -- 
> Mike Williams
> Gentleman of Leisure


Post a reply to this message

<<< Previous 4 Messages Goto Initial 10 Messages

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