Hi Jaime,
I'm replying on the mailing list. Please keep all replies on the list as
then other people can answer as well...
Hi there, I'd like to lable the planets, how can I do this?
You've been looking at using osgText::Text, that's the way to do it. You
position your text at the same position as the planet, with a small
offset so the text isn't inside the planet (you wouldn't see it then).
Or you place your Text's Geode as child of the same MatrixTransform as
you use to position the planet itself.
Have a look at the osgtext example in the OSG sources for more details.
Also, do you know how I can do the other 4 questions I've asked, I wasn't fiven
a choise about doing openGL or not, I'm going to quit the course, but I need to
present this tomorrow .
Here are the questions:
1. I can't get textures working to make the circles look like the 9 planets,
how do I do this?
The way you're adding the texture (I looked at the code for Mars.jpg)
seems ok, but do you check the pointer you get back from
osgDB::readImageFile() to make sure it read the image? Perhaps it didn't
find the osgdb_jpeg.dll plugin that it needs to read it.
You could also increase the notify level
(osg::setNotifyLevel(osg::DEBUG_FP) or set an environment variable
OSG_NOTIFY_LEVEL=DEBUG) to see if it finds and loads your image file.
2. How can I get 5 planets to go the way they're going now, and 4 planets to go
the other way?
Change the direction of the rotation... I'm not sure I understand your
question. You're setting positions in a MatrixTransform, just set a
different position for some objects and they'll be at different places.
3. How can I add names to make the planets.
I assume you're talking about labels, I answered above.
4. How can I do a space like background, not just the blue one I have now?
The blue comes from the camera's clear color.
viewer->getCamera()->setClearColor(osg::Vec4(0,0,0,1)); will get you a
black background instead.
Then to add stars you could create random points in a sphere around the
observer, or something like that. Look at the osggeometry example in the
OSG sources for how to create points in OSG.
I understand you're in a rush, but I can't just give you code for
everything you ask. You'll have to do the work yourself, even if you say
you're going to be dropping out of the class...
Hope this helps,
J-S
--
______________________________________________________
Jean-Sebastien Guay [email protected]
http://www.cm-labs.com/
http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org