Problem in JEFF LAMARCHE Objective-C export script for Blender
Hi I was using Jeff Lamarche objective c export script,开发者_开发百科 http://iphonedevelopment.blogspot.com/2011/02/blender-25-beta-6-objective-c-export.html .
But i am encountering a strange problem, whatever model i am rendering using this script, i am getting top view of that model on iphone. Is there any way by which i can render side view of the model??
I am building simple room with some walls. If needed i can supply the sample blend file.
It would be easier if you could post the blend file. Can you upload it here: http://www.pasteall.org/blend/
At a guess, I would suggest rotating the whole model 90 degrees before using the script. Also make sure that you are clearing the rotation of the model.
Jee LaMarche's script has been updated to work with the latest Blender 2.5. You can download it and install it easily on his site here.
I'd get Blender 2.5 release build, install the script, and import your previous .blend file in here.
There's an option to export as "Y-up" : "The second option will rotate the object 90° along the X axis, which converts the object from Blender's Z-up coordinate space to OpenGL's Y-up coordinate space. I've made this the default, but I could foresee situations where people would want to skip the conversion." (quoted Jeff's site).
Last, I would do what Sycren said and rotate the object 90 programmatically. For example, in your draw view method:
...
glColor4f(0.0, 0.0, 0.0, 0.0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_NORMAL_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glEnable(GL_TEXTURE_2D);
glEnable(GL_BLEND);
glLoadIdentity();
glRotatef(90.0, 0.0, 1.0, 0.0); // rotate 90 degrees on the y-axis
glScalef(1, 1, 1);
...
精彩评论