Question

I created a simple 3D model in Blender, and imported this into OpenGLES for the iPhone SDK. The model imported with no problems for the most part but as you can see from the included photo links (photobucket), OpenGL is stretching the model beyond its intended proportions. The circular cylinders are made ovular, the squat rectangular body is made tall, etc. I'm a novice concerning OpenGL so please enlighten me: Why would OpenGL(ES) be stretching my 3D model and what are some troubleshooting steps?

PICS (pls open links in a new window yourself)

Lego Brick Modeled in Blender
Lego Brick Modeled in Blender
Lego Brick Rendered (Stretched) in OpenGLES
Lego Brick Rendered (Stretched)in OpenGLES
Lego Brick Rendered (Stretched) in OpenGLES

Was it helpful?

Solution

Maybe your object in blender has one of its scales different from 1, it may not be exported ( for instance if you only export the mesh, not the blender object ).

In blender you can clear scales with Alt S -> Clear Scale while in object mode.

OTHER TIPS

I know this is old but it would be useful if someone is searching for this issue to have a correct reference.

When you render things in OpenGL, the Projection Matrix is set to the identity matrix at render in the template:

glMatrixMode(GL_PROJECTION);
glLoadIdentity();

This means that openGL will render to a screen of aspect ratio 1:1. To fix this, you can do the following:

float m[16] = {1.33,0,0,0,
        0,1,0,0,
        0,0,1,0,
        0,0,0,1};
    glMatrixMode(GL_PROJECTION);
    glLoadMatrixf(m);

This sets the aspect ratio to 1.33:1 or 3:2 which corresponds to the iPhone screen.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top