Scene graph in, lights out. Hmm....
Daily 09/15/03
Left-handed or Right-handed. That is the question. Cari and I had a discussion today about the merits of each system. What do you think? I prefer the right handed system. Here's why:
- It's more natural.
All through high school, I've been taught that up is up. All through college, elevation has always been in the positive Z direction. - Our modeling software uses a right handed coordinate system.
This is a weak argument because the exporting software we use has a left handed option.
Boy, there seemed like stronger arguments earlier this morning. Oh well.
Quick and dirty scene graph. I started modifying our code to use a scene graph. Because of the speed at which I need to get an implementation, I've decided to overlay the interface onto our existing objects. Here are the interfaces.
| struct ISceneNode { // Node name virtual const char* GetName() const = 0; // Updating virtual HRESULT Update(float fElapsedSeconds) = 0; // Rendering virtual HRESULT PreRender(PScene pScene) = 0; virtual HRESULT Render(PScene pScene) = 0; virtual HRESULT PostRender(PScene pScene) = 0; // Adding/Searching/Removing virtual HRESULT AddChild(PSceneNode pNode) = 0; virtual HRESULT RemoveChild(PSceneNode pNode) = 0; virtual HRESULT AddSibling(PSceneNode pNode) = 0; virtual HRESULT RemoveSibling(PSceneNode pNode) = 0; virtual PSceneNode FindNode(const char* pName) = 0; virtual PSceneNode GetSibling() const = 0; virtual PSceneNode GetChild() const = 0; // Destruction virtual void Destroy() = 0; }; struct IScene { // Updating virtual HRESULT Update(float fElapsedSeconds)= 0; // Rendering virtual HRESULT Render(LPDIRECT3DDEVICE9 pDevice)= 0; // DX specific virtual LPDIRECT3DDEVICE9 GetDevice() const = 0; }; |
OK, I learned something new today about the project. Here's the current
object topological graph:
StarMap is a list of TileMaps. Each TileMap contains a list of objects. Also,
the planets are in a different list and the ships are in the tilemap.
I got all the stuff modified, then turned it on. It worked!!! Slight problem though, the lights weren't working. Had to spend some time
figuring that out ![]()
Ok, I spent all afternoon trying to figure out what's busted with the lighting. There's something severely wrong there. If I draw the planets after I draw the ships, then the lighting works great. Otherwise, it doesn't. What's up with those ships? I'll try to solve this mystery tonight.
Other than that, the scene graph seems to work fine. I'll try to mock up some
rings tonight too ![]()