3D intersects 'cuts' object?

General Moho topics.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
bupaje
Posts: 1175
Joined: Fri Nov 12, 2004 5:44 pm
Location: California
Contact:

3D intersects 'cuts' object?

Post by bupaje »

This is not critical but was fooling around and I got an unexpected result -which of course set me off on a round of experimenting. When a 3D cone I made to test as a light beam intersects the 3D goblin head from the tutorials one of the cones seems to mask the head 'cutting' it where they overlay.

I'm just curious as I tried creating several 3D cubes in Moho, intersected them and set the same settings -as far as I can tell- yet these don't do that. Again not critical just curious if someone can give me an explanation.

Here is a quick mov where you can see the effect and a zip of the Moho file and 3D cone.

Movie
http://stormvisions.com/moho/lightsmov.zip

Moho Files
http://stormvisions.com/moho/light_test.zip
User avatar
Lost Marble
Site Admin
Posts: 2347
Joined: Tue Aug 03, 2004 6:02 pm
Location: Scotts Valley, California, USA
Contact:

Post by Lost Marble »

Here's the problem:

It's not really a masking effect. When multiple 3D objects are drawn, Moho uses a z buffer algorithm - basically, at each pixel where 3D objects overlap, only the frontmost 3D object is drawn.

A straight z buffer algorithm doesn't deal with transparency very well. So, since your light beam is transparent (and uses the Overlay blending mode in addition), that's causing problems. The head object detects that it is behind one of the light beams, so it doesn't bother drawing itself in that area. Because the light beam is partially transparent, the head looks like a chunk is cut out.

You have two possible solutions: First, draw the light beams using regular 2D vector shapes. They're simple enough that they don't really need to be 3D objects.

Second, you can tell the light beam and the head to not try to interact with one another in 3D. Go to the lowest 3D layer in the head group - this is the layer called "head.obj". Double-click the layer to bring up the Layer Settings dialog. In the 3D Options tab, turn on the check box labeled "Reset Z buffer". This tells the 3D layer to clear the z buffer before drawing itself, so that it doesn't interact with other 3D layers that appear lower in the document.
User avatar
bupaje
Posts: 1175
Joined: Fri Nov 12, 2004 5:44 pm
Location: California
Contact:

Post by bupaje »

Thanks for the explanation and solution LM.
Post Reply