Getting color of mesh at a given surface point

pgoeleven

14-11-2008 21:56:02

Hi,

I need to be able to tell the color of a mesh at a certain point of its surface.

The point on the surface is determined by ray cast operations. I know you get u,v coordinates and triangle index etc (and also material, but that is a physx material afaik).

I don't know however, how this data, which is from NxOgre maps to Ogre itself and how exactly I get the color of the material (either with or without texture).

Any help is greatly appreciated.

nargil

14-11-2008 22:14:04

Nx raycast won't ray exactly on a surface unless you're using triangle meshes. Maybe use OPCODE or MOC for that. Or even use a compositor shader.

pgoeleven

14-11-2008 23:06:03

Could you elaborate on your reply? What is OPCODE or MOC?

Is there a way to get the Ogre SceneNode from a NxOgre Body? I could use that in th mean time, or as an approximation if this isn't possible with PhysX.

betajaen

14-11-2008 23:11:32

If it's visual then it'll have to be Ogre. You'll even probably have to use an Ogre Ray.

nargil

14-11-2008 23:40:58

These are libraries, which perform accurate raycasting directly in ogre (without physx library - they operate on triangles). Get opcode from here:
http://www.ogre3d.org/index.php?option= ... Itemid=141

or moc from here http://www.ogre3d.org/phpBB2/viewtopic.php?t=45267

mcaden

15-11-2008 02:37:24

Ogre already has Rays. Use an Ogre ray instead of a NxOgre array. Ogre deals with visual meshes, NxOgre deals with physics. Color isn't related to physics at all.