POV-Ray : Newsgroups : povray.general : Feature request (spherize?) Server Time
5 Nov 2024 13:23:15 EST (-0500)
  Feature request (spherize?) (Message 1 to 10 of 11)  
Goto Latest 10 Messages Next 1 Messages >>>
From: Rune S  Johansen
Subject: Feature request (spherize?)
Date: 15 May 1999 21:18:08
Message: <373e0ec0.0@news.povray.org>
I would like to see a new new keyword in POV-Ray that could be added to all
objects.
It is quite simple, still I don't quite know how to explain it.
If the keyword was spherize [float] the following:
box {
   <-1,-1,-1>, <+1,+1,+1>
   spherize 1.5
}
should make a rounded box from <-2.5,-2.5,-2.5> to <+2.5,+2.5,+2.5>.

It should sort of extrude any shape in a spherical way so things get bigger
and rounded.
It should extend an object so that all points [float] units away from it
should be included in it.

You should be able to add it to individual objects in csg and/or to the
whole csg object as you wish.
As a non-programmer I would guess it could also support flat objects such as
disc, triangle ect... These would become solid rounded prisms.

Hmm, when I think of it, all spherized objects including csg objects
consisting of multiple objects with different textures would probably need a
new single texture. I hope not, but anyway, I think the feature would still
be very usefull.

I hope you understand what I mean.

I see lots of uses for this feature:
A spherized object with white media around the original object would give a
nice glow that fits to the object.
With spherize and the right scaling, any object could be morphed into a
sphere (and from that into another object).
An kind of alternative to blobs? Not the same at all, but...

Would that be possible to implement? What about the textures?

Greetings,

Rune S. Johansen

---
My POV-Ray 3D Gallery, the POV Desktop Theme,
and the compiled list
"you know you have been raytracing too long when..."
at http://hjem.get2net.dk/rsj


Post a reply to this message

From: Nieminen Mika
Subject: Re: Feature request (spherize?)
Date: 17 May 1999 08:18:34
Message: <373ffb0a.0@news.povray.org>
Rune S. Johansen <run### [at] get2netdk> wrote:
: I would like to see a new new keyword in POV-Ray

  Many people would like too... :)

: If the keyword was spherize [float] the following:
: box {
:    <-1,-1,-1>, <+1,+1,+1>
:    spherize 1.5
: }
: should make a rounded box from <-2.5,-2.5,-2.5> to <+2.5,+2.5,+2.5>.

: It should sort of extrude any shape in a spherical way so things get bigger
: and rounded.

  You have to first understand how povray works before you can understand
how easy/difficult this kind of transformation is.
  It's a fact that povray can only make linear transformations to objects.
The reason is the following:
  When povray calculates a transformation, it doesn't actually transform
the object but the ray which hits the object. For example, if you scale
the object twice of its original size, the inverse transformation as actually
applied to the rays, ie. they are scaled to be twice as small as usual.
  Why this way? Because objects are only mathemathical entities, not
physical polygons (perhaps triangle meshes are an exception). Raytracing
a sphere means actually calculating the intersection between a line and a
spherical surface (which is only a mathematical formula). Transforming the
mathematical surface would be a pain, but transforming the line is extremely
easy.
  A ray is a straight line. Linear transformation means that after the
transformation the ray is still a straight line.
  Non-linear transformation means that after the transformation the line
