Jump to content
  • Advertisement
Sign in to follow this  
choffstein

.obj files with scene graph

This topic is 4838 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

So I have finally gotten .obj files to load into my engine -- but only the v, vt, vn, and f commands. I am contemplating how to get the 'g' command in, which defines all further vertices, normals, faces, and textures as a new group. My question is, how is this 'g' command utilized later in the game? Would this be the appropriate place to define child scene node? If so, how can I tell what should be the child of what? Is this used for animation in anyway? Thanks. <3 visage

Share this post


Link to post
Share on other sites
Advertisement
.OBJ groups are typically used for animation. For example, a tank might have a group called 'turret' that would allow the turret to be rotated relative to the tank.

As I recall, each group in the file is a child of the previous group. In the case of the first 'g', it would be a child of an "unnamed" group. So you might have a tank.obj with some faces describing the tank body, followed by a child 'g' called "turret" that contains the faces of the turret. Or the body might be in a group called "body" with the "turret" group being a child of the "body" group.

For scene graph purposes, you might add a scene node for the .OBJ file as an unnamed group (or with the base filename as the group name). Then, each 'g' command would generate a new child scene node as a child of the currently active group (or the unnamed group in the case of the first 'g').

edit - Scratch some of that. Each group is only a child of the whole object and doesn't do nesting. So, you won't have children of children. Only siblings.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!