(solved) Problem updating from irrlicht 1.7. Rotation?

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
CuteAlien
Admin
Posts: 9628
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Problem updating from irrlicht 1.7. Rotation?

Post by CuteAlien »

lumirion wrote:I included irrlicht so that my cmake project works. I'm a little overly proud of it. Lol. The changes are minimal. Just a texture loader and support for cm2mesh type.
Yeah, but...if you use your own Irrlicht - how can you compare different Irrlicht versions? This change which caused your problems didn't just affect some header - but also several places inside the engine had to be adapted. So - did you test it with real Irrlicht?
Also - minimal is maybe 5 lines. Every code that's longer takes time to understand... if a bugreport comes with more than 50-100 lines of code then in my experience the bug mostly vanishes once people reduce their code.

@AReichl: Wow, evil page :-) But yeah - I didn't try that.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
lumirion
Posts: 79
Joined: Tue Sep 13, 2011 7:35 am

Re: Problem updating from irrlicht 1.7. Rotation?

Post by lumirion »

Here we go. Lets try this https://gitlab.com/Lumirion/M2Viewer/re ... ref=master . That link should download my working directory. I pulled most of the changes out of the irrlicht code and moved them into viewer.cpp. The only modifications remaining in Irrlicht are adding my cm2mesh class ass a friend of the skinned mesh's joint and weight class next to the cskinnedmesh. The M2Viewer/src/Viewer folder contains my cm2mesh, its loader, its cm2meshscenenode, blp texture loader, some helper functions and Viewer.cpp example program. If you like, you can use cmake to generate a visual studio project to build. cm2mesh is essentially a cskinnedmesh with extra functions to handle m2 features. The dragon in the sample mesh should face left but faces away from the camera.
lumirion
Posts: 79
Joined: Tue Sep 13, 2011 7:35 am

Re: Problem updating from irrlicht 1.7. Rotation?

Post by lumirion »

Success! :D I managed to invert my rotations as they are passed into the joints.
lumirion
Posts: 79
Joined: Tue Sep 13, 2011 7:35 am

Re: (solved) Problem updating from irrlicht 1.7. Rotation?

Post by lumirion »

To fix the rotations in the m2's animations I edited src/Viewer/CM2MeshFileLoader.cpp at line 608. This line assigns a joint's animation frame's rotation key to the joint. I changed

Code: Select all

 rot->rotation=tempQ;
 
to

Code: Select all

 rot->rotation=tempQ.makeInverse();
this made the direction quaternion point the opposite way. Then I recompiled and copied the viewer.exe to the bin folder and it now functions correctly.
CuteAlien
Admin
Posts: 9628
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: (solved) Problem updating from irrlicht 1.7. Rotation?

Post by CuteAlien »

Thanks for trying on and finding it! Please keep the test online, I'll get to it at some point (still got a few other todo's and spend last 3 weeks constantly on the front-page hack, but have this on my list - even more important now as this one didn't get caught by the test define which means there might be more similar troubles).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
CuteAlien
Admin
Posts: 9628
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: (solved) Problem updating from irrlicht 1.7. Rotation?

Post by CuteAlien »

After nearly 3 years I got through my todo-list far enough to look a bit into this. But unfortunately there is way too much custom code here for me to even figure out if there is something I missed in Irrlicht or not.

Well, at least I helped a bit with other stuff. You can now use createShadowVolumeSceneNode for your shadows. Note that you can also further reduce dependency on Irrlicht by passing IVideoDriver to your CImageLoaderBLP (then you don't need CImage anymore). Same for ILogger in CM2MeshSceneNodeFactory and CM2MeshSceneNode instead of using os::Printer.

Couldn't help yet with animation system, I guess for BoneSceneNode's and SkinnedMesh we should also get more stuff into the public interfaces. But unfortunately this is one of the areas where I'm not yet familiar enough to rewrite it. Will put that on my todo ... so maybe this thread gets another update in 3 years or so.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply