POV-Ray : Newsgroups : povray.general : Null or empty object / mesh Server Time
1 May 2024 19:05:57 EDT (-0400)
  Null or empty object / mesh (Message 5 to 14 of 14)  
<<< Previous 4 Messages Goto Initial 10 Messages
From: clipka
Subject: Re: Null or empty object / mesh
Date: 12 Aug 2016 11:50:04
Message: <57adf02c@news.povray.org>
Am 12.08.2016 um 12:24 schrieb Mr:
> Hi guys, is there no null object in Povray?
> Something as close as possible to object{}  that could be used in a scene, and
> applied a matrix to with no apparent result?
> 
> I need to keep some point transformations, without anything actually being
> rendered in the scene.

That depends on what /exactly/ you want to do.

In POV-Ray SDL, the standard way of keeping track of transformations is

    #declare MyTrans = transform {
      rotate    ...
      translate ...
      scale     ...
    }

Alternatively, if you're only interested in the effect of the
transformations on a given point, you can use vector transformation
functions, like so:

    #declare MyPoint = ...;
    #declare MyPoint = vrotate    (MyPoint, ...);
    #declare MyPoint = vtranslate (MyPoint, ...);
    #declare MyPoint = vscale     (MyPoint, ...);

If it is necessary that the thing is an object (presumably because it
would make the life easier for your exporter), another approach might be
to use an invisible sphere, like so:

    #declare MyMarker = sphere { <0,0,0>, 1
      no_image no_reflection no_shadow no_radiosity
    }

You can then get the coordinates of the sphere's center after
transformation as the average of the object's `min_extent()` and
`max_extent()`.


If on the other hand the only thing you really need is a dummy object to
attach a transformation to, without actually doing anything with it in
the POV-Ray scene -- for instance to export an empty object group from
Blender in a manner that it can be re-imported later -- the simplest
approach would be an empty union:

    #declare MyDummy = union {
      rotate    ...
      translate ...
      scale     ...
    }

You'll get a warning, but aside from that POV-Ray will be fine.


Post a reply to this message

From: Alain
Subject: Re: Null or empty object / mesh
Date: 12 Aug 2016 14:48:40
Message: <57ae1a08$1@news.povray.org>

> Hi guys, is there no null object in Povray?
> Something as close as possible to object{}  that could be used in a scene, and
> applied a matrix to with no apparent result?
>
> I need to keep some point transformations, without anything actually being
> rendered in the scene.
>
> I tried #declare DATAEmpty =mesh {triangle{<0, 0, 0>,<0, 0, 0>,<0, 0, 0>}}
> but it does not work
>
>

That's not a null object but a degenerate triangle.

You may try a zero radius sphere:
sphere{Center, 0}

An invisible object:
sphere{Center, Radius pigment{rgbt 1} no_image no_shadow no_reflection 
no_radiosity photons{pass_through collect off} hollow }

You can also use vector operations as previously suggested.

Also as previously suggested, you can #declare your transformation.


Post a reply to this message

From: Mr
Subject: Re: Null or empty object / mesh
Date: 19 Aug 2016 04:30:00
Message: <web.57b6c35f2494daf716086ed00@news.povray.org>
Alain <kua### [at] videotronca> wrote:

> > Hi guys, is there no null object in Povray?
> > Something as close as possible to object{}  that could be used in a scene, and
> > applied a matrix to with no apparent result?
> >
> > I need to keep some point transformations, without anything actually being
> > rendered in the scene.
> >
> > I tried #declare DATAEmpty =mesh {triangle{<0, 0, 0>,<0, 0, 0>,<0, 0, 0>}}
> > but it does not work
> >
> >
>
> That's not a null object but a degenerate triangle.
>
> You may try a zero radius sphere:
> sphere{Center, 0}
>
> An invisible object:
> sphere{Center, Radius pigment{rgbt 1} no_image no_shadow no_reflection
> no_radiosity photons{pass_through collect off} hollow }
>
> You can also use vector operations as previously suggested.
>
> Also as previously suggested, you can #declare your transformation.

Thanks, I made it a 0 radius sphere with all suggested attributes


