I'm not even sure what code to share, but maybe someone's been in a similar situation or has a good suggestion.
I'm basically rendering a sphere in the middle of the screen (placed at (0, 0, 0)
) and it looks fine. However, if I choose to render the same sphere further away from the origin, it gets an egg shape. I think the egg shape is in the direction of the translation. Here's the code that sets up the model matrix:
Matrix.setIdentityM(mModelMatrix, 0);
Matrix.scaleM(mModelMatrix, 0, 0.15f, 0.15f, 0.15f);
Matrix.translateM(mModelMatrix, 0, 0, 0, distance);
When distance = 0
, the sphere shows up normally, however if distance = -1.5f
, then the sphere is sort of stretched on the z axis. Any suggestions for fixing this behavior?
Matrix.frustumM(mProjectionMatrix, 0, left, right, bottom, top, near, far);
whereleft = -width/height
,right = width/height
andbottom=-1
,top=1
,near=1
,far = 10
– async Dec 20 '13 at 15:20