Reference no: EM132178460
Vtk /TCL question -Data visualization
The vtkSphereSource class generates a polygonal model of a sphere. create a program to display a white sphere.
Set the ambient and diffuse intensities to 0.5. Then add a for-loop to this program that adjusts the ambient and diffuse color of this sphere so that as the loop progresses, the diffuse color goes from red to blue, and the ambient color goes from blue to green.
You might also try adjusting other lighting parameters such as specular color, ambient, diffuse, and specular intensity.
Using the code developed in step 1, add code to display the sphere with a light source positioned at (1, 1, 1).
Then extend this program by adding a for-loop that will adjust the active camera's clipping range so that increasing portions of the interior of the sphere can be seen
By increasing the first value of the clipping range, you will be adjusting the position of the front clipping plane.
Once the front clipping plane starts intersecting the sphere, you should be able to see inside of it. The default radius of the vtkSphereSource is 0.5, so make sure that you adjust the clipping range in increments less than 1.0.