Post a reply to this message

From: Zeger Knaepen
Subject: Re: Null or empty object / mesh
Date: 20 Aug 2016 16:58:00
Message: <57b8c458$1@news.povray.org>
> Thanks, I made it a 0 radius sphere with all suggested attributes

Is there another use for a null than to keep track of a location after 
some transformations and/or linking other objects to that location? And 
isn't that something that can much easier be done in POV-Ray by 
declaring and vtransforming a vector?

I'm just curious why you would need a null/empty object in POV-Ray.


Post a reply to this message

From: Alain
Subject: Re: Null or empty object / mesh
Date: 21 Aug 2016 18:01:35
Message: <57ba24bf@news.povray.org>

>> Thanks, I made it a 0 radius sphere with all suggested attributes
>
> Is there another use for a null than to keep track of a location after
> some transformations and/or linking other objects to that location? And
> isn't that something that can much easier be done in POV-Ray by
> declaring and vtransforming a vector?
>
> I'm just curious why you would need a null/empty object in POV-Ray.
>

There is realy no need to use a null object, but, for some, it's 
intuitively easier that way. Also, some peoples are not aware of, or 
comfortable with, vector transformations.

Once that object is #declared, you can get it's location using #declare 
Loc_Max = max_extent(Object_Name); and #declare Loc_Min = 
min_extent(Object_Name); and averaging the values. With a zero radius 
sphere, the two values are the same allowing you to use only one of the 
#declare.

Yes, it's beter to use a transformed vector. It use less memory and it's 
faster to access.


Post a reply to this message

From: Mr
Subject: Re: Null or empty object / mesh
Date: 22 Aug 2016 07:15:00
Message: <web.57badde62494daf716086ed00@news.povray.org>
Zeger Knaepen <zeg### [at] povplacecom> wrote:
> > Thanks, I made it a 0 radius sphere with all suggested attributes
>
> Is there another use for a null than to keep track of a location after
> some transformations and/or linking other objects to that location? And
> isn't that something that can much easier be done in POV-Ray by
> declaring and vtransforming a vector?
>
> I'm just curious why you would need a null/empty object in POV-Ray.

It's not totally unrelated to Shrodinger's cat... But not quite the same thing
either.




Vertices may be here in a mesh2 or not.
For the exporter from Blender to POV it is possible to have a mesh object from
which the user will have deleted all vertices, this user may not be willing to
add anthing to the scene, but we have to assume that he does it on purpose, and
would indeed want to keep track of the transformations of some point, BUT he
uses an interface and doesn't even want to know what a vector or a matrix is.
Also, the transformations would have to happen through all the same operators as
the standard geometry exported. because creating a particular case may have
inconsistant results.

Would a declared vector be able to pass through all the transforms a mesh2
object can ever go through? if so I was wrong and should use a vector, but if I
HAVE to add a vtransform or anything that all standard geometry can't go
through, then I can't use it, because it's not a mesh... but it's a mesh. :-)


Post a reply to this message

From: clipka
Subject: Re: Null or empty object / mesh
Date: 22 Aug 2016 15:48:59
Message: <57bb572b@news.povray.org>
Am 22.08.2016 um 13:11 schrieb Mr:

> For the exporter from Blender to POV it is possible to have a mesh object from
> which the user will have deleted all vertices, this user may not be willing to
> add anthing to the scene, but we have to assume that he does it on purpose, and
> would indeed want to keep track of the transformations of some point, BUT he
> uses an interface and doesn't even want to know what a vector or a matrix is.
> Also, the transformations would have to happen through all the same operators as
> the standard geometry exported. because creating a particular case may have
> inconsistant results.

A vector won't fit your purpose, since you need different code to
transform it.

Given that the described use case doesn't leave a vertex to track, the
most fitting analogon would probably be an empty union.

> Would a declared vector be able to pass through all the transforms a mesh2
> object can ever go through? if so I was wrong and should use a vector, but if I
> HAVE to add a vtransform or anything that all standard geometry can't go
> through, then I can't use it, because it's not a mesh... but it's a mesh. :-)

