[vtkusers] Problem getting opacity values to work

Nigel Nunn nNunn at ausport.gov.au
Fri Feb 14 13:05:52 EST 2003


Hi Shawn, 
The division of integers will be part of the problem. 
Try casting both numerators and denominators to double: 
 
  test_opac1 = (test_opac1 - (double(i)/1000.0));
  test_opac2 = (test_opac2 + (double(i)/1000.0));
 
With a debugger, look at the values actually passed 
in test_opac1 and test_opac2;  the integer division 
will produce either zero or 1:

for (i = 0; i < 1400; ++i)
{
  // render the image
  test_opac1 = (test_opac1 - (i/1000));   <--- [1,0] 
  test_opac2 = (test_opac2 + (i/1000));   <--- [0,1] 
  test->SetOpacity(1,test_opac1); 
  test->SetOpacity(2,test_opac2); 
  renderWin->Render(); 
  renderer1->SetActiveCamera(camera); 
} 
 
Nigel 
 
 

Don't miss out on the Our Sporting Future forum, to be held in
Melbourne from March 12-14 2003.  Developed by the Australian
Sports Commission to examine contemporary issues and explore
growth opportunities in sport, the forum will investigate what
needs to be done in sport at all levels to build a relevant,
sustainable and progressive industry in the 21st century.
For more information or to register on-line, go to
http://www.oursportingfuture.im.com.au or call 07 3858 5579.

**********************************************************************
This message is intended for the addressee named and may contain 
confidential and privileged information. If you are not the intended 
recipient please note that any form of distribution, copying or use of 
this communication or the information in it is strictly prohibited and 
may be unlawful. If you receive this message in error, please delete it 
and notify the sender.

Keep up to date with what's happening in Australian sport.
Visit http://www.ausport.gov.au
**********************************************************************



More information about the vtkusers mailing list