is not straight anymore, but curved. Calculating the intersection between
a mathematical surface and a curve is extremely difficult (in many cases
it's impossible without a slow approximation method).

  What you are suggesting here looks a lot like a non-linear transformation.

  People often think that there should be no problems with non-linear
transformations because they work so well in programs like 3D-studio. They
forget that those programs work with polygons and that those transformations
are made to the polygons themselves. You can't make those transformations
to mathematical formulas (well, actually it may be possible in some cases,
but it would be a pain).
  They also forget that it's the modeller who is making the transformation,
not the renderer. Povray is just a renderer, not a modeller.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Rune S  Johansen
Subject: Re: Feature request (spherize?)
Date: 17 May 1999 19:21:34
Message: <3740966e.0@news.povray.org>
Nieminen Mika wrote:
>Rune S. Johansen <run### [at] get2netdk> wrote:
>: I would like to see a new new keyword in POV-Ray.
>: If the keyword was spherize [float] the following:
>: box {
>:    <-1,-1,-1>, <+1,+1,+1>
>:    spherize 1.5
>: }
>: should make a rounded box from <-2.5,-2.5,-2.5> to <+2.5,+2.5,+2.5>.
>
>: It should sort of extrude any shape in a spherical way so things get
bigger
>: and rounded.
>
>  You have to first understand how povray works before you can understand
>how easy/difficult this kind of transformation is.
>  It's a fact that povray can only make linear transformations to objects.
>The reason is the following:
>  When povray calculates a transformation, it doesn't actually transform
>the object but the ray which hits the object. For example, if you scale
>the object twice of its original size, the inverse transformation as
actually
>applied to the rays, ie. they are scaled to be twice as small as usual.
>  Why this way? Because objects are only mathemathical entities, not
>physical polygons (perhaps triangle meshes are an exception). Raytracing
>a sphere means actually calculating the intersection between a line and a
>spherical surface (which is only a mathematical formula). Transforming the
>mathematical surface would be a pain, but transforming the line is
extremely
>easy.
>  A ray is a straight line. Linear transformation means that after the
>transformation the ray is still a straight line.
>  Non-linear transformation means that after the transformation the line
>is not straight anymore, but curved. Calculating the intersection between
>a mathematical surface and a curve is extremely difficult (in many cases
>it's impossible without a slow approximation method).

Thank you for you response, you have expanded my knowledge a little :-)

>  What you are suggesting here looks a lot like a non-linear
transformation.

Hmm, I don't know what is called a transformation and what is not. Isn't
turbulence and warps kinds of transformations? Are they linear?

Well, I just thought might be possible to combine the calculation of the
intersection of any object with the intersection of a sphere. I would think
a sphere intersection is made if the ray comes nearer than [radius] units
from the center. The same way a spherized object intersection should be made
if the ray comes nearer than [float] units from any point in the object. But
since I am not a programmer, I don't know if that actually make sense or
not.


P.S.: I have never used anything else than POV-Ray. I have never used a
modeller either. :-)

Greetings,

Rune S. Johansen

---
My POV-Ray 3D Gallery, the POV Desktop Theme,
and the compiled list
"you know you have been raytracing too long when..."
at http://hjem.get2net.dk/rsj


Post a reply to this message

From: J  Grimbert
Subject: Re: Feature request (spherize?)
Date: 18 May 1999 05:38:32
Message: <374126FD.436499BB@atos-group.com>
"Rune S. Johansen" wrote:
> 
> I would like to see a new new keyword in POV-Ray that could be added to all
> objects.
> It is quite simple, still I don't quite know how to explain it.
> If the keyword was spherize [float] the following:
> box {
>    <-1,-1,-1>, <+1,+1,+1>
>    spherize 1.5
> }
> should make a rounded box from <-2.5,-2.5,-2.5> to <+2.5,+2.5,+2.5>.
> 

This example would look like a blob supporting a box primitive 
(instead of just sphere and cylinder )

> It should sort of extrude any shape in a spherical way so things get bigger
> and rounded.
> It should extend an object so that all points [float] units away from it
> should be included in it.

Yes, sound like a generalized blob...

> 
> You should be able to add it to individual objects in csg and/or to the
> whole csg object as you wish.

Blob again...

> As a non-programmer I would guess it could also support flat objects such as
> disc, triangle ect... These would become solid rounded prisms.
> 

Arggg...

> Hmm, when I think of it, all spherized objects including csg objects
> consisting of multiple objects with different textures would probably need a
> new single texture. I hope not, but anyway, I think the feature would still
> be very usefull.
> 
> I hope you understand what I mean.
> 
> I see lots of uses for this feature:
> A spherized object with white media around the original object would give a
> nice glow that fits to the object.
> With spherize and the right scaling, any object could be morphed into a
> sphere (and from that into another object).
> An kind of alternative to blobs? Not the same at all, but...
> 
> Would that be possible to implement? What about the textures?

What about a simple macro:
 take one object
 for a high number of iterations, 
    translate a copy of the object from the center of a sphere to a
point of surface
 repeat until every point of the sphere has been used.
 
The problem will be to cover the whole sphere completely...
and the distribution should be evenly spaced...


> 
> Greetings,
> 
> Rune S. Johansen
> 
> ---
> My POV-Ray 3D Gallery, the POV Desktop Theme,
> and the compiled list
> "you know you have been raytracing too long when..."
> at http://hjem.get2net.dk/rsj


Post a reply to this message

From: Nieminen Mika
Subject: Re: Feature request (spherize?)
Date: 18 May 1999 13:13:35
Message: <374191af.0@news.povray.org>
Rune S. Johansen <run### [at] get2netdk> wrote:
: Hmm, I don't know what is called a transformation and what is not. Isn't
: turbulence and warps kinds of transformations? Are they linear?

  They are non-linear, but they don't transform the _shape_ of objects,
