POV-Ray : Newsgroups : povray.binaries.images : Object Placement Rabbit Hole Server Time
6 Aug 2025 15:32:25 EDT (-0400)
  Object Placement Rabbit Hole (Message 11 to 14 of 14)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: kurtz le pirate
Subject: Re: Object Placement Rabbit Hole
Date: 1 Aug 2025 04:39:25
Message: <688c7d3d$1@news.povray.org>
On 31/07/2025 21:44, Chris R wrote:

>>
>> Thanks for digging this up.  I am thinking I will try and implement this method
>> as an alternative using my own coding style, POV 3.8 features, and fitting into
>> my library code framework, and then compare the results with the triangle-based
>> version.  It appears there is some interesting code to deal with the problem of
>> local, small plateaus on the surface object to try out.
>>
>> -- Chris R
> I wrote the code based on the letter stacking code in libcollide.inc and
> debugged it, and added the grid generation piece to my libmesh.inc library.
> Here are the results of repeatedly adding 20 discs to the same uneven surface
> using the algorithm.  I think it does pretty well and it's actually quick enough
> that you could run it during rendering, but I kept the option to write the
> transforms to a file so you can pre-create them.
> 


Hope that help a little...


-- 
kurtz le pirate
compagnie de la banquise


Post a reply to this message

From: Chris R
Subject: Re: Object Placement Rabbit Hole
Date: 1 Aug 2025 10:30:00
Message: <web.688cce5acdb862484a0708c75cc1b6e@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> "Chris R" <car### [at] comcastnet> wrote:
>
> > I wrote the code based on the letter stacking code in libcollide.inc and
> > debugged it, and added the grid generation piece to my libmesh.inc library.
> > Here are the results of repeatedly adding 20 discs to the same uneven surface
> > using the algorithm.  I think it does pretty well and it's actually quick enough
> > that you could run it during rendering, but I kept the option to write the
> > transforms to a file so you can pre-create them.
>
> Damn, that is nice.
>
> I'm hoping to see a pile of many more primitives on a much more uneven surface!
>
> Nice work!
>
> - BW

Coming Real Soon Now...

I plan to add documentation to the library code files and create a usable sample
scene using them as an example.  In the mean time, I can create a version of
this scene with additional object types and I can pervert the surface as well.

-- Chris R


Post a reply to this message

From: Bald Eagle
Subject: Re: Object Placement Rabbit Hole
Date: 1 Aug 2025 11:40:00
Message: <web.688cdf5bcdb862482e86b3cc25979125@news.povray.org>
"Chris R" <car### [at] comcastnet> wrote:
> In the mean time, I can create a version of
> this scene with additional object types and
> I can pervert the surface as well.


This sounds far more exciting than simply perturbing the surface!
Perhaps a saucy image_map?
I can't wait to see what "additional object types" you'll use . . .  ;)

Hopefully the sample scene doesn't perturb anyone too much.  :D

- BW


Post a reply to this message

From: Chris R
Subject: Re: Object Placement Rabbit Hole
Date: 6 Aug 2025 13:45:00
Message: <web.6893945bcdb86248bdf5e0875cc1b6e@news.povray.org>
"Chris R" <car### [at] comcastnet> wrote:
> "Bald Eagle" <cre### [at] netscapenet> wrote:
> > "Chris R" <car### [at] comcastnet> wrote:
> >
> > > I wrote the code based on the letter stacking code in libcollide.inc and
> > > debugged it, and added the grid generation piece to my libmesh.inc library.
> > > Here are the results of repeatedly adding 20 discs to the same uneven surface
> > > using the algorithm.  I think it does pretty well and it's actually quick enough
> > > that you could run it during rendering, but I kept the option to write the
> > > transforms to a file so you can pre-create them.
> >
> > Damn, that is nice.
> >
> > I'm hoping to see a pile of many more primitives on a much more uneven surface!
> >
> > Nice work!
> >
> > - BW
>
> Coming Real Soon Now...
>
> I plan to add documentation to the library code files and create a usable sample
> scene using them as an example.  In the mean time, I can create a version of
> this scene with additional object types and I can pervert the surface as well.
>
> -- Chris R

Documentation, official sample scene, and posting of references to the GitHub
repo for this code are still TBD, but here is another sample after some updates
to the code.

The original author had code that would verify the difference between the 3
found support points and the surface beneath them are within a given threshold.
After staring at the code for a long time, I believe the first two contact
points should always end up directly on the surface, but it's possible the 3rd
one could be off due to the distance estimation from the surface being a linear
projection onto the X-Z plane, but the transformation is a rotation, which means
the final object point gets rotated onto the plane, not projected.

To cover this, the author, for his scene, would check the distance and would
jitter the object a bit if it was too large and then try again.

In my code, the layout only makes one attempt, but I return the 3 resting points
for the object and the surface as part of the transformation result.  In my test
code, I check to see if the max distance is higher than my threshold and do the
jitter of the object there to get a better position.

The results are pretty good, even with the bumpier surface I am using now.
Resting spheres on each other still results in unstable-looking structures,
(unless the spheres are covered with super-glue...)

I will get to work cleaning and documenting and let you know where you can find
the code and how to use it.

-- Chris R


Post a reply to this message


Attachments:
Download 'libcollide_test.png' (193 KB)

Preview of image 'libcollide_test.png'
libcollide_test.png


 

<<< Previous 10 Messages Goto Initial 10 Messages

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