Revision 483ae94e
Added by Leszek Koltunski about 5 years ago
src/main/java/org/distorted/examples/rubik/RubikSurfaceView.java | ||
---|---|---|
160 | 160 |
|
161 | 161 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
162 | 162 |
|
163 |
void recomputeCameraDistance(double fovInRadians)
|
|
163 |
void setCameraDist(float distance)
|
|
164 | 164 |
{ |
165 |
mCameraDistance = (float)((mScreenHeight*0.5f)/Math.tan(fovInRadians*0.5));
|
|
165 |
mCameraDistance = distance;
|
|
166 | 166 |
} |
167 | 167 |
|
168 | 168 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
224 | 224 |
} |
225 | 225 |
|
226 | 226 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
227 |
// 240 --> moving finger from the middle of the vertical screen to the right edge will rotate a |
|
228 |
// given face by 240/2 = 120 degrees. |
|
227 | 229 |
|
228 | 230 |
private void continueRotation(int x, int y) |
229 | 231 |
{ |
Also available in: Unified diff
RubikApp: properly compute cameraDistance and FOV.