arnaud houegbelo
2008-02-19 13:18:06 UTC
Hello,
I want to display a HUD without text but with perspective.
I used the code exemple osghud.cpp. Instead of creating
a geode with text I create a geode with a shape like sphere or
box. It woks fine. But I want to display it with a perspective.
When I create the osg::Camera instead of using ortho2D projection
I want to use perspective or frustnum projection.
In osghud.cpp
- camera->setProjectionMatrix(osg::Matrix::ortho2D(0,1280,0,1024));
I tried to use a perspective like
- camera->setProjectionMatrixAsPerspective(50.0, 1.0, 1.0, 1000.0); or
- camera->setProjectionMatrix(osg::Matrix::perspective(50.0,aspectRatio,1.0,1000.0));
but my object disapear.
It is possible to display an object like HUD (on the front of the scene) with perspective?
Best regards
Arnaud
____________________________________________________________________________________
Looking for last minute shopping deals?
Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping
I want to display a HUD without text but with perspective.
I used the code exemple osghud.cpp. Instead of creating
a geode with text I create a geode with a shape like sphere or
box. It woks fine. But I want to display it with a perspective.
When I create the osg::Camera instead of using ortho2D projection
I want to use perspective or frustnum projection.
In osghud.cpp
- camera->setProjectionMatrix(osg::Matrix::ortho2D(0,1280,0,1024));
I tried to use a perspective like
- camera->setProjectionMatrixAsPerspective(50.0, 1.0, 1.0, 1000.0); or
- camera->setProjectionMatrix(osg::Matrix::perspective(50.0,aspectRatio,1.0,1000.0));
but my object disapear.
It is possible to display an object like HUD (on the front of the scene) with perspective?
Best regards
Arnaud
____________________________________________________________________________________
Looking for last minute shopping deals?
Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping