CoffeeSCad icon indicating copy to clipboard operation
CoffeeSCad copied to clipboard

Object transparency independent of object order

Open korpx opened this issue 12 years ago • 3 comments
trafficstars

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)

korpx avatar Apr 03 '13 16:04 korpx

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 .

kaosat-dev avatar Apr 05 '13 22:04 kaosat-dev

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.

kaosat-dev avatar Jul 10 '13 22:07 kaosat-dev

Was it a dead end?

korpx avatar Feb 03 '14 09:02 korpx