|
 |
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
|
 |
|
 |
"Bald Eagle" <cre### [at] netscape net> wrote:
> "Chris R" <car### [at] comcast net> 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
|
 |
|
 |
"Chris R" <car### [at] comcast net> wrote:
> "Bald Eagle" <cre### [at] netscape net> wrote:
> > "Chris R" <car### [at] comcast net> 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'

|
 |