Skip to main content
gamedev.net
🔒 Locked

Fov inside Quad Node

Started by MetaKnight Nov 6, 2004 at 11:11 PM 5 replies 850+ views
Original Post
MetaKnight
MetaKnight
Hi, the problem is that my whole FOV is inside the quad node, here's a picture of what it looks like:

====================
|        |          |
|        |          |
|________|__________|
|        |    ()    |
|        |   /  \   |
|        |  /____\  |
=====================

So right now I am only doing point testing on the corners of the Quad, so what can I add to include this circumstane? Rather then just skiping testing on the first level of quads? Thank you
Ademan555
Ademan555
yes, you should be checking for that case, i too, am implementing fustrum culling... thats a case ive been trying to figure out... i guess the simplest (and i dont believe entirely correct) way is just if their ALL "in front" of the planes... then the fustrum is inside the node... but im not sure if that works entirely... :-/

ill get back to you when ive thought it out better

-Dan
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out hi
Promit
Promit
Check the Flipcode frustum culling tutorial. I'm quite certain their box-frustum code handles that case.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
doublepoison
doublepoison
I first rotate the quad's points to cam/frustrum space, and find the max and min values. I then do a basic pythagoras furstrum test (links anyone?) on those points:

for( ... /*all quad corner points*/ ){	//get Maximum and Min vals.	//...	//Test that the points are in camera range.	//...	//Test points are fully/partialy in camera range.	if(		( maxPx.x <   ( maxPx.z * tan(fov_angle) ) )		&&	( minPx.x >  -( minPx.z * tan(fov_angle) ) )		&&	( minPz.z >  0 )		&&	( maxPz.z <  maxFz ) )	{ 		return COMPLETELY_IN_FRUSTRUM;	}	else	{		return PARTIALY_IN_FRUSTRUM;	}}//end for


That was done a couple of years ago, I'd probably do it differently now, given that the multiple tan operations occuring every quad test.
double.
Ademan555
Ademan555
Hrm, well im looking at gametutorial's right now... and it seems that they normalize their planes, im wondering if that somehow makes it work (though i would have expected it to make it worse by shrinking the fustrum (unless of course the fustrum is a bit small to begin with) ) im having trouble going to flipcode at the moment... (though i had been staring at their tut for a few hours last night) i dont remember handing that case... but then again... it was rather late when i was staring at it...
thanks
-Dan
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out hi

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.