Archive 17/01/2023.

How to judge a chunk in Frustum?

ChunFengTsin

hello ,
The game like minecraft, every frame should check many chunks.

I want to create and check chunks only in my view, in frustum.
how I get the matrix or infomatin about frustum to judge , when I use Urho3D.
thanks.

Eugene

Don’t really understand your question.

Would it be enough to iterate through chunks and test wheter they are in the Frustum? Maybe add some grouping for speed, like Octree does.

ChunFengTsin

I am so sorry for my bad english.
There is a abstract picture I draw:
temp

describe : red line box is chunk,
And the chunks in blue area ,should be create and check .

the game dynamic generation chunks around camera.
those chunks on back of camera should not be create.
how I judge that.

sorry for my bad english again.

Eugene

Then… Frustum gives you an ability to check arbitrary box volume.
So you should just iterate through chunks and create the chunks inside/intersecting the Frustum.

ChunFengTsin

oh, it may be I’m too persistent in performance .
thanks a lot.

Eugene

Well, performance issues could be solved later by grouping chunks hierarchically, smth like 3D-quadtree.

ChunFengTsin

This is a good idea.

weitjong

Also check Drawable::IsInView() to see if it meets what you need.