Jump to content
  • Advertisement
Sign in to follow this  
Andrew1979

OpenGL using models in cinema 4d files

This topic is 3797 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi All I'm new to this website. I have a 3D model in a cinema 4d file. I would like to use that model which is in the file in an OpenGL program that I'm writing using C/C++. Has anybody any advice on doing this? Are there any tutorials on doing this at all? Thank you in advance. Andrew

Share this post


Link to post
Share on other sites
Advertisement
Most probably no one has created a loader for the cinema 4d file format since these are usually not documented. Perhaps you can export to some other format like .x or .3ds or .obj or milkshape. You can even write your own Cinema script to export to your own format.

Share this post


Link to post
Share on other sites
I just have the cinema 4d file of the model that I'm wanting.

I only have the demo version of cinema 4d which does not let me export or save to another file format :(

I have a found a pdf document that explains c4d file format and structure. I've read and understood it however it does say something about if on an intel machine I have to change the byte order first before reading the file.

I've always heard of byte order but never done it, what would I need to do in C/C++ to change the byte order?

:)

Thank you in advance.

Andrew

Share this post


Link to post
Share on other sites
Something like this


void ChangeEndienness(unsigned int *value)
{
unsigned char temp[4];
unsigned char *pvalue=(unsigned char *)value;
temp[0]=pvalue[3]; //Swap byte order
temp[1]=pvalue[2];
temp[2]=pvalue[1];
temp[3]=pvalue[0];
pvalue[0]=temp[0]; //Copy back
pvalue[1]=temp[1];
pvalue[2]=temp[2];
pvalue[3]=temp[3];
}

void ChangeEndienness(unsigned short *value)
{
unsigned char temp[4];
unsigned char *pvalue=(unsigned char *)value;
temp[0]=pvalue[1]; //Swap byte order
temp[1]=pvalue[0];
pvalue[0]=temp[0]; //Copy back
pvalue[1]=temp[1];
}

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!