Frustum-Culling

Started by
11 comments, last by JustJim 9 years, 7 months ago

Well I double-checked with principe of excluding. I just commented out the return of my inFrustum-Methode. Result: The whole sphere is seen

the whole time.

It gives me headache. I got everything so fine haha.

It has a nice Quadtree, It transforms the tree into Vertexbuffer in realtime, It subdivides when getting closer.

The only thing I need now is this Culling-Feature.

I just noticed somthing other. The Vertices of the spheres are all around 1.0 and 1.0000000012. But this can't have such

an effect as my distance of Camera to Object is 200000f (the Sphere itself has the size of 1000000f and the camera is at 1200000f)

But as it rotates in the Grid-visualiation it looks like the orgignal boarders are slightly bigger than the size of each other vector..

Advertisement

Alright. I get close to the problem...

At a certain distance and rotation-angle of the sphere (in my tests it was createRotationY(20f)) every, really EVERY Angle (Cam To Vertex , Cam To LookAt) over 90°.

Thats kinda... sad lol.

I do not know why it is that way.

I'll do a freaking dumb workaround for the moment. so if anyone read this, please give me a hint how I could fix this to work properly..

My Workaround does it like that:

I already calculated the Back-Face-Culling where every Point in the Angle between Vector Cam To Middle and Middle To Point is greater than 90°.

I'll change this to include the distance in calculation, so that the Angle at which it starts to clip will decrease...

This seems a fast way to do this... But it's only a play with values to get the correct relations.

If someone give me also a trick to make sure that width is clipped much slower than hight. Because the X Value of the sphere which is the width at starting the game

can change so its the hight or the depth when changing the cam.

This topic is closed to new replies.

Advertisement