PDA

View Full Version : Shooting the ray



Petr Schreiber
10-03-2007, 10:59
Hi guys,

just reporting I found one interesting feature which could come handy for next TBGL.

It is determining world x,y,z position from mouse x and y.

As you possibly know, I now try to do some simulation environment for robot on university. And as the robot can't see and just shoots rays around to get nearest obstacles, I used this kind of stuff. Nice thing is you must not pass whole geometry to some collision routine, it is something like just request to Z-buffer.
This function could be handy for some collisions and similar stuff, it is just few OpenGL commands I would translate in one.

I have attached 3 second video :) showing how it works. I get coordinate from center of screen and I put sphere on obtained x,y,z position.

Hope to deliver you "live script" soon :)


Bye,
Petr

ErosOlmi
10-03-2007, 12:56
Hi Petr,

3 seconds of power! Next time I need 30 seconds or you will kill me. "Curiosity kills the cat"

Please use latest thinCore.dll from http://community.thinbasic.com/index.php?topic=637.msg3603#msg3603
This will give me any further indication if this version is working ok or still few problems.

Ciao
Eros

Petr Schreiber
10-03-2007, 13:33
Hi Eros,

next time you will get the script :D
I sent you new TBGL with this ability, I will post sample script soon, because especially with mouse it could be base for quite funny game or even serious stuff :)

New core works very nice here !


Bye,
Petr

Michael Hartlef
10-03-2007, 13:38
Bring it in Petr, that is a must to have.

kryton9
10-03-2007, 14:16
Wow, that is ray collision isn't it? It will really add a lot to our toolbox to work with, that is for sure. Great job Petr!!!

Petr Schreiber
10-03-2007, 17:33
Hi guys,

I fel asleep after posting the message :D
Now I am going to do very, very basic sample to manifest use of all new 4 functions, stay tuned - sample will go out today ! :)


Bye,
Petr

P.S. kryton, name of the topic is little bit tricky, you will se it is much easier than shooting a ray ! In some way more limited too.

kryton9
10-03-2007, 21:33
Thanks Petr, I know this will all be very useful and thanks for doing this tough task!!