[prev in list] [next in list] [prev in thread] [next in thread] 

List:       vtkusers
Subject:    [vtkusers] (no subject)
From:       Xiaofeng Z <xf10036 () hotmail ! com>
Date:       2010-05-04 4:28:31
Message-ID: COL123-W2120DD506248FE8B74AC36E5F30 () phx ! gbl
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi all,

 

How do I make uniform transparency in a concave polygon, instead of getting multiple \
shades, e.g. in the attached graph?

 

The polygon are created with:

 

vtkPoints* points = vtkPoints::New();

vtkCellArray* cells = vtkCellArray::New();

points->SetNumberOfPoints(4);

 

// create a concave polygon (equilateral with a cutout at the bottom)

points->SetPoint(0, 10.0, 10.0, 0.0);
points->SetPoint(1, 110.0, 183.2, 0.0);

points->SetPoint(2, 210.0, 10.0, 0.0);

points->SetPoint(3, 110.0, 110.0, 0.0);

cells->Allocate(1, 5);

cells->InsertNextCell(5);

cells->InsertCellPoint(0);

cells->InsertCellPoint(1);

cells->InsertCellPoint(2);

cells->InsertCellPoint(3);

cells->InsertCellPoint(0);

vtkPolyData* poly = vtkPolyData::New();

poly->Initialize();

poly->SetGlobalWarningDisplay(1);

poly->SetPoints(points);

poly->SetPolys(cells);

 

A vtkActor2D and a vtkPolyDataMapper2D was used for the rendering.


Many thanks!
Xiaofeng


 		 	   		  
_________________________________________________________________
The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with Hotmail. 
http://www.windowslive.com/campaign/thenewbusy?tile=multicalendar&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5



[Attachment #5 (text/html)]

<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
Hi all,<BR>
&nbsp;<BR>
How do I make uniform transparency in a concave polygon, instead of getting multiple \
shades, e.g. in the attached graph?<BR> &nbsp;<BR>
The polygon are created with:<BR>
&nbsp;<BR><FONT size=2 face=Consolas><FONT size=2 face=Consolas>
vtkPoints* points = vtkPoints::New();<BR>
vtkCellArray* cells = vtkCellArray::New();<BR>
points-&gt;SetNumberOfPoints(4);<BR>
&nbsp;<BR>
// create a concave polygon (equilateral with a cutout at the bottom)</FONT></FONT>
<P><FONT color=#008000 size=2 face=Consolas><FONT color=#008000 size=2 \
face=Consolas><FONT color=#008000 size=2 face=Consolas><BR></FONT></FONT></FONT><FONT \
size=2 face=Consolas><FONT size=2 face=Consolas>points-&gt;SetPoint(0, 10.0, 10.0, \
0.0);</P> points-&gt;SetPoint(1, 110.0, 183.2, 0.0);<BR>
points-&gt;SetPoint(2, 210.0, 10.0, 0.0);<BR>
points-&gt;SetPoint(3, 110.0, 110.0, 0.0);<BR>
cells-&gt;Allocate(1, 5);<BR>
cells-&gt;InsertNextCell(5);<BR>
cells-&gt;InsertCellPoint(0);<BR>
cells-&gt;InsertCellPoint(1);<BR>
cells-&gt;InsertCellPoint(2);<BR>
cells-&gt;InsertCellPoint(3);<BR>
cells-&gt;InsertCellPoint(0);<BR>
vtkPolyData* poly = vtkPolyData::New();<BR>
poly-&gt;Initialize();<BR>
poly-&gt;SetGlobalWarningDisplay(1);<BR>
poly-&gt;SetPoints(points);<BR>
poly-&gt;SetPolys(cells);<BR></FONT></FONT>
&nbsp;<BR>
A vtkActor2D and a vtkPolyDataMapper2D was used for the rendering.<BR>
<BR>Many thanks!<BR>Xiaofeng<BR><BR><BR> 		 	   		  <br /><hr />The New Busy think 9 \
to 5 is a cute idea. Combine multiple calendars with Hotmail.  <a \
href='http://www.windowslive.com/campaign/thenewbusy?tile=multicalendar&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5' \
target='_new'>Get busy.</a></body> </html>


["concavepolygon.png" (image/png)]

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic