Is possible to do picking 3D with ogreode?

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
sargar
Gnoblar
Posts: 20
Joined: Sun Jan 23, 2005 12:36 am

Is possible to do picking 3D with ogreode?

Post by sargar »

Hello,

I need urgent aid with ogreode and picking 3d. I have read everything what I have been able, but nonencounter answers :evil: .

In my application, I have objects in ogreode, for example those of an example of demonstration of ogreode, and I have coordinates x, y, z and the radius of a control ball.

This sphere is the indicator of control of a laser system in the real world, and the objects in the world are objects of the real world.

The problem: how to find out that the sphere can take an object with ogreode? It is possible? That properties must have the sphere so that does not bother to the objects of the scene?

If I puts values to him of density, mass.... to the sphere, when it happens over an object modifies it, moves it, and I do not look for that, all the opposite: the sphere must cross the objects without modifying them. :shock:

But if I do not put characteristics of ogreode to the sphere, masses or similar, I cannot detect collisions. And if I detect them, the contact object moves, or changes its position, or the control ball moves, things that I do not look for.

At the moment, I am implementing the algorithm of distances between center of the sphere and the center of the object, but I think that ogreode would have of being able to solve this, but I do not know how to do it.

Possibly this already has been solved, but I have looked for in the forum (including ogreode thread), and I have not found it :oops: . Please, if somebody has seen it, that it says to me where.

Any aid will be welcome ;).

Thanks in advance
User avatar
IoN_PuLse
Goblin
Posts: 220
Joined: Mon May 31, 2004 5:54 am
Location: Canada

Post by IoN_PuLse »

You couldn't find this?

Have you experimented at all? I believe with OgreODE you can set up your own behavior when two objects touch eachother - so they don't have to bounce or react in a physical manner.
qsilver
OGRE Community Helper
OGRE Community Helper
Posts: 198
Joined: Sat Oct 02, 2004 9:11 am
Location: San Francisco, California, USA

Post by qsilver »

If you do not want real physics behavior, but you just want 3D picking, use the OPCODE collision library instead of ODE. OPCODE simply tells you what the collisions are, and does not require physics body properies.

Check out OgreOpcode in the CVS adons for an example of using OPCODE.
sargar
Gnoblar
Posts: 20
Joined: Sun Jan 23, 2005 12:36 am

Post by sargar »

Hello IoN_PuLse,

Thanks to answer ;).

Yes that I have read it, but I do not have the mouse coordinates or of screen x, y, I have the real coordinates in scene x, y, z. I think that I would have of being easier, but I do not know how to do it :oops: .

I imagine that it is possible to be obtained that two objects in a ogrenode system give collisions and they do not interactuen among them, but I do not know how to do it. :evil:

He is what I ask, how to do it. :twisted:
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66

Post by sinbad »

So just use a different ray. The ray in the example is used for firing a ray our of the screen, if you want to fire it in some other direction, go ahead. Just set up the Ray you pass to the RaySceneQuery differently. It ain't rocket science ;)