[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [www-vrml] combining textures and materials



>this sounds like a very interesting stuff, do you have something online to
show this?

>>> You could solve the color issue, if you use three underlying planes, 
>>> separate the color image to r,g,b components and texture every planes 
>>> with one component, setting the planes transparent (maybe 0.5)... If 
>>> you need it dynamically, write a php script or a java servlet which 
>>> sends the requested component instead of accessing directly the image

Not yet, give me some days. At the moment i´m totally in business.

The java-servlet method is very easy. 
I used the technology to "paint" medical (proprietary) dicom data directly
onto different surfaces in the x3d/vrml environment (Got to www.3d-node.com
-> Dicom Demo under MedWorld3D)
See the following mini example which works with every browser. Transparency
is set to 0.5. Maybe the coloring is not optimal, but you can play with the
transparency or use  alpha-channels through the java servlet. Everything you
need in the servlet is included in the servlet server system. The
Java-Servlet reads the image (it could also be a png, gif or whatever the
standard java-image class supports or you write your own de/encoder),
separates the channels and creates dynamically a grayscale jpg by using only
a single channel component for all three channels or directly writing
grayscales.
Additionally you could support different output qualitiy settings and more.
For example my Dicom2Jpg Wrapper also supports scaling and the selection of
compression depth. Same procedure would work in php, but i´m a fan of
servlets :-)

...vrml snippet...
 appearance Appearance { 
   material Material { diffuseColor 0 0 1.0 transparency 0.5 }
   texture ImageTexture { url
["http://servletserver.com/jpgservlet?sourceimg=http://localhost/image.jpg&c
omponent=r"] } 
   textureTransform TextureTransform {  } }
 geometry IndexedFaceSet { ccw TRUE solid FALSE coord Coordinate { point [ 1
1 0, 1 -1 0, -1 -1 0,  -1 1 0 ] } coordIndex [ 0, 1, 3, -1, 1, 2, 3, -1 ]
texCoord TextureCoordinate { point [ 1 1, 1 0, 0 0, 0 1 ] } 
...
...
 appearance Appearance { 
   material Material { diffuseColor 0 0 1.0 transparency 0.5 }
   texture ImageTexture { url
["http://servletserver.com/jpgservlet?sourceimg=http://localhost/image.jpg&c
omponent=g"] } 
   textureTransform TextureTransform {  } }
 geometry IndexedFaceSet { ccw TRUE solid FALSE coord Coordinate { point [ 1
1 0.01, 1 -1 0.01, -1 -1 0.01,  -1 1 0.01 ] } coordIndex [ 0, 1, 3, -1, 1,
2, 3, -1 ] texCoord TextureCoordinate { point [ 1 1, 1 0, 0 0, 0 1 ] } 
...
...
 appearance Appearance { 
   material Material { diffuseColor 0 0 1.0 transparency 0.5 }
   texture ImageTexture { url
["http://servletserver.com/jpgservlet?sourceimg=http://localhost/image.jpg&c
omponent=b"] } 
   textureTransform TextureTransform {  } }
 geometry IndexedFaceSet { ccw TRUE solid FALSE coord Coordinate { point [ 1
1 0.02, 1 -1 0.02, -1 -1 0.02,  -1 1 0.02 ] } coordIndex [ 0, 1, 3, -1, 1,
2, 3, -1 ] texCoord TextureCoordinate { point [ 1 1, 1 0, 0 0, 0 1 ] } 






-------------------------------------------------------------------------
for list subscription/unsubscription,
go to http://www.web3d.org/cgi-bin/public_list_signup/lwgate/listsavail.html