Original Post
Hello, I'm currently trying to load 3DS files for a game demo I'm working on. It wasn't much of a trouble to load and render the mesh and textures, but I had more advanced features in mind. Simply put, I need to load the hierarchy and transforms for the objects as well, as in my game demo, I have hierarchtical models, animated by modifying the object transforms... Loading the hierarchy wasn't much of a problem, but getting the transforms wasn't as easy... According to the MAXSDK documentation, the pivot point of each object serves as a local coordinate system. I have tried loading both the local transforms from the EDIT3DS-chunk (0x4160) and the keyframe-pivot-chunk (0xb020). When I evaluate these coordinates during debug, they are identical to what i get in the transform-type-in in MAX (by pressing F12) when an object is selected (not subobject level). The coordinates were relative to the scene origin, so in order to get the offset position from its parent, I loaded the info into the hierarchtical structure, and, starting at the root's children nodes, traversed down and for each object, I subtracted its translation coordinate by that of its parent. This would in effect give me the vector to translate with to move from the parents coordinate-frame to the childs coordinate-frame (excluding rotations for now). However, it seems the pivot points are different from what I set them to be inside MAX. The following screenshots shows in-MAX and in-game rendering of the model, and its pivot point (rendered at 0,0,0 in-game). In-editor-screen: http://home7.swipnet.se/~w-70134/game/model_max.jpg In-game-screen: http://home7.swipnet.se/~w-70134/game/model_ingame.jpg Sorry for the pimpy background color folks :-). As you can see, the origin/pivot is offset from its position in MAX. It doesn't seem to be the origin in the max workspace either. Does anyone have any information on how to calculate correct hierarchy offsets and rotations? I'm defining the hierarchy by using the usual "select and link" tool in max. Thanks in advance for any help, and kudos to Ben Humphrey at gametutorials.com for his 3ds loading tutorial.