I've been working with a few different engines alongside trying to code my own project. Rather than rewrite an entire renderer, etc I am using Ogre3d. To begin with I am trying to implement a very basic scene with day/night cycle.
I've created a plane, added a simple model over the plane to simulate ground and an object. I've also created a directional light which I rotate to simulate a moving sun.
// Add a sunlight sunNode = OgreFramework::getSingletonPtr()->m_pSceneMgr->getRootSceneNode()->createChildSceneNode("sunNode"); sunNode->setPosition(0,0,0); sun = OgreFramework::getSingletonPtr()->m_pSceneMgr->createLight("Sun"); sun->setPosition(0,0,0); sun->setType(Ogre::Light::LT_DIRECTIONAL); sun->setDiffuseColour(Ogre::ColourValue(0.7f,0.7f,0.7f)); sun->setSpecularColour(Ogre::ColourValue(0.7f,0.7f,0.7f)); sun->setDirection(Ogre::Vector3(0,0,1)); sunNode->attachObject(sun);
In the main loop, prior to rendering I rotate the sunNode with :
// Rotate the sun sunNode->pitch(Ogre::Degree(0.05), Ogre::Node::TS_LOCAL);
This all works pretty much like a expected. However, I then moved onto adding a billboard to the sunNode in order to render the sun moving through the sky. Creating the billboardset, setting the texture, adding a billboard and attaching it to the sunNode, was pretty straight forward, however, when I compiled and ran the application, the billboard just sat at the lights position (0,0,0) and didn't move.
What would be involved in getting a billboard to track through the sky to render a simple sun?