<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16441" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Dear vtk gurus,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>One of the standard vtk examples renders a blue
sphere (I attached the code at the end of this mail for reference). The
color of the sphere is set by the command:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV> aSphere->GetProperty()->SetColor(0,0,1); // sphere color blue
,</DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>where aSphere is a vtkActor.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>My question is: How can I color the vertices
of the sphere individually? For example, if I want all triangles
containing the north pole red and the rest blue, how do I do it?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>-- Christian</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>--------------------------------</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Blue sphere example</FONT></DIV>
<DIV>#include "vtkSphereSource.h"<BR>#include "vtkPolyDataMapper.h"<BR>#include
"vtkActor.h"<BR>#include "vtkRenderWindow.h"<BR>#include
"vtkRenderer.h"<BR>#include "vtkRenderWindowInteractor.h"<BR><BR>void main
()<BR>{<BR><BR> // create sphere geometry<BR> vtkSphereSource
*sphere = vtkSphereSource::New();<BR> sphere->SetRadius(1.0);<BR>
sphere->SetThetaResolution(18);<BR>
sphere->SetPhiResolution(18);<BR><BR> // map to graphics
library<BR> vtkPolyDataMapper *map = vtkPolyDataMapper::New();<BR>
map->SetInput(sphere->GetOutput());<BR><BR> // actor coordinates
geometry, properties, transformation<BR> vtkActor *aSphere =
vtkActor::New();<BR> aSphere->SetMapper(map);<BR>
aSphere->GetProperty()->SetColor(0,0,1); // sphere color
blue<BR><BR> // a renderer and render window<BR> vtkRenderer *ren1 =
vtkRenderer::New();<BR> vtkRenderWindow *renWin =
vtkRenderWindow::New();<BR> renWin->AddRenderer(ren1);<BR><BR> //
an interactor<BR> vtkRenderWindowInteractor *iren =
vtkRenderWindowInteractor::New();<BR>
iren->SetRenderWindow(renWin);<BR><BR> // add the actor to the
scene<BR> ren1->AddActor(aSphere);<BR>
ren1->SetBackground(1,1,1); // Background color white<BR><BR> // render
an image (lights and cameras are created automatically)<BR>
renWin->Render();<BR><BR> // begin mouse interaction<BR>
iren->Start();<BR>}<BR></DIV></BODY></HTML>