POV-Ray : Newsgroups : povray.newusers : Collision Detection : Re: Collision Detection Server Time
2 Nov 2024 17:21:19 EDT (-0400)
  Re: Collision Detection  
From: Warp
Date: 30 Oct 2003 09:44:18
Message: <3fa123c2@news.povray.org>
Marc Jacquier <jac### [at] wanadoofr> wrote:
> Have a look at section 6.1.4.6 of the documentation
> the trace() function could help you.
> I suggest you to add your objects in a union and call trace to scan the
> place where you want to add the next one.

  Once again: trace() (or inside()) will help you putting *points* in
the scene so that they will not be inside any object. There's no easy way
of putting freely-shaped objects in the scene so that they will not intersect
with any other object.
  General collision detection is a quite complicated problem, not easily
solvable by using trace() or inside(). (You can make approximations by
sampling points on the surface and inside the object you want to place in
the scene and looking at each of these points if it's inside of any other
object in the scene, but besides this getting slow it doesn't guarantee
a 100% success.)

  One approximation is easy, though. If it's enough that objects are
bounded by an imaginary sphere (so that the object is completely inside
this sphere) you can place objects in the scene so that no object is
closer to another object than the radius of this sphere. In this case
you only need to compare the distances between the centers of these
imaginary spheres and place objects only when the distance to all the
other centers is larger than the radius (#if(vlength(Center1-Center2)>Radius)).

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

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