Skip to main content
gamedev.net
🔒 Locked

Octree

Started by SKSlayer Jan 18, 2001 at 2:18 PM 11 replies 850+ views
Original Post
SKSlayer
SKSlayer
I am making an octree ... What is supposed to happend to the polys that are between 2 cubes ???
(you can find me on IRC : #opengl on undernet)
SKSlayer
SKSlayer
including it in both seems best to me
(you can find me on IRC : #opengl on undernet)
Toom
Toom
Or search Google for "loose octree"

Toom
SirKnight
SirKnight
The book "Game Programming Gems" has a great artcile on octtrees and loose octrees. The book goes in more detail about the loose trees. It even has the source on the cd. It may be an expensive book, but you will not regret it.

-SirKnight
acw83
acw83
Hm, cut the triangle in half. Whichever leaf node pleads that you don''t destroy the triangle and would rather the other leaf node have it is the rightful owner. It worked in the bible. Seriously, you can cut it in half if it crosses a boundary. Say though it actually is on the boundary... Well then you ened a precendence. Say for all polys on a boundary they go automatically to either the northern or eastern box. Hope this helps.
SKSlayer
SKSlayer
quote:

... Well then you ened a precendence. Say for all polys on a boundary they go automatically to either the northern or eastern box.


That wouldn't be good, cuz, if they belong to the box, but are not whithin it, the poly might be visible, but not the box, then that poly could not show


About cutting it ...
It would have to be split in 3. Would make 3 polys to render
if I include it in both, I would only have 2
(As I am only unsing triangles)



Edited by - SKSlayer on January 21, 2001 6:09:54 AM
(you can find me on IRC : #opengl on undernet)
manutd
manutd
Spliting would be better I think because you don''t have to worry about drawing the triangle twice.

go to glvelocity and look at tim''s source or tutorial
vansweej
vansweej
> Spliting would be better I think because you don''t have to > worry about drawing the triangle twice.

> go to glvelocity and look at tim''s source or tutorial

Tim''s tutorial will explain to you NOT to split :-)







zedzeek
zedzeek
u dont draw the triangle twice.
just mark it as ''to be rendered'' + if u come across that tri again and the ''to be rendered'' flag is set dont add it again to your list of tris to be rendered. hmmm

DONT SPLIT

take the more common case ''both nodes are visable'' if u have split the tri then u have to draw 2 triangles instead of just one.
in the lesser common case of ''only one of the nodes being visable'' if u split u draw one if u dont split u still draw one.

remember the driver does the cliiping for u

http://members.xoom.com/myBollux
Scarab0
Scarab0
Oh and don''t forget to reset the flags again when you''re rendering.
Dirk =[Scarab]= Gerrits
SKSlayer
SKSlayer
So, I''ll have to add a flag for every poly which says to be rendered or not
(you can find me on IRC : #opengl on undernet)
manutd
manutd
I didn''t say ne thing about tim saying not to split, it is just my personal preference to split...
You should see his landscape engine tho wow...
I get an error about tring to load the texture data... ne 1 else

Topic Locked

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

Sign in to reply to this topic.