Maybe what we should do is change the behaviour of the parser when it
encounters a mesh2, to issue "possible parse error" warnings instead of
outright errors when it encounters an empty list of faces or empty list
of indices.


Post a reply to this message

From: Mr
Subject: Re: Null or empty object / mesh
Date: 26 Aug 2016 10:30:00
Message: <web.57c051b72494daf716086ed00@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Am 22.08.2016 um 13:11 schrieb Mr:
>
> > For the exporter from Blender to POV it is possible to have a mesh object from
> > which the user will have deleted all vertices, this user may not be willing to
> > add anthing to the scene, but we have to assume that he does it on purpose, and
> > would indeed want to keep track of the transformations of some point, BUT he
> > uses an interface and doesn't even want to know what a vector or a matrix is.
> > Also, the transformations would have to happen through all the same operators as
> > the standard geometry exported. because creating a particular case may have
> > inconsistant results.
>
> A vector won't fit your purpose, since you need different code to
> transform it.
>
> Given that the described use case doesn't leave a vertex to track, the
> most fitting analogon would probably be an empty union.
>
> > Would a declared vector be able to pass through all the transforms a mesh2
> > object can ever go through? if so I was wrong and should use a vector, but if I
> > HAVE to add a vtransform or anything that all standard geometry can't go
> > through, then I can't use it, because it's not a mesh... but it's a mesh. :-)
>
> Maybe what we should do is change the behaviour of the parser when it
> encounters a mesh2, to issue "possible parse error" warnings instead of
> outright errors when it encounters an empty list of faces or empty list
> of indices.

Don't bother, it's already fine with zerosphere, and also there are other non
geometrical objects called empties which wouldn't get exported as meshes, so I
used also zerosphere, counting on spheres to be the most tested and optimized
pov  objects :-)  I'm very happy with the direction pov/uberpov/hgpov, etc is
evolving! thanks youz ! :-)


Post a reply to this message

From: eudoxos
Subject: Re: Null or empty object / mesh
Date: 11 Apr 2017 07:05:00
Message: <web.58ecb7db2494daf7658db7180@news.povray.org>
> > Thanks, I made it a 0 radius sphere with all suggested attributes
>
> Is there another use for a null than to keep track of a location after
> some transformations and/or linking other objects to that location? And
> isn't that something that can much easier be done in POV-Ray by
> declaring and vtransforming a vector?
>
> I'm just curious why you would need a null/empty object in POV-Ray.

I have a use case just now. A series of scenes (animations of particle
simulation) where particles have pseudo-random texture, but are always declared
sequentially, thus the pseudo-random texture will be the same. As a particle
might disappear during the simulation, creating hole in the sequence, I need to
call the texture procedure (using null object) so that the state of the
pseudo-random generator is advanced and subsequent particles get the same
pseudo-random texture parameters as in preceding steps.


Post a reply to this message

From: Alain
Subject: Re: Null or empty object / mesh
Date: 11 Apr 2017 17:22:41
Message: <58ed4921@news.povray.org>

>
>>> Thanks, I made it a 0 radius sphere with all suggested attributes
>>
>> Is there another use for a null than to keep track of a location after
>> some transformations and/or linking other objects to that location? And
>> isn't that something that can much easier be done in POV-Ray by
>> declaring and vtransforming a vector?
>>
>> I'm just curious why you would need a null/empty object in POV-Ray.
>
> I have a use case just now. A series of scenes (animations of particle
> simulation) where particles have pseudo-random texture, but are always declared
> sequentially, thus the pseudo-random texture will be the same. As a particle
> might disappear during the simulation, creating hole in the sequence, I need to
> call the texture procedure (using null object) so that the state of the
> pseudo-random generator is advanced and subsequent particles get the same
> pseudo-random texture parameters as in preceding steps.
>
>
>
>
Well, a zero radius sphere prety well IS a null object.
Just push that disappeared particle far behing the camera, with a zero 
momentum, or give it a zero radius, and still give it it's texture.


Post a reply to this message

<<< Previous 4 Messages Goto Initial 10 Messages

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