seriously disabled Posted July 13, 2009 Posted July 13, 2009 (edited) I currently use Torque and Blender to design my game and I have a problem: How do I import the scene or figure I constructed in Blender to the Torque Game Engine and the other way around, what I constructed in Torque to Blender? Edited July 13, 2009 by Uri
Xittenn Posted July 14, 2009 Posted July 14, 2009 (edited) Well first you have to convert it to the Torque Game Engine model format which is apparently .DTS! Then, check this out, John is kind of cute.. much easier than trying to do anything even remotely similar in C++................ Just for your personal comparison and for the amusement of others here is my simple code used just to index the .x(direct x file format) file in C++! .cpp #include "XFilez.h" bool CMeshFile::LoadXFile(string file) { Index.mesh_file = file; ifsMeshFile.open("C:/Projects/Naomies Moon/Roz_XSI/Roz.x"); while(!(ifsMeshFile.eof())) { getline(ifsMeshFile,line); vMeshFile.push_back(line); } ifsMeshFile.close(); if (!ifsMeshFile.bad() && !ifsMeshFile.fail()) { //find templates_index_end index file_itterator=2; while (!(vMeshFile.at(file_itterator).find("Frame") == 0)) { file_itterator++; } Index.scene_index_begin=file_itterator; //Index Hierarchy while (!(vMeshFile.at(file_itterator).find("}") == 0)) { if(vMeshFile.at(file_itterator).find("Frame") == 1) { Index.frame_index_begin.push_back(file_itterator); while(!(vMeshFile.at(file_itterator).find("}") == 1)) { file_itterator++; } } else file_itterator++; } } else return false; return true; } .h #ifndef X_FILEZ #define X_FILEZ #if _WIN32 #pragma once #endif #include <windows.h> #include <fstream> #include <iostream> #include <string> #include <vector> using namespace std; class CMeshFileIndex { public: string mesh_file; static const int header = 0; static const int templates_index_begin = 1; int scene_index_begin; vector<int> frame_index_begin; }; class CMeshFile { public: bool LoadXFile(string file); private: CMeshFileIndex Index; ifstream ifsMeshFile; string line; vector <string> vMeshFile; int file_itterator; }; #endif tabbing not so easily copied and pasted......... Edited July 15, 2009 by buttacup
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now