Revision 687263cc
Added by Leszek Koltunski about 4 years ago
src/main/java/org/distorted/examples/rubik/RubikRenderer.java | ||
---|---|---|
155 | 155 |
private void recomputeScaleFactor(int screenWidth, int screenHeight) |
156 | 156 |
{ |
157 | 157 |
float cubeSizeInScreenSpace = CUBE_SCREEN_RATIO*(screenWidth>screenHeight ? screenHeight:screenWidth); |
158 |
float texSize = mCube.getTextureSize();
|
|
158 |
float texSize = mCube.getStretchSize();
|
|
159 | 159 |
float scaleFactor = cubeSizeInScreenSpace/(texSize*mCube.getSize()); |
160 | 160 |
|
161 | 161 |
mMove.set( (screenWidth-scaleFactor*texSize)/2 , (screenHeight-scaleFactor*texSize)/2 , -scaleFactor*texSize/2 ); |
Also available in: Unified diff
Move the 'pre-multiply mesh before applying any effects' thing from [(Xsize of texture, Ysize of texture) x Mesh's zFactor] to Effects.setStretch(sx,sy,sz)