I have a scene where I've imported a single .OBJ file with the scene geometry, and a 2D character I'd like to animate in that scene. Picture a room with a single box in the middle; I want the character positioned between the wall and the box, such that the camera view shows the character in front of the wall, but behind the box.
The tutorials and the manual both indicate that this is possible, because of Moho's z-buffer handling, but I cannot for the life of me get it to work. The visible depth is always tied to the order of the layers, no matter what permutation of depth options I choose (e.g., sort by depth, sort by depth with true distance, depth sorting off, etc.).
Anyone run into this? Any help would be appreciated.
Z-buffer trouble when mixing 2D and 3D
Moderators: Víctor Paredes, Belgarath, slowtiger
- Lost Marble
- Site Admin
- Posts: 2347
- Joined: Tue Aug 03, 2004 6:02 pm
- Location: Scotts Valley, California, USA
- Contact:
Re: Z-buffer trouble when mixing 2D and 3D
I'm not sure what the tutorials say, but 2D layer do not use the z-buffer. Multiple 3D layers can intersect with each other because they all use the same z-buffer, but 2D layers are always composited in layer order. That layer order may be animated or automatically controlled by depth, but a 2D layer is always determined to be in front of or behind another layer - it cannot "intersect" another layer in 3D space.
-Mike
-Mike
Re: Z-buffer trouble when mixing 2D and 3D
I can tell you 2 things that may work for you.
1. If it's possible in your 3d program, you could export each 3d object sepertly. You can put them all in a group and enable depth sort (I don't know if you need true distance for this. See what works. You could also do this without grouping from the project settings from the file menu. The 3d program I have keeps everything in its rightful place according to its center point. When I export in moho, it's origin is its center point.
You could keep your obj file with 1 3d object, but you would have to mask your 2d character for it to work.
Hope it helps. Btw what program do you use for 3d?
1. If it's possible in your 3d program, you could export each 3d object sepertly. You can put them all in a group and enable depth sort (I don't know if you need true distance for this. See what works. You could also do this without grouping from the project settings from the file menu. The 3d program I have keeps everything in its rightful place according to its center point. When I export in moho, it's origin is its center point.
You could keep your obj file with 1 3d object, but you would have to mask your 2d character for it to work.
Hope it helps. Btw what program do you use for 3d?
Re: Z-buffer trouble when mixing 2D and 3D
Thanks for the pointers, guys. I wasn't aware 2D layers don't contribute to the z-buffer.
I've been doing most of my stuff in Cheetah3D.
I've been doing most of my stuff in Cheetah3D.