Any Inbuild Functions to Draw Coordinate Axis?
-
- Kobold
- Posts: 38
- Joined: Thu Mar 01, 2007 10:33 am
Any Inbuild Functions to Draw Coordinate Axis?
Is there some sample code to draw coordinate axises in orge? Any inbuild functions to do that?
I think it would be helpful to have one. What do you think about it?
Best regards,
Chris
-
- Bugbear
- Posts: 806
- Joined: Fri Feb 03, 2006 7:08 am
If that isn't what you're looking for, you can make your own axis in a few lines of code with ManualObject.
Here's how I make axes (this one is 40 units in size):
Code: Select all
mAxis = mSceneMgr->createManualObject("MyAxis");
mAxis->begin( "AxisMaterial", Ogre::RenderOperation::OT_LINE_LIST );
mAxis->position(10,0,0);
mAxis->colour(1,0,0);
mAxis->position(40,0,0);
mAxis->position(0,10,0);
mAxis->colour(0,1,0);
mAxis->position(0,40,0);
mAxis->position(0,0,10);
mAxis->colour(0,0,1);
mAxis->position(0,0,40);
mAxis->end();
Code: Select all
material AxisMaterial
{
technique
{
pass
{
lighting off
ambient 1 1 1
}
}
}
Hope this helps!

-
- Kobold
- Posts: 38
- Joined: Thu Mar 01, 2007 10:33 am
Thank you very much for reply!
However, axis.mesh is not part of my ogre sdk. I use window find utility but cannot find it at all. Can you or someone who see this reply please give me a copy of this mesh (together with material if any)?
My email is HelloGao@hotmail.com
Thanks
Best regards,
Chris
-
- Halfling
- Posts: 79
- Joined: Fri Mar 31, 2006 7:51 pm
- Location: Linz, Austria
-
- Old One
- Posts: 2565
- Joined: Sun Sep 11, 2005 1:04 am
- Location: Paris, France
- x 56
1) it asks for ressources that are in OgreCore.zip, instead of buiding it itself...
2) it don't seem to do anything (at least in OctreeSceneManager ) ;
It seem deprecated.... but it shouldn't...
-
- Halfling
- Posts: 59
- Joined: Sat Jun 25, 2005 12:11 pm
-
- OGRE Expert User
- Posts: 867
- Joined: Fri Oct 01, 2004 9:13 pm
- Location: Carinthia, Austria
- x 1
Browsed the ogre core yesterday (while talking with Klaim) and it seems that PLSM2 implements the function, but none of the basic scenemanagers does.Samir wrote:I'm using Ogre::SceneManager::setDisplaySceneNodes and it works fine for me but I'm using the PagingLandscapeSceneManager.
Might be worth a patch, though I don't know if this function is just thought to be overridden by inheriting scenemanagers, but it seems like it is.
-
- Halfling
- Posts: 59
- Joined: Sat Jun 25, 2005 12:11 pm
Yes, and actually, it used to be buggy in PLSM2 more than a year ago and I was the one that requested it to be fixed, so I guess I made it survive all these yearsstoneCold wrote: it seems that PLSM2 implements the function

That's a shame, it is really useful for debuging rotation and such.stoneCold wrote: but none of the basic scenemanagers does.
You're absolutely right.stoneCold wrote: Might be worth a patch,
I don't think it is, I think I remember using it in other SceneManagers before I switched to PLSM2 (which was more than a year ago)stoneCold wrote: though I don't know if this function is just thought to be overridden by inheriting scenemanagers, but it seems like it is.
-
- Kobold
- Posts: 38
- Joined: Thu Mar 01, 2007 10:33 am
-
- Greenskin
- Posts: 142
- Joined: Tue Dec 13, 2005 11:37 pm
- Location: Lima, Peru
-
- Goblin
- Posts: 260
- Joined: Mon Sep 01, 2003 3:59 am
- Location: London, United Kingdom
- x 1
-
- Gnoblar
- Posts: 4
- Joined: Thu Feb 17, 2022 2:16 pm
Re:
Frenetic wrote: Tue Mar 20, 2007 7:02 amI believe there is an axis.mesh included with Ogre.
If that isn't what you're looking for, you can make your own axis in a few lines of code with ManualObject.
Here's how I make axes (this one is 40 units in size):
Code: Select all
mAxis = mSceneMgr->createManualObject("MyAxis"); mAxis->begin( "AxisMaterial", Ogre::RenderOperation::OT_LINE_LIST ); mAxis->position(10,0,0); mAxis->colour(1,0,0); mAxis->position(40,0,0); mAxis->position(0,10,0); mAxis->colour(0,1,0); mAxis->position(0,40,0); mAxis->position(0,0,10); mAxis->colour(0,0,1); mAxis->position(0,0,40); mAxis->end();
In case you need it, the material script for AxisMaterial:
Code: Select all
material AxisMaterial { technique { pass { lighting off ambient 1 1 1 } } }
Although BaseWhiteNoLighting might work too.
Hope this helps!
hello, this is a long time since you posted this quite interesting answer, well sorry for the post scavanging and may be my english. Well your method to draw axes works well, beside colors... lines stay white... I am currently trying to use this to make xyz grid... but i need colors and i do not understand why it's white. Could you help me, please. If you need some code please feel free to ask
-
- Platinum Sponsor
- Posts: 294
- Joined: Tue Jan 17, 2012 5:18 am
- x 67
Re: Any Inbuild Functions to Draw Coordinate Axis?
have you tried modifying the material color values?