only textures. The program has already calculated the intersection between
the ray and the object and now it knows where did the ray hit. Now it can
calculate the color of that point in any way it wants. Texturing is not
raytracing anymore.

: Well, I just thought might be possible to combine the calculation of the
: intersection of any object with the intersection of a sphere. I would think
: a sphere intersection is made if the ray comes nearer than [radius] units
: from the center. The same way a spherized object intersection should be made
: if the ray comes nearer than [float] units from any point in the object. But
: since I am not a programmer, I don't know if that actually make sense or
: not.

  The intersection is easy to calculate if the ray is a straight line. If
it's a curve, then we have a problem.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Ron Parker
Subject: Re: Feature request (spherize?)
Date: 18 May 1999 13:59:48
Message: <37419c84.0@news.povray.org>
On Tue, 18 May 1999 00:02:23 +0200, Rune S. Johansen wrote:
>Well, I just thought might be possible to combine the calculation of the
>intersection of any object with the intersection of a sphere. I would think
>a sphere intersection is made if the ray comes nearer than [radius] units
>from the center. The same way a spherized object intersection should be made
>if the ray comes nearer than [float] units from any point in the object. But
>since I am not a programmer, I don't know if that actually make sense or
>not.

The problem is that while it's usually a simple test to know if a ray hit an
arbitrary object, knowing whether it came within 'x' units of an object is 
a whole different can of worms.  (And, in fact, if you could know that you
would have the answer immediately.)  For some objects, like spheres, it's an
easy test.  For other objects, like boxes and cylinders, it's not at all easy.  
In fact, it's easier to just do boxes and cylinders as macros.  For height
fields and meshes, it's truly ugly no matter how you do it.  CSG intersection 
would probably be ugly, too.  The common thread here is that things with sharp
edges are likely to be hard to deal with.  Most nontrivial objects have sharp
edges.

I did read a paper once, describing a very realistic method of simulating 
dirt on an object, that makes me wish this operation were less ugly.  They
had some interesting ideas on the subject, but the implementation wasn't what 
one could call easy.


Post a reply to this message

From: Ralf Muschall
Subject: Re: Feature request (spherize?)
Date: 18 May 1999 22:05:20
Message: <37420E2E.3D5EB505@t-online.de>
Rune S. Johansen schrieb:

> It is quite simple, still I don't quite know how to explain it.
> If the keyword was spherize [float] the following:
> box {
>    <-1,-1,-1>, <+1,+1,+1>
>    spherize 1.5
> }
> should make a rounded box from <-2.5,-2.5,-2.5> to <+2.5,+2.5,+2.5>.

> It should sort of extrude any shape in a spherical way so things get bigger
> and rounded.

If your initial body is a polyhedron, just make a macro which shifts
the faces outward by the given distance, add cylinders for the edges,
and spheres for the corners.
This is probably hard for generic shapes, but should be easy for cubes.

If the shape is not a polyhedron, you are sort of lost: The set of
all points in the r-environment (for positive r) of a polynomial
surface might again be a polynomial, but of much higher order.

Ralf


Post a reply to this message

From: Bob Hughes
Subject: Re: Feature request (spherize?)
Date: 19 May 1999 06:03:02
Message: <37427E44.248B818D@aol.com>
Sounds like stuff for the povray.advanced-users group. Thought that was
why it was created, to discuss these "over my head" kind of topics.
Noticed Ken T. hadn't spoken up in here yet and just figured I'd take a
guess at something he might have to say.


"Rune S. Johansen" wrote:
> 
> I would like to see a new new keyword in POV-Ray that could be added to all
> objects.
> It is quite simple, still I don't quite know how to explain it.
> If the keyword was spherize [float] the following:
> box {
>    <-1,-1,-1>, <+1,+1,+1>
>    spherize 1.5
> }
> should make a rounded box from <-2.5,-2.5,-2.5> to <+2.5,+2.5,+2.5>.
> 
> It should sort of extrude any shape in a spherical way so things get bigger
> and rounded.
> It should extend an object so that all points [float] units away from it
> should be included in it.
> 
> You should be able to add it to individual objects in csg and/or to the
> whole csg object as you wish.
> As a non-programmer I would guess it could also support flat objects such as
> disc, triangle ect... These would become solid rounded prisms.
> 
> Hmm, when I think of it, all spherized objects including csg objects
> consisting of multiple objects with different textures would probably need a
> new single texture. I hope not, but anyway, I think the feature would still
> be very usefull.
> 
> I hope you understand what I mean.
> 
> I see lots of uses for this feature:
> A spherized object with white media around the original object would give a
> nice glow that fits to the object.
> With spherize and the right scaling, any object could be morphed into a
> sphere (and from that into another object).
> An kind of alternative to blobs? Not the same at all, but...
> 
> Would that be possible to implement? What about the textures?
> 
> Greetings,
> 
> Rune S. Johansen
> 
> ---
> My POV-Ray 3D Gallery, the POV Desktop Theme,
> and the compiled list
> "you know you have been raytracing too long when..."
> at http://hjem.get2net.dk/rsj

