Hi Brad, On 30/12/10 3:32 , Brad Lotocki wrote: > I'm new to the board and have a question about importing CAD models, > hopefully someone > out there can help. My basic question is this - is there a way to convert or > directly > import native CAD formats (.stp, .stl, .asm, etc) into OSG, while preserving > the > model's coordinate frames? I apologize if I'm not using the same > terminology. I had > searched through your archives without luck. >... > Here is a little background of where I'm coming from - our team uses OSG to > graphically > simulate our lab's robot. As the robot is moved by the operator, OSG moves > the > graphical robot to mimic the physical one. Periodically we need to add > another model > to the OSG simulator, usually new robotic end effectors.. > > I've tried using osgconv.exe with .obj and .stl files. Both types result in > an OSG > file which can be viewed, but it lacks the matrix transformation information > we need.
The problem at least with .stl is that it simply doesn't support transformations and/or hierarchies. The .stl file is simply a list of triangles. If you can break up your robot model into separate files (like one for the shoulder, one for the upper arm, one for the lower arm, etc. down to the actuators) you could recreate the transformations using osg::MatrixTransforms (or PositionAttitudeTransforms) and load the geometries as children, to end up with something like this: shoulderTransform -> shoulderGeometry -> upperArmTransform -> upperArmGeometry -> ... You can then rotate the shoulder, the upper arm, etc and the geometry will behave accordingly. (Are you aware of the osgrobot example?) Cheers, /ulrich _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

