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
In attachment: the file I try to colour

_________________________________________________________________
Cerchi un locale per la serata? Chiedilo a Live Maps!
http://maps.live.it/

Attachment: cubo.wrl
Description: VRML model

-------------------------------------------------------------------------
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