Getting Maya Models on iPhone

What is the best way to do this? Googling showed me many ways, but what is the best? I would be happy enough to just get the model exported from Maya and displayed on the iPhone screen, but I would be nudged if there was a way to render it, and then support a pinch to zoom, etc.

Thank you very much, I just finished my first class of 3D modeling today, and I pushed!

+3
source share
4 answers

Well, if someone does not have a better way, I followed this post: http://heikobehrens.net/2009/08/27/obj2opengl/ . It includes exporting the model as .obj and then running it through a Perl script to convert it to .h from C. structures

0
source

I just finished writing a full-featured model viewer and manipulator for iPhone and iPad. Basically, I just wrote my own file parser that will store the arrays of vertices, and then in my rendering cycle I just issue arrays. This is pretty straight forward, although binary files are read much faster than .obj files. Thus, you can open any file, not just the ones you "process". There are also many examples on the Internet.

EDIT:

:

vertexX, vertexY, vertexZ, normalX, normalY, normalZ

, , , . , , .

glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_NORMAL_ARRAY);

glVertexPointer(3, GL_FLOAT, sizeof(vertices[0])*6, &vertices[0]);
glNormalPointer(GL_FLOAT, sizeof(vertices[0])*6, &vertices[3]);

glColor4f(R, G, B, 1); //range 0-1
glDrawArrays(GL_TRIANGLES, 0, numVertices); //number of floats in array divided by 6

glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_NORMAL_ARRAY);

OpenGL-ES 1.1. , .

EDIT2:

, OBJ , :

list of vertices
list of texture coordinates
list of normals
list of faces

. , :

f 16/4/1  4/4/4  1/1/1

16 , 4 1 . 4 , 4 4 .. , , .

+5

. . , [] , . , .

[edit] , 13

+1

You can also use unity3d and cocos3d as well

0
source

Source: https://habr.com/ru/post/1785097/


All Articles