Triangulate Them Polygons!

Blitz3D Forums/Blitz3D Programming/Triangulate Them Polygons!

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I've been playing around with occlusion culling as well.
Currently I extract the edges that makes the outline of my occluding object and then I "create" planes using the vertices of each edge and the cameraposition. Then I simply check if entities are behind each plane(Just like frustum culling, but reversed).

The problem I have is to order the edge vertices by clockwise order. Currently I'm using Grahams method using the angle to each point to sort them, but it's not working well when two points are too near to each other.

The occluder is made by creating a very simple convex hull around the "carefully" selected entity.
It wouldn't be good to use every entity as an occluder as it would slow down the occlusion test to a point where it would defeat it's own purpose(to get better framerates).
A house or a hill are examples of good occluders while a bush or a small rock are bad occluders.
Also, the occluder must be a certain distance from the camera before it's used in the occluder test.
An occluder that is too far away wouldn't be worth testing(I think you know why).

By the way, the edge extracting is a simple way to outline an object with black edges by simply drawing black line between the edges vertices, however the line command slowed down my application ALOT and so far I only got it to work with convex objects(spheres, boxes and cylinders).