Ah it is cool you try to use Collada files made with other packages like sketchup. That is precisely the reason I move to Collada format.
gsaous wrote:Hi guys,
... I read about 15 hours per day to understand, but it seems that I have a result, so it doesn't matter..

), but since I'm still a starter I have some questions that i think they are easy for you to answer.
what were you reading?
-if you think the Collada mesh you load does not look correct, maybe you can post it here and I can take a look. If it is too big maybe you can make a small sample the expose the problem.
I tested the loader with few sketchup graphics files, but not with many physic files since I could not find any.
-The camera code is no active yet because I was stuck in getting teh toolbar in WxWidget.
I will make more progress in the controls for 2.21
-For adding Pyramid and Trapezoids to the Scene if you just want to test you can also make the in a Collada Scene in Sketch up and it should work.
If you want to use it to load model into you own project, you can check out the third Library called animation in the Newton collection
This is the interface;
- Code: Select all
class dSceneModelList: public dList<dModel*>
{
public:
dSceneModelList();
~dSceneModelList();
void AddModel (dModel* model);
void RemoveModel (dModel* model);
void ExportVisualScene (const char* fileName, const dMatrix& globalRotation, dFloat scale);
void ImportVisualScene (const char* fileName, dLoaderContext& context, const dMatrix& globalRotation, dFloat scale);
void ExportPhysicsScene (const char* fileName, NewtonWorld* world, const dMatrix& globalRotation, dFloat scale);
void ImportPhysicsScene (const char* fileName, NewtonWorld* world, dLoaderContext& context, const dMatrix& globalRotation, dFloat scale);
};
As you can see if you create a world, and you have a collada mesh, you can just call
- Code: Select all
dSceneModelList scene;
dLoaderContext context;
dMatrix globalRotation (identity);
float scale = 1.0f;
scene.ImportPhysicsScene (“colladaFileName”, world, context, globalRotation, scale);
and it will load the scene with everything, graphics and Physics,
then you can iterate the Graphics or teh Physics bodies and collect the data you need.
But you do not even have to iterate you can collect the date in the dLoaderContext as it si read from the file.
In the Next version of Newton the There will be Chunk based binary mode for loading and saving as well.
But maybe I will not have to do it since Collada people said they will make a Binary version too.