![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Hi, has anyone got any general advice/links/macros/whatever on collision
detection in POV?
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <387f2261@news.povray.org>, "Tom Melly"
<tom### [at] tomandlu force9 co uk> wrote:
> Hi, has anyone got any general advice/links/macros/whatever on collision
> detection in POV?
What do you want to detect collisions of? If it is simply two spheres,
use something like
#if(vlength(CenterA - CenterB)<(RadiusA + RadiusB))
// spheres are colliding
#else
// spheres are not colliding
#end
The math is pretty simple for many other objects. I don't know of any
macros for this.
--
Chris Huff
e-mail: chr### [at] yahoo com
Web page: http://chrishuff.dhs.org/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Chris Huff <chr### [at] yahoo com> wrote in message
news:chrishuff_99-43AE9F.09560714012000@news.povray.org...
> In article <387f2261@news.povray.org>, "Tom Melly"
> <tom### [at] tomandlu force9 co uk> wrote:
>
> What do you want to detect collisions of? If it is simply two spheres,
> use something like
> #if(vlength(CenterA - CenterB)<(RadiusA + RadiusB))
> // spheres are colliding
> #else
> // spheres are not colliding
> #end
>
> The math is pretty simple for many other objects. I don't know of any
> macros for this.
>
hmm, I was more thinking of, for example, being able to place random rocks
on the surface of a heightfield by detecting when you'd hit the y value of
the hf at a particular x and z location.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <387f44f4@news.povray.org>, "Tom Melly"
<tom### [at] tomandlu force9 co uk> wrote:
> hmm, I was more thinking of, for example, being able to place random rocks
> on the surface of a heightfield by detecting when you'd hit the y value of
> the hf at a particular x and z location.
For that, you need a patched version of POV that has the trace()
function. This function lets you trace rays within the scene file, so
you can just trace a ray straight down from the rocks xz location to get
the right y distance. MegaPOV has this function.
http://nathan.kopp.com/patched.htm
The only other way I know of would be to use an external program to get
the color values and calculate the correct height at each point by hand.
--
Chris Huff
e-mail: chr### [at] yahoo com
Web page: http://chrishuff.dhs.org/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
>The only other way I know of would be to use an external program to get
>the color values and calculate the correct height at each point by hand.
You can also use hf_height_at.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <387f5a27@news.povray.org>, "TonyB"
<ben### [at] panama phoenix net> wrote:
> You can also use hf_height_at.
You could, I think that patch was also included in MegaPOV. But it seems
to just be redundant to me, and nowhere near as versatile/flexible as
trace().
With trace(), you can easily set up your placement algorithm, and if you
decide you want to have a box embedded into your height field, you could
just use a union of the box and height field. With hf_height_at, you
would have to manually check for intersection with the box, and would
probably end up using trace() anyway. And if you decide to use an
isosurface instead of a height field, hf_height_at is useless.
Also, trace() can give the normal of a surface, which can be useful in
the realistic placement of objects.
But you are right, I had forgotten about that patch, and it can be used
if you are only using a height field and if you know you will always be
using a height field.
--
Chris Huff
e-mail: chr### [at] yahoo com
Web page: http://chrishuff.dhs.org/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
There's some info here, I'm not sure how much use it will be to you
though.
http://freespace.virgin.net/hugo.elias/
--
Phil
...coffee?...yes please! extra sugar,extra cream...Thank you.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On Fri, 14 Jan 2000 13:19:24 -0000, "Tom Melly"
<tom### [at] tomandlu force9 co uk> wrote:
>Hi, has anyone got any general advice/links/macros/whatever on collision
>detection in POV?
It's a rather complex task and it does not have an unique non-discrete
solution. While you could work out methods for simple primitives
(spheres, planes and boxes come to mind), general objects will require
some means of tesselation. One way which pops up into my poor
insomnia-mutilated brain is to trace a bunch of rays (say a hundred)
using, for example, Nathan's jittered spiral method, save those in an
array, and then check them against the bounds of another object. This
will be useful for the rocks-on-a-height-field case you seem to be
most interested in. Of course at least one of the objects has to have
a simple insideness test (like most primatives do).
Detecting collision of two meshes (with the face- and vertex indices
known) is another thing. It is no new thing as it's done in many
commercial packages, one just has to look around and find it. Ken's
links on povray.org whould be a good starter.
Peter Popov
pet### [at] usa net
ICQ: 15002700
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Tom Melly wrote:
>
> Hi, has anyone got any general advice/links/macros/whatever on collision
> detection in POV?
Check out "proxima", from Purdue, which is a C++ library for 3D
collision detection for arbitrary polyhedra. It's a nice system;
the algorithms are sophisticated, but the code is of modest size.
ftp://ftp.cs.purdue.edu/pub/pse/PROX/prox9.1.tar.Z
For information about the I_COLLIDE 3D collision detection system
http://www.cs.unc.edu/~geom/I_COLLIDE.html
"Fast Collision Detection of Moving Convex Polyhedra", Rich Rabbitz,
Graphics Gems IV, pages 83-109, includes source in C.
SOLID: "a library for collision detection of three-dimensional
objects undergoing rigid motion and deformation. SOLID is designed to
be used in interactive 3D graphics applications, and is especially
suited for collision detection of objects and worlds described in VRML.
Written in standard C++, compiles under GNU g++ version 2.8.1 and
Visual C++ 5.0." See: http://www.win.tue.nl/cs/tt/gino/solid/
--
Ken Tyler - 1300+ Povray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Many thanks for all the advice - I've gone for the megaPov and be damned
with it.
Trace and bounds will probably do it - I just want to scatter some pebbles
on a hf beach.
--
Tom Melly
tom### [at] tomandlu force9 co uk
http://www.tomandlu.force9.co.uk
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |