Determining what is on screen

Started by
4 comments, last by JoHnOnIzEr 20 years, 8 months ago
Currently, each object has a rect for collision and stuff and im checking if that rect is contained within the screen rect(what the camera is looking at). Is this a good way to go about doing this or is there a better one? Im using VB :-/
Sidra Headquarters
Game engine is currently at version 0.9.8! Currently Down
Advertisement
You mean frustum culling ( http://www.google.com/search?q=frustum+culling )? That''s a good way to do it.

Now, if you''re talking about many, many objects, you might want to also include some sort of tree culling (like BSP) before doing frustum tests. Checking EVERY object against the frustum would get slow after a while.
Ack, i forgot to say the game was 2d and that looks like its for 3d.
Sidra Headquarters
Game engine is currently at version 0.9.8! Currently Down
Do you mean that you are using isometric view?
Are you using DirectDraw or Direct3D

---------------------------------------------
If God with me, Who against me?
Sitio de desarrollo de videojuegos en español
Digital Moon Studio...

There is no spoon
--------------------------------------------- If God with me, Who against me?Personal Web Samuel Prince Blog...
D''oh - sorry, my bad, should''ve been tipped off by "rect" instead of "cube".

Yeah, checking the screen rect / world offset versus your object rect is about as quick and straightforward as I can imagine.

Robin
A quadtree could still be useful for culling lots of stationary stuff.
.

This topic is closed to new replies.

Advertisement