nicholaschan.net :D

31Aug/090

Windows 7 Solutions

There's bound to be some problems with people using Windows 7. I've started up a quick blog on it, go check it out at http://www.windows7solutions.com

Filed under: blog No Comments
14Aug/090

Flickering/tearing graphics solved.

There's a reason why we learned about Depth Sorting in Computer Graphics class and that is to solve this visual tearing. When you have multiple transparent objects being rendered over one another, you need to draw them from the back to the front (farthest to closest to the camera). That way, they will blend nicely. I'm currently making a parent object "genericDraw" as an array and attaching all the addresses of objects that need drawing. Then write a method to return the center of the object, and do a quicksort based on distance from the camera.

Filed under: eyght No Comments
5Aug/090

Frustum

The problem with my game at the moment seems to be the culling objects from the scene. For example, I have a cube which players can shoot at to destroy. The cube has a targeting area for players to lock on. My game draws a small 10x10 pixel rectangle around the targeting area. To do this, I have to convert the 3D targeting point into a 2D point on the screen in which the game engine will draw the rectangle around. I do this by using the glProject method which does exactly that. The problem however is that when the cube object goes off screen, even behind you, the glProject still returns a 2D value on screen. So when the cube goes behind the player, the game engine still draws a rectangle around some point on screen. To fix this, I need to implement some culling system.
I'm still figuring out how am I going to implement the glFrustum method. So far I only know it's purpose which is to set the clipping area of the scene to render only what is in sight. After a quick glance over a tutorial, the method does seem a bit limiting. The implementation requires a different function for each set of custom primitives, such as a sphere. The tutorial goes over how to implement a culling system specifically for spheres. That brings up quite a few questions. What if the sphere isn't perfectly round, such as morphing a sphere to be thinner? Does this mean I would need a new function for every new visual object I bring into the scene? How much overhead will this system create? Would it be better for me to simply have timers for each object and remove them once they have passed the player's camera?

Filed under: eyght No Comments

My Sites

Nick’s Tweets

Posts