3D Overlay Example

Problems building or running the engine, queries about how to use features etc.
Post Reply
cgeorge
Gnoblar
Posts: 2
Joined: Tue Jan 16, 2007 11:47 pm

3D Overlay Example

Post by cgeorge »

I've looked everywhere for a working example of attaching 3d objects to an overlay. Reading the documentation for overlay.add3D(...) makes it seem easy, but the object isn't visible and I'm not sure where to go next.

I'm using PyOgre but C++ examples have always been good enough to get things working in python.

node = self.sceneManager.createSceneNode("tube")
ent = some_function_to_create_entity(...)
node.attachObject(ent)

overlay.add3D(node)

should I have to do something else? I know the documentation says to create a SceneNode manually, but it doesn't say HOW to do this. The constructors all look like they are for internal use by the SceneManager.

also what dimensions and positions should a 3d object attached to the overlay be using?
User avatar
hmoraldo
OGRE Expert User
OGRE Expert User
Posts: 517
Joined: Tue Mar 07, 2006 11:22 pm
Location: Buenos Aires, Argentina
x 1
Contact:

Post by hmoraldo »

No, no no, you need to create overlay objects to do that, not scene manager's nodes and entities. Check the site documentation and tutorials to see how it's done.
H. Hernan Moraldo
Personal website
gxsheng
Greenskin
Posts: 148
Joined: Tue Jan 16, 2007 3:48 pm

Post by gxsheng »

ha,that's the problem I just solved with xavier'help.
Overlay doesn't work.If you attach a mesh to an overlay,the mesh is not able to transformed anymore.
You should use Movable::setRenderQueueGroup(RENDER_QUEUE_OVERLAY).And asign a material contain "depth_check off" to the mesh.
Now ,it is guaranteed that the mesh is rendered latter than any other mesh,and Z-BUFFER test is shut down when rendering it.
Enjoy it!
http://www.ogre3d.org/phpBB2/viewtopic.php?t=27902
M
Gremlin
Posts: 198
Joined: Mon May 23, 2005 4:40 pm
Location: Spain

Post by M »

Well, I have used 3D entities with overlays in the past without problems, including transformations. Lighting and depth checking will be disabled for those entities. and scenenodes must be created manually and not using scenemanager, as you have noticed:

Code: Select all

SceneNode* node = new SceneNode(0);
cgeorge
Gnoblar
Posts: 2
Joined: Tue Jan 16, 2007 11:47 pm

Post by cgeorge »

gxsheng,
Thanks for the info. I'd seen your other post on the topic before but could get it to work for myself. Changing the material worked like a champ though. Also attaching the "top level" objects to the node the camera is attached to ensures that the new 3d overlay is always in the same position. Which is exactly what I was looking for.

Thanks alot.
davidm2
Gnoblar
Posts: 5
Joined: Wed Oct 23, 2019 10:34 pm
x 1

Re: 3D Overlay Example

Post by davidm2 »

Add3D works if you understand that your SceneNode is added to a root node for the overlay. The root node is positioned at the camera and oriented in the camera direction.
Post Reply