Jump to content

  • Log In with Google      Sign In   
  • Create Account

Tudor Nita

Member Since 09 Mar 2012
Offline Last Active Dec 13 2012 05:25 PM

#4971434 What are the downsides to using Unity?

Posted by on 20 August 2012 - 05:45 AM

Unity's fbx import will convert it, but have non zero values in the rotation fields, with no way to set the default rotation to identity (0,0,0).

Especially when writing scripts to instantiate objects

I'll have to agree on that. Was thinking from a manual import POV. However I remember you can get a 0,0,0 rotation if you pre-rotate the object/ pivot in 3DS Max before exporting. Will have to check this out again as my memory is not to be trusted.

#4971427 c++ file reading

Posted by on 20 August 2012 - 05:38 AM

I wouldn't use iostream. Something like this works for me. Imagine an input file like:

# a comment
a 3.5 3.5 yay_some_text
a 3.2 4.5 yay_some_more_text

[source lang="java"]FILE *pFile = fopen(filePath, "r"); // the file to loadchar buffer[512]; // character bufferchar temp;// read each line into the bufferwhile (fgets(buffer, sizeof(buffer), pFile)){ // switch based on leading type switch (buffer[0]) { case '#': // do nothing, it's a comment [img]http://public.gamedev.net//public/style_emoticons/default/biggrin.png[/img] break; case 'a': // set ambient color ? sscanf(buffer, "%c %f %f %s", &temp, &someFloat, &someOtherFloat, &aString); break; }}[/source]