Revision 24624a1a
Added by Leszek Koltunski over 5 years ago
src/main/java/org/distorted/examples/inflate/InflateRenderer.java | ||
---|---|---|
100 | 100 |
|
101 | 101 |
public void onSurfaceChanged(GL10 glUnused, int width, int height) |
102 | 102 |
{ |
103 |
final float SCALE = 0.75f; |
|
104 |
|
|
103 | 105 |
mScreenMin = width<height ? width:height; |
104 |
float factor = ( width*mObjHeight > height*mObjWidth ) ? (0.75f*height)/mObjHeight : (0.75f*width)/mObjWidth;
|
|
106 |
float factor = ( width*mObjHeight > height*mObjWidth ) ? (SCALE*height)/mObjHeight : (SCALE*width)/mObjWidth;
|
|
105 | 107 |
mMove.set( (width-factor*mObjWidth)/2 , (height-factor*mObjHeight)/2 , 0); |
106 | 108 |
mScale.set(factor,factor,factor); |
107 | 109 |
mCenter.set( (float)mObjWidth/2, (float)mObjHeight/2, -(float)mObjDepth/2 ); |
Also available in: Unified diff
Add support for MeshSphere (add ability to display it in the 'Effects3D' and 'Inflate' apps).
Still a bit buggy!