Sorry for spam ... bad connection












Hi all,
I need to colour vertexes of a wrl file. This file has a ChunkMaterial with one 
MaterialChunk.
Here is the code I use to do that:

*********************************************
...

ChunkMaterialPtr chunkMaterial = ChunkMaterialPtr::dcast(geo->getMaterial());
MaterialChunkPtr chunk = 
MaterialChunkPtr::dcast((chunkMaterial->getChunks()).front());
chunk->setLit(true);
chunk->setColorMaterial(GL_DIFFUSE);
chunk->setBackColorMaterial(GL_DIFFUSE);

...

GeoColors3fPtr colors = GeoColors3f::create()
beginEditCP(colors);
while(...)
  if(...)
     colors->addValue(Color3f(1, 0, 0));
  else(...)
     colors->addValue(Color3f(0, 1, 0));
endEditCP(colors);    

...
beginEditCP(geo);
   geo->setColors(colori);
endEditCP(geo);

********************************************************


The result is always a gray-colored mesh. I tried also to change material into 
SimpleMaterial but no changes.
I have no problem if I use a .raw file.

Can anybody write down a simple example?
Cheers


_________________________________________________________________
Screensaver e sfondi… Scaricali dallo Spaces di Doretta!
https://cid-97b0d995232b954a.skydrive.live.com/home.aspx
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to