1 Attachment(s)
Early black box preview of ray-mesh collisions
Dear all,
as you know I am writing library, which would allow us to cast rays against various objects.
The release date is somewhere in fog :), but to not torture you too much I attach executable of my thinBasic script using the early library.
Hope you will like it. What I must work on now is speed speed speed.
Current performance is like 1 ray colliding with 1 200 000 polygons takes second to calculate.
That is far from ideal, as it means about 20 000 polygons to get 60FPS ... and that is for one ray.
But I still have lot of space for optimization, don't worry :)
Hope the demo will entertain you.
Petr
1 Attachment(s)
Re: Early black box preview of ray-mesh collisions
All seems working fine here.
What is this application doing in reality? You know, I'm quite bad in understanding all those 3D complexities.
Ciao
Eros
Re: Early black box preview of ray-mesh collisions
Hi Eros,
- set of triangles ( 3d object ) is passed to module
- I create random rays around the object, pointing to 0,0,0
- I put point at intersection of ray and the object
That is all :) You can simply cast a ray on mesh and ask for distance or point of collision.
I should have explained better in first post, I am now half alive, half sleeping :)
Petr
Re: Early black box preview of ray-mesh collisions
:o now I got it.
It is like a a laser hitting a surface and at the intersection point you see the light.
Re: Early black box preview of ray-mesh collisions
Nice one. Its a dino but I don't know it's name. :)
Re: Early black box preview of ray-mesh collisions
Yes Eros,
exactly :)
Mike, it is triceratops, but that is not important :)
Good thing is I got it working, now I have to add the boxes and some nice external interface.
I started to design module in different way, less hacky, more maintainable ... but still fast.
The speed problem is not caused by the general design but by the function itself.
Once I get ray-box working, I will organize triangle groups in sub spaces, first test for box hit and then for triangles only when needed.
Petr
Re: Early black box preview of ray-mesh collisions
Hey Petr, thanks a great start!
About your idea for sub spaces, would that be octrees that I keep reading about?
Re: Early black box preview of ray-mesh collisions
Re: Early black box preview of ray-mesh collisions
Hi Michael,
thanks for those links, I will check them in more depth.
Some of them have fantastic results, but they need quite modern hardware and are GPU based.
I will do classic safe CPU routines first, and then jump for this.
The cow is nice :)
Kent, I will try to do octree, as long is it will not be slowing down the calculation :) But I was thinking of it. Must do some tests.
Petr