Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views


Sign in to follow this  
Stephen R


I figured out what was wrong with my quad-tree thismorning. I really was extremely stupid. I mixed up a "2 multiplied by levels" with a "2 to the power of levels". So I can now create and render a quad-tree with as many levels as I want. I haven't tested the rendering speed yet. Once I get most of the major features in I will start optimizing the renderer, not before. I have pre-maturely optimized apps before only to find that I needed to make room for something. THat is never fun. I also don't particularly care if it is not perfectly optimized. As long as it runs at reasonable speeds on most machines, I'll be happy. This game is mostly just to aquaint myself with the techniques used in 3D programming.

I didn't implement the textured verts today. They aren't that difficult to implement, especially since it is just one texture mapped over the whole quad tree. Instead I got to work on figuring out what vertex lies beneath the cursor. I'm using D3DXVec3Unproject to do most of the work for me. I retrieve the mouse coordinates and place them in a vector with a z value of 0. I pass it into the function and it returns a point along the ray I want to check. I set the z value to 1 and put it into the function again. I now basically have all I need to construct my ray - just a bit of subtraction, normalization, and adding and I have it. I have checked all the result from these functions against what they should be and they are resonably accurate. Now I have to check to see if the ray passes through the box containing a quad-tree node. That is where my troubles actually begin. I have been using the formulae out of "Mathematics for 3D Game Programming & Computer Graphis". They are almost deffinately correct, I'm just having trouble implementing them. Hopefull I'l have it working by the end of tomorrow.

The final playtest of Raw takes place tomorrow at 2pm (just incase you're interested [smile]). I will take whatever advise is given tomorrow, pass it through my "too much work - too little payoff" filter, update my game and post it on Sunday, hopefully. I am beginning to worry that they will think that its dull, but I always feel the exact same way when I'm about to show anybody anything I've coded/written/drawn. Anyway I'm happy with work on Sheep Pie, and the people I've explained the game concept too say it sounds like it will be fun. So even if Raw fails horribly I can just fall back on it.
Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!