Skip to main content
gamedev.net
🔒 Locked

octrees

Started by gahre Oct 11, 2001 at 12:37 PM 3 replies 500+ views
Original Post
gahre
gahre
Hi. I am programming a little 3d game and I use an octree for storing my data. But I have a problem: I can''t get my triangle splitting code working (it''s elf-made, so it''s low, but that''s not important, cause it''s only done once) can anyone give me an example of a working triangle (or polygon) splitting code? (or a link?) I''ve been using another technique first, but that doesn''t work anymore, because I switched to compile vertex arrays now. I just tested if a triangle has already been drawn in the current frame. I tried to test if a triangle has already been ADDED to a leaf (while subdividing the scene) - but I keep getting segmentation faults - and I just can''t figure out why :-(
acw83
acw83
Maybe you aren''t paying the elves enough?
TerranFury
TerranFury
Why split triangles? Keep an array of triangles, and, for each octree node, an array of pointers to triangles. Each triangle should have a "drawn_this_frame" flag.

Topic Locked

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

Sign in to reply to this topic.