x3dom/x3dom — Issue #67: Transparency issues and viewpoint issues
Author: newsbubbles
Created: 2011-12-29 22:16:15+00:00
State: open

I have noticed that sometimes objects stop being transparent when another object is inside of them or passes through them. I have a 3d volume control for instance. The control is set up like this:

There is a cone with no cap point which is set to a semi-transparent material. The normals are facing outward.

There is another cone with a completely opaque material which exists inside of it. This cone is used to display the volume level.

The outside cone is used with an onmousemove event bound to it so that it notes the event.hitPnt and then uses that to calculate the volume level. The inner cone is supposed to be displayed and the size is also controlled based off of the ratio between the boundary range of the volume control and the hit point.

when the volume object is clicked, viewpoint changes to show the volume control from a birds eye view.

## The Problem(s)

First problem is that there is some sort of issue dealing with transparency containing objects. If you just make a simple scene with a cone within a transparent cone, you'll see that viewing it from certain angles, the inner cone just disappears! Changing the point of view, or changing the cone size to make it pop out of the container cone just a bit also makes it visible. But, for instance, from the opposite point of view (other side of the object), it's vice-versa and the cone is only viewable if smaller than it's container cone.

Second problem is that for some reason when I change the view point to the top-looking-down, for some reason, x3dom brings back the event.hitPnt as a fraction of what it normally would be. when I mouse over the outer cone. It seems that if I change the view just a little by dragging my mouse, all of the sudden the numbers pop back to normal. An example of how the numbers change is that if 100 is top volume, the top most volume reached when moving the mouse over the extreme most point of the outer cone is 27. If I change the view by dragging the view even just one pixel down with my mouse, all of the sudden it works like normal and x3d sends back the proper numbers and my volume returns to 100 at max.

I checked my math on the second problem in javascript and I assured it was not just one of my own errors, seems that the only way it works the way I want is if I change the view just a little bit. But, try telling an end user that :D

I also would like to say that I really believe in this project and I have started working on a 3d menu system. I love that it's so native to HTML now, great work!