-- 
 omniVERSE: beyond the universe
  http://members.aol.com/inversez/homepage.htm
 mailto://inversez@aol.com?Subject=PoV-News


Post a reply to this message

From: Spider
Subject: Re: Feature request (spherize?)
Date: 19 May 1999 19:45:28
Message: <3742C939.8AEF7BBD@bahnhof.se>
I have to reply with my thoughts here..
I'm probably less advanced in POv than many(I'm a programmer and make my scenes
as such) but i really think it's worth lurking in the advanced-users group since
it's a great way to learn. If I don't understand, I usually wait or I will
pesker those who seems to know ;)



Bob Hughes wrote:
> 
> Sounds like stuff for the povray.advanced-users group. Thought that was
> why it was created, to discuss these "over my head" kind of topics.
> Noticed Ken T. hadn't spoken up in here yet and just figured I'd take a
> guess at something he might have to say.
> 
> "Rune S. Johansen" wrote:
> >
> > I would like to see a new new keyword in POV-Ray that could be added to all
> > objects.
> > It is quite simple, still I don't quite know how to explain it.
> > If the keyword was spherize [float] the following:
> > box {
> >    <-1,-1,-1>, <+1,+1,+1>
> >    spherize 1.5
> > }
> > should make a rounded box from <-2.5,-2.5,-2.5> to <+2.5,+2.5,+2.5>.
> >
> > It should sort of extrude any shape in a spherical way so things get bigger
> > and rounded.
> > It should extend an object so that all points [float] units away from it
> > should be included in it.
> >
> > You should be able to add it to individual objects in csg and/or to the
> > whole csg object as you wish.
> > As a non-programmer I would guess it could also support flat objects such as
> > disc, triangle ect... These would become solid rounded prisms.
> >
> > Hmm, when I think of it, all spherized objects including csg objects
> > consisting of multiple objects with different textures would probably need a
> > new single texture. I hope not, but anyway, I think the feature would still
> > be very usefull.
> >
> > I hope you understand what I mean.
> >
> > I see lots of uses for this feature:
> > A spherized object with white media around the original object would give a
> > nice glow that fits to the object.
> > With spherize and the right scaling, any object could be morphed into a
> > sphere (and from that into another object).
> > An kind of alternative to blobs? Not the same at all, but...
> >
> > Would that be possible to implement? What about the textures?
> >
> > Greetings,
> >
> > Rune S. Johansen
> >
> > ---
> > My POV-Ray 3D Gallery, the POV Desktop Theme,
> > and the compiled list
> > "you know you have been raytracing too long when..."
> > at http://hjem.get2net.dk/rsj
> 
> --
>  omniVERSE: beyond the universe
>   http://members.aol.com/inversez/homepage.htm
>  mailto://inversez@aol.com?Subject=PoV-News

-- 
//Spider    --  [ spi### [at] bahnhofse ]-[ http://www.bahnhof.se/~spider/ ]
And the meek'll inherit what they damn well please
	Get ahead, go figure, go ahead and pull the trigger
		Everything under the gun
			--"Sisters Of Mercy" -- "Under The Gun"


Post a reply to this message

From: Ken
Subject: Re: Feature request (spherize?)
Date: 21 May 1999 07:11:36
Message: <37453123.BD080AFF@pacbell.net>
Bob Hughes wrote:

> Noticed Ken T. hadn't spoken up in here.

Haven't really felt inclined to. Personaly I think it would be
so difficult to program into the system it would probably break
something else in the process. I can live without it. We do have
CSG operations, super ellipsoid objects, tori, and cylinders.
There is not much you can't do having these types of tools at
your disposal. Just takes a little creative imagination, some
common sense, and a wee bit of pratice is all.

-- 
Ken Tyler

mailto://tylereng@pacbell.net


Post a reply to this message

Goto Latest 10 Messages Next 1 Messages >>>

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