CoffeeSCad
CoffeeSCad copied to clipboard
Object transparency independent of object order
Object transparency seems to be dependent on object creation order just as in OpenSCAD. Transparent objects only let "later" objects show through itself. Objects created "later" does not show earlier objects through itself. Can it be over come or is it a limitation of CSG or other core components?
Example
cub3 can be seen through cub2 and cub1
cub2 can be seen through cub1 but not through cub3
cub1 can not bee seen through any other object
cub1 = new Cube({size:[5, 10, 10]}).color([0.3,0.5,0.9,0.5]).translate([0, 0, 0]) cub2 = new Cube({size:[5, 10, 5]}).color([0.5,0.3,0.9,0.5]).translate([5, 0, 0]) cub3 = new Cube({size:[5, 10, 5]}).color([0.5,0.9,0.9,0.5]).translate([10, 0, 0])
assembly.add(cub1) assembly.add(cub2) assembly.add(cub3)
wow nice catch ! actually , after a bit of research , it seems that is a limitation of most rendering engines (thus more webgl /opengl side than csg), I'll dig a bit more to see if it can be overcome, but so far it seems it is not trivial .
hmm , just found this : https://github.com/jeromeetienne/threex.transparency/blob/master/threex.transparency.js, need to try it out, but it might help with the issue.
Was it a dead end?