Sign in to follow this  

Multiple objects in a .obj

This topic is 2844 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

I have a question about storing multiple objects in a Wavefront .obj file, as the docs I have read aren't too clear on the subject. Does each sub-object have its own set or vertices, or are they shared within the entire file? For example:
# style 1
o object_1
v 0.0 0.0 0.0
v 1.0 0.0 0.0
v 1.0 0.0 1.0
v 0.0 0.0 1.0
f 1 2 3 4

o object_2
v 0.0 2.0 0.0
v -1.0 -1.0 0.0
v 1.0 -1.0 0.0
f 1 2 3

# style 2
v 0.0 0.0 0.0
v 1.0 0.0 0.0
v 1.0 0.0 1.0
v 0.0 0.0 1.0
v 0.0 2.0 0.0
v -1.0 -1.0 0.0
v 1.0 -1.0 0.0

o object_1
f 1 2 3 4

o object_2
f 5 6 7
My maps are designed in a way that requires use of .objs with multiple objects, so I need to figure this out before I can continue. Any help is appreciated.

Share this post


Link to post
Share on other sites
A sample exported from Blender, consisting of one triangle object and one square object.


# Blender3D v249 OBJ File:
# www.blender3d.org
mtllib test.mtl
o Triangle_Plane.001
v -2.210575 -0.000000 -0.986309
v -2.210575 0.000000 1.013691
v -4.210576 0.000000 1.013691
usemtl (null)
s off
f 1 3 2
o Square_Plane
v 1.000000 -0.000000 -1.000000
v 1.000000 0.000000 1.000000
v -1.000000 0.000000 1.000000
v -1.000000 -0.000000 -1.000000
usemtl (null)
s off
f 4 7 6 5

Share this post


Link to post
Share on other sites

This topic is 2844 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this