Map disappears at certain camera positions

Posted By: Yking

Map disappears at certain camera positions - 05/08/17 14:22

Hello Forum laugh

I have had this problem for a long time but I never had to pay much attention to it until yesterday.

For some reason, when my camera goes too far away from its starting position, the map (and every 3D-object) disappears until I move the camera back.



I am sure there must be a simple reason for this, maybe some kind of range problem? But I am not sure what exactly to look for.

(I only ran the most neccesary functions, not much extra)

Can anyone help me with this laugh ?
Posted By: 3run

Re: Map disappears at certain camera positions - 05/08/17 14:49

Hey

Try to adjust 'camera.clip_near' and 'camera.clip_far' parameters.

Greets!
Posted By: Ezzett

Re: Map disappears at certain camera positions - 05/08/17 14:58

3run wrote the answer. But it looks like your y-coordinate jumps around several thousand units when moving. Is this intentional?
Posted By: Yking

Re: Map disappears at certain camera positions - 05/08/17 16:17

Hello laugh

Thank you both for your help.
I have tried to double and triple the parameters
Quote:
camera.clip_near = 10;
camera.clip_far = 150000;

But the problem is still the same.

In the .GIF from my original post I move along the y-axis, it jumps around a bit because the .GIF is looping back to the beginning.
Everything disappears when I jump from y=4600 to y=4800 and the x- and z-axis do not help to avoid it.
(My camera movement is relatively fast, that is intentional)

I have placed a couple of objects at y=6000, 8000, 10000 etc. but nothing gets displayed when the camera goes beyond 4800.

Really weird shocked
Posted By: Superku

Re: Map disappears at certain camera positions - 05/08/17 16:57

Your camera is probably leaving the ABTree's maximum dimensions and then just decides to render nothing as the ABT does not return potentially visible objects. For some reason the ABT is not fully updated automatically in A8 (like when you leave its area with your camera or move certain objects beyond that).
It could be that it's using level_ent for the bbox. .. The beta features page says:
Quote:
The level size (level_ent.min_x/max_x) was automatically adapted to the maximum coordinate of an object moved or placed in the level. This led to undesired behavior when the level size was set up manually. It is now only adapted when level_ent.max_x/min_x was changed in the script .

Try debugging/ displaying those values. And/ or place a block in various corners of the map, not just in y direction but in z (and x) direction, too.
Posted By: Ezzett

Re: Map disappears at certain camera positions - 05/08/17 16:58

Maybe your level_ent is to small? This is the entity that contains the level:
http://www.conitec.net/beta/level_ent.htm

I see, Superku had the same idea.
Posted By: Yking

Re: Map disappears at certain camera positions - 05/08/17 17:40

Yes! That did it!

I displayed my level_ent.min_x and level_ent.max_x
and it was suspiciously close to the deadzone

I then placed some blocks in every corner, compiled it and now the values of
level_ent.min_x and level_ent.max_x
went up remarkebly.
And it works perfectly fine now.

All that was in my map previously was terrain, so I guess the values of level_ent.min_x and level_ent.max_x were smaller than my terrain?
Anyway:
I learned something new today and this is very useful to know laugh !

Thank you guys, I will not forget this!
Posted By: Dooley

Re: Map disappears at certain camera positions - 06/21/19 21:08

Just came across this same problem. You can also set the min/max like this...


vec_set(level_ent.min_x, vector(-900000, -900000, -900000));
vec_set(level_ent.max_x, vector(900000, 900000, 900000));
© 2024 lite-C Forums