Search code examples
away3d

Possible bug with Away3D 3.6 MovieMaterial; 2D overlay appears over model when interactive=true


I am having a peculiar issue with MovieMaterial.as in Away3D 3.6.

I have a 3D globe with clickable, white hotspots on it (see image below). When I set interactive to 'true' in the following code, when I move my mouse over the globe's surface, a 2D copy of the MovieMaterial will suddenly appear (see image at bottom). This 2D image will move when I move my mouse too.

_hotspotGlobeMaterial = new MovieMaterial( _hotspotSprite, { interactive: true, smooth: true, transparent: true } );
_hotspotGlobe.material = _hotspotGlobeMaterial;

http://grandinteractive.com/misc/GlobeWithHotspots.png

The 2D issue here:

You'll also noticed that the white / transparent areas are reversed.

http://grandinteractive.com/misc/Bug.png


Solution

  • Away3D 3.6 creates an invisible Sprite that appears over your 3D object. The 3D sprite contains is a copy of your MovieMaterial and it basically operates as a means of making the children clickable. Clever!

    The reason that it was showing in my case was because I had set blendMode = BlendMode.LAYER in a bunch of places in my code, thus making the invisible sprite visible. Who would have thought?