Revision ff31e865
Added by Leszek Koltunski almost 9 years ago
| src/main/java/org/distorted/examples/cubes/CubesRenderer.java | ||
|---|---|---|
| 103 | 103 |
|
| 104 | 104 |
if( width*mObjHeight > height*mObjWidth ) // screen is more 'horizontal' than the Object |
| 105 | 105 |
{
|
| 106 |
factor = (0.8f*height)/mObjHeight;
|
|
| 106 |
factor = (0.75f*height)/mObjHeight;
|
|
| 107 | 107 |
} |
| 108 | 108 |
else |
| 109 | 109 |
{
|
| 110 |
factor = (0.8f*width)/mObjWidth;
|
|
| 110 |
factor = (0.75f*width)/mObjWidth;
|
|
| 111 | 111 |
} |
| 112 | 112 |
|
| 113 | 113 |
mEffects.move( new Static3D( (width-factor*mObjWidth)/2 , (height-factor*mObjHeight)/2 , 0) ); |
| 114 | 114 |
mEffects.scale(factor); |
| 115 |
Static3D center = new Static3D(mObjWidth/2,mObjHeight/2, 0);
|
|
| 115 |
Static3D center = new Static3D( (float)mObjWidth/2, (float)mObjHeight/2, 0.0f );
|
|
| 116 | 116 |
|
| 117 | 117 |
mEffects.quaternion(mQuatInt1, center); |
| 118 | 118 |
mEffects.quaternion(mQuatInt2, center); |
| src/main/java/org/distorted/examples/quaternion/QuaternionRenderer.java | ||
|---|---|---|
| 106 | 106 |
mEffects.abortEffects(EffectTypes.MATRIX); |
| 107 | 107 |
mEffects.move( new Static3D( (width-scaleFactor)/2 , (height-scaleFactor)/2 , 0) ); |
| 108 | 108 |
mEffects.scale(scaleFactor); |
| 109 |
mEffects.quaternion( mRot, new Static3D(0.5f,0.5f,0) );
|
|
| 109 |
mEffects.quaternion( mRot, new Static3D( (float)mTexture.getWidth()/2, (float)mTexture.getHeight()/2 , 0) );
|
|
| 110 | 110 |
|
| 111 | 111 |
mScreen.resize(width, height); |
| 112 | 112 |
} |
Also available in: Unified diff
Small bugfix