Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Gaming > Development Programming Misc > Re: Sorting bou...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 9 Topic 956 of 1011
Post > Topic >>

Re: Sorting bounding boxes back to front

by "Jim Langston" <tazmaster@[EMAIL PROTECTED] > Nov 2, 2007 at 02:47 AM

"Ron AF Greve" <ron@[EMAIL PROTECTED]
> wrote in message 
news:472a6ef0$0$233$e4fe514c@[EMAIL PROTECTED]
> Hi,
>
> I have been developing my game engine for a few years now and the last
few 
> months decided to go from a 2D engine to a 2.5D one (actually 3D but I 
> think I leave the camera at fixed points so I can mix 2D and 3D 
> together).I can currently ex****t meshes and bone animations (a single 
> vertice can be affected by different bones) as wel as pure object 
> animations (just moving the object itself) from blender and display it
in 
> my engine.
>
> Now I just render anything and let the z-buffer do the work (ok not very

> optimal yet :-)  ). However I also would like to render animations of 
> glass objects so I should be able to sort them back to front in
realtime.
>
> Now for the question:
> Assuming a bounding box that never intersects does anyone know of a good

> algorithm to sort the transparent objects back to forth?
>
> I was thinking of first calculating the projection of bounding box1 and 
> box2 to see if they overlap then if they do shoot a ray through all the
16 
> vertices to see if they hit one of the planes of the other (projected) 
> box. (One of the boxes might be smaller then the other one so I figure
you 
> need to do it for both boxes),
> If they do I could see which one further away by calculating the 
> intersection of the ray and the vertice and the ray and the plane of the

> other box. but it seems like a lot of calculations so maybe anyone knows

> of a smarter algorithm?

If you have the bounding boxes for all the objects, you simply have to
sort 
on the smallest z of each bounding box (closest forward to the camera). 
This shouldn't be a much of a problem at all and should be fairly math
easy.
 




 9 Posts in Topic:
Sorting bounding boxes back to front
"Ron AF Greve"   2007-11-02 01:27:28 
Re: Sorting bounding boxes back to front
"Jim Langston"   2007-11-02 02:47:54 
Re: Sorting bounding boxes back to front
"Ron AF Greve"   2007-11-02 12:40:08 
Re: Sorting bounding boxes back to front
Miss Elaine Eos <Misc@  2007-11-02 15:12:49 
Re: Sorting bounding boxes back to front
"Ron AF Greve"   2007-11-02 16:37:58 
Re: Sorting bounding boxes back to front
"Jim Langston"   2007-11-02 09:28:48 
Re: Sorting bounding boxes back to front
"Ron AF Greve"   2007-11-02 23:40:27 
Re: Sorting bounding boxes back to front
Richard James <IWillGe  2007-11-03 08:59:03 
Re: Sorting bounding boxes back to front
"Ron AF Greve"   2007-11-03 00:23:03 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Jul 26 2:02:15 CDT 2008.