Sep
01-04-2009 02:53:37
I've been struggling with PointStarfields for a while. I can't get the stars to display. What am I doing wrong?
My code:
By the way, a quick suggestion: instead of using the limited set of CaelumSystem::CaelumComponent enumeration values in the CaelumSystem componentsToCreate argument, why not use a bitfield style argument? For example, CAELUM_COMPONENT_CLOUDS = 1, CAELUM_COMPONENT_SUN = 2, CAELUM_COMPONENT_MOON = 4, etc. In the constructor, you can pass CAELUM_COMPONENT_CLOUDS | CAELUM_COMPONENT_SUN to initialize both the clouds and the sun.
My code:
mCaelumSys = new Caelum::CaelumSystem(mRoot, mSceneMgr, Caelum::CaelumSystem::CAELUM_COMPONENT_POINT_STARFIELD);
mCaelumSys->setAutoNotifyCameraChanged(false);
mCaelumSys->getPointStarfield()->addRandomStars(100000);
mCaelumSys->getPointStarfield()->setMag0PixelSize(100);
mCaelumSys->getPointStarfield()->setMinPixelSize(10);
mCaelumSys->getPointStarfield()->setMaxPixelSize(15);
mCaelumSys->getPointStarfield()->addBrightStarCatalogue(100);
mCaelumSys->setJulianDay(2451544.5);
mWindow->addListener(mCaelumSys);
By the way, a quick suggestion: instead of using the limited set of CaelumSystem::CaelumComponent enumeration values in the CaelumSystem componentsToCreate argument, why not use a bitfield style argument? For example, CAELUM_COMPONENT_CLOUDS = 1, CAELUM_COMPONENT_SUN = 2, CAELUM_COMPONENT_MOON = 4, etc. In the constructor, you can pass CAELUM_COMPONENT_CLOUDS | CAELUM_COMPONENT_SUN to initialize both the clouds and the sun.