[X3D-Public] Can I create a colored shape without any light effects?

John A. Stewart alex.stewart at crc.ca
Tue Jul 28 08:14:51 PDT 2009


Hi Tomas;

I saw your original question; but I'm still scratching my head at a  
possible answer. Here are two possible answers; the best solution  
might be to combine them. As you saw, Sergey gave a good answer, but  
it is maybe not as complete as you are looking for.

------------------------------------
1) I guess one could:
	- use many boxes; if you modelled, say, 100x100x100 boxes, things  
might look better.
	- you could use Spheres; with many Spheres, one might get a better  
visual approach (and, you could
	  change the radius of the spheres, which might help in composition;  
a "solution" of, say, 1000x1000x1000
	spheres might make an interesting visual scene.

The FreeWRL test #33.wrl has transparent cones. (note, there was a  
sorting bug in FreeWRL which has been fixed in CVS and, I believe in  
the latest releases) Here is a direct link to 33.wrl:

http://freewrl.cvs.sourceforge.net/viewvc/freewrl/freewrl/freewrl/tests/33.wrl?view=log

(click on the "download" button to get the test). This test was  
written by a computer program; if you go through and do the following,  
it may show you what is possible:

change all nodes, to Spheres, radius 0.75, and transparency 0.9;
move viewpoint back a bit (say, to 0,0,30)

Here is a code snippet from the first of 726 shapes in that file.

Transform { translation -5 -5 0 children  DEF SHAPE Shape { appearance  
Appearance {
         material Material {
         diffuseColor 0.000000 0.000000 0.000000
transparency 0.9 }
         }
  geometry Sphere {radius 0.75}
}
}

-----------------------------------
2) I might be tempted to write a Shader. What I might do is to write a  
shader with the above program, such that if the vertex normal is not  
pointing kind of at the viewer, I'd throw the vertex away. That way,  
you'd get the front of the Spheres, and the remainder would be  
discarded. With many spheres, you'd have a liquid that you could see  
through, but as only parts of the spheres would be visible, you would  
get "particles"

Google "toon shader" for a possible building block;  I also put on a  
test for the last Web3D Consortium with a shader example with a  
modified toon shader, available here:

http://freewrl.sourceforge.net/simpleShader.zip

------------------------------------

Tell us how it goes; you have an interesting problem here!


-----------------------------------------------------------
John A. Stewart
Team Leader: Networked Virtual Reality
alex.stewart at crc.ca

Network Systems and Technologies -
         Systemes et technologies des reseaux
Communications Research Centre Canada  |
          Centre de recherches sur les communications Canada

3701 Carling Ave.  |  3701, avenue Carling
PO Box 11490, Station H  |  CP 11490, succursale H
          Ottawa ON K2H 8S2   |  Ottawa (Ontario) K2H 8S2

http://www.crc.ca








More information about the X3D-Public mailing list