|
From: Marcus L. <ma...@ya...> - 2006-02-23 15:38:57
|
antonio_lioy wrote: > Hi guys, I'm having great troubles in loading vrmls. I'm using SceneFileHandler class to load VRML. Each one of my VRMLs is a part of a complex object (like wheels for a car), and inside the file there's a matrix that puts the part in its position to become linked with other parts. It seems that the loader creates a scenegraph with two Group nodes and a global transform node. At last I supposed that this global transform node contains the transformation that places the object on the scene, and this seemed true with some of my model but I found a model with an identity global matrix... So where should I read the transforms? Is there a general position or it depends on the model? Do I need to load the models by hand if I need to change those matrices? > Please help... I'm not sure I follow entirely. Are you trying to load several parts (of, say a car), then want them connected in your app under the root? If so, you naturally need to connect them yourself, and try to recover the connectivity somewhow. How to do that varies wildly depending on your data, if you just have a car (i.e. body + wheels, not suspension) it's should only be a matter of adding all parts to a transform and move that around. If the transform is identity, then you might have the data in the vertices (that are then relative to world center, not object center). Check your data and make sure you export stuff correctly and get what you expect in the VRML. (I often find this to be the problem, that the VRML-data is not exactly what I want. OpenSG does a very good job at importing the VRML keeping the exact data and structure. I haven't yet found a flaw in OpenSG w.r.t this, it is usually my data.) Regards /Marcus |