the code is
Code: Select all
#include "stdafx.h"
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
void LoadOBJ(const char* file,bool Log)
{
printf(file);
string line;
ifstream myfile (file);
if (myfile.is_open())
{
while ( true)
{
if(getline (myfile,line) )
{
cout << line << endl; // currently i print the lines to the screen for testing, later ill add the parsisng code
}
else
{
break;
}
}
}
else
{
printf("error in opening file");
}
myfile.close();
}
int main()
{
LoadOBJ("SimpleCube.obj",true);
while(true)
{
}
}
the SimpleCube.obj file its on the same folder as the executable and its the default cube exported from blender with the obj exporter.