Model disapear at screen edges

With this code my model disapear when at screen edges.

float rotation_radian = float(y_rotation) * PI / 180.0;

mat4 model_rotation_matrix;

float c = cos(rotation_radian);
float s = sin(rotation_radian);

model_rotation_matrix[0] = vec4(c, 0.0, -s, 0.0);
model_rotation_matrix[1] = vec4(0.0, 1.0, 0.0, 0.0);
model_rotation_matrix[2] = vec4(s, 0.0, c, 0.0);
model_rotation_matrix[3] = vec4(0.0, 0.0, 0.0, 1.0);

vec4 v = transpose(MODEL_MATRIX) * vec4(VERTEX, 1.0);
vec4 rotatedVertex = model_rotation_matrix * v;

VERTEX = rotatedVertex.xyz;
1 Like

Try adjusting the extra_cull_margin property.

1 Like

Thank you, it worked. I never used this property.