laumaya / GLC_lib

GLC_lib is a C++ library for high performance 3D application based on OpenGL and Qt4 GUI
http://www.glc-lib.net
Other
61 stars 31 forks source link

Minor fixes and changes #6

Closed PhoenixBlack closed 11 years ago

PhoenixBlack commented 11 years ago

I have made the following changes:

LOD problem: previously if mesh had n LOD levels, then the lowest LOD level n-1 will start from range: (int)(range / 100.0) * (n-1) = n-1 (int)(range / 100.0) = 1 That is, for any range equal to 100.0 or higher. In your code 100.0 means the object is zero pixels in size on screen, making the last LOD level useless.

laumaya commented 11 years ago

Thanks for you contribution to GLC_lib, Your changes have been quickly tested and incorporated into GLC_lib next branch.

A+

Laurent Ribon.

Le 18 mai 2013 à 13:31, Black Phoenix notifications@github.com a écrit :

I have made the following changes:

LOD didn't seem to work properly - it would never show the last LOD level (and not work at all if there are only two LOD levels obviously). Parallel projection still had a near clip plane. Orthographic projection can have a negative near clipping plane, since the vertices will be projected into same position on screen regardless of their distance to camera. This makes it possible to zoom in without clipping. Added a way to change factor by which GLC_Viewport::reframe() estimates size of the scene - in my case a lower value is more comfortable. Also now reframe can just re-center view without changing the zoom value. LOD problem: previously if mesh had n LOD levels, then the lowest LOD level n-1 will start from range: (int)(range / 100.0) * (n-1) = n-1 (int)(range / 100.0) = 1 That is, for any range equal to 100.0 or higher. In your code 100.0 means the object is zero pixels in size on screen, making the last LOD level useless.

You can merge this Pull Request by running

git pull https://github.com/PhoenixBlack/GLC_lib next Or view, comment on, or merge it at:

https://github.com/laumaya/GLC_lib/pull/6

Commit Summary

LOD changes uniformly, does not miss last LOD level if there are only 2 LODs Fixed accidently added bug... no more crashes for meshes with NO LODs No more near plane clipping when using parallel projection Merge branch 'master' into next Added coverFactor to GLC_Viewport::reframe() - allow zoom in more than usual, or just center and no zoom File Changes

M src/geometry/glc_mesh.cpp (4) M src/viewport/glc_viewport.cpp (24) M src/viewport/glc_viewport.h (2) Patch Links:

https://github.com/laumaya/GLC_lib/pull/6.patch https://github.com/laumaya/GLC_lib/pull/6.diff