Commit 20aca258 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[FIX] - fixed problem with bounding box calculation which caused ugly stuff during rotation.

parent 3eab9b64
......@@ -31,8 +31,11 @@ void main()
pos = gl_ModelViewProjectionMatrix * gl_Vertex;
z = pos.z;
zNear = (gl_ModelViewProjectionMatrix * vec4(nearPos,0)).z;
zFar = (gl_ModelViewProjectionMatrix * vec4(farPos,0)).z;
zNear =0.5 + 0.5*( (gl_ModelViewProjectionMatrix * vec4(nearPos,1.00)).z );
zFar =0.5 + 0.5*( (gl_ModelViewProjectionMatrix * vec4(farPos,1.0)).z );
float tmp2 = zNear;
zNear = min( zNear, zFar );
zFar = max( zFar, tmp2 );
view = - pos.xyz;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment