Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

type Conversions from Obj (3D Model) file to .h and .c

Does XCode provide conversions from Obj (3D Model) to .h and .c file ? I am bit lazy to write code for this conversion. Or any off the shelf product available?

XCode, Mac OS X (10.5), Obj (3D Model)

Posted on Dec 9, 2008 4:09 PM

Reply
24 replies

Dec 12, 2008 2:57 PM in response to jaxjason

Any 3D model file (ds,.3dm, .asc, .bvh, .c4d, .cob, .cgm, .chm, .csm, .dae,
.dwf, .dwg, .dxf, .fbx, .flt, .geo, .iv, .lwo, .max, .obj, .off,
.raw, .rh, .skp, .stl, .svs, .u3d, .vrml, .w3d, .wrl .x, .xsi
) types. I am sucessfully able to convert square and cube models to .h and loaded into IPhone. I am trying to do similar thing like teapot model from GLGravity sample code.

I have a some success for converting 3d model into iphone using .h files from *.obj model (similar to teapot.h model). Which is displayed using gldrawElements for low poly count models but with high poly count models displays big blob on the screen.

Here the thing I am trying to do. I have simple animation (run and jump) and trying to port into iphone. Animation means not taking about circling or moving image (*.jpg) from one end to another. (Simple 3D animation)

Looks like, data conversion from 3D model to C header types giving me troublr for high poly models. Any mathematical models are available for high poly count models? But high poly 3D models, it is a big performance issue on iphone..

Do any body know how do get skeletion, joint and IK information from 3D model and use in the Objective C world. It is very interesting to solve this puzzle.
Any gurus out there ..?

Dec 15, 2008 6:24 AM in response to orangekay

This is what I am trying to do:
Take a 3D model from ( http://www.the3dstudio.com) and convert that model into Objective -C and use that 3D Object(Model) in IPhone application. I am having issues with convertion. Even if I am able to solve this whether is it possible to port 3D animationt to iphone? I am banging by head against wall for last one month to solve this problem. I donot think I am able to solve 100 %, giving a shot

Dec 15, 2008 9:28 AM in response to ooftish.com

objective C is a programming language, like C or Java or even Basic. an H file is a compnent of that language. It sounds like your trying to convert from a solid object modelling system to another GRAPHIC format.

Many times on apple even if the extension isn't right, the Mac has saved what program it was created with and can still open it properly. so even if your saving it as an "h" file, that has nothing to do with Obj-C. That has to do with previewing pictures.

Am I heading in the right direction here?
Jason

Dec 15, 2008 10:34 AM in response to jaxjason

That is true .h is header file in C or Objective C. On mac it may be possible to open a view 3D model file if you have corresponding viewer software.
It is whole other story If one has to read a 3D model file on IPhone, because we donot have a "corresponding viewer software" on IPhone and also have hardware limitations.

One way to over this problem is to convert 3D model to Objective C readable header file, but in this process we lose of lot important data regarding (dynamic nature) animation, skeleton, joints and other information. In this conversion we will have basic information about vertexs, normals and texture. This information may be helpful in redrawing images from this static data and does not include dynamic data.

Here are the things I am looking answers for:
1) How do we retain maximum dynamic nature of 3D model?
2) Does IPhone supports or restrict any specific 3D model format?
3) Whether is it possible to read 3D model file from IPhone without converting into .h (header file)?
4) IPhone hardware capabilities?

Your help in this regard is greatly appreciated

Dec 15, 2008 10:35 AM in response to jaxjason

That is true .h is header file in C or Objective C. On mac it may be possible to open a view 3D model file if you have corresponding viewer software.
It is whole other story If one has to read a 3D model file on IPhone, because we donot have a "corresponding viewer software" on IPhone and also have hardware limitations.

One way to over this problem is to convert 3D model to Objective C readable header file, but in this process we lose of lot important data regarding (dynamic nature) animation, skeleton, joints and other information. In this conversion we will have basic information about vertexs, normals and texture. This information may be helpful in redrawing images from this static data and does not include dynamic data.

Here are the things I am looking answers for:
1) How do we retain maximum dynamic nature of 3D model?
2) Does IPhone supports or restrict any specific 3D model format?
3) Whether is it possible to read 3D model file from IPhone without converting into .h (header file)?
4) IPhone hardware capabilities?

Your help in this regard is greatly appreciated

Dec 15, 2008 12:20 PM in response to ooftish.com

I am not familiar with using a header file for anything than the typical use in Obj-C of desciring for the compiler what to expect in a .m file. I didn't know you could write 3D object model data into it.

It sounds more like you wanting, in this case, to export the 3D model data to some kind of storage file, possibly a simple flat text file (maybe XML), with appropriate normal vector, bounds cooordinates, joint properties etc... Then write some Obj-C code to read this data in and display on the iphone.

Does anyone know anything about the use of a header file in this other manner?
convert 3D model to Objective C readable header file


Thanks,
Jason

Dec 16, 2008 10:16 AM in response to ooftish.com

This is the code from the Teapot.h file. It DOES NOT contain anything to store or reproduce the solid. It runs an OBJ-C Procedure called "DrawTeapot" that draws the teapot. you need to research the rest of the teapot.M file to see how it does so, and how it stores the data.

#ifndef TEAPOT_H
#define TEAPOT_H
#ifdef __cplusplus
extern "C" {
#endif
// Returns the number of vertices sent to GL.
int DrawTeapot(GLint grid, GLdouble scale, GLenum type);
#ifdef __cplusplus
}
#endif
#endif


Jason

type Conversions from Obj (3D Model) file to .h and .c

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.