ChartDirector Ver 5.0 (PHP Edition)

phpchartdir.cylinderEffect

Usage

cylinderEffect([ orientation [, ambientIntensity, diffuseIntensity, specularIntensity, shininess ]])

Description

A special shading effect that emulates the lighting of a cylinder surface.
This effect adjusts the brightness of the color of a rectangular box to make it look like cylindrical. The brightness is adjusted as according to the Phong lighting model, in which the light source is from the viewer direction and is far away.
The cylinderEffect method returns an integer representing this effect. The integer can be used as the third argument to Box.setBackground to apply the effect to Box objects (including derived objects such as TextBox objects).
This effect is automatically used for cylindrical bars in a BarLayer. You may use this method to adjust the lighting parameters by using its return value as the second argument to Layer.setBorderColor.

Arguments

Argument | Default | Description
--- | --- | ---
orientation | Center | The orientation of the cylinder. A value of Top or Bottom means the cylinder is vertical. A value of Left or Right means the cylinder is horizontal. A value of Center means the orientation is automatically determined. For a BarLayer, the orientation will be the same as the orientation of the bars. For other objects (eg. TextBox objects), if the object height is bigger than its width, the cylinder will be treated as vertical, otherwise it will be treated as horizontal.
ambientIntensity | 0.5 | The ambient reflection coefficient of the Phong lighting model.
diffuseIntensity | 0.5 | The diffuse reflection coefficient of the Phong lighting model.
specularIntensity | 0.75 | The specular reflection coefficient of the Phong lighting model.
shininess | 8 | The shininess coefficient of the Phong lighting model.

Return Value

An integer representing the cylinder effect.

© 2009 Advanced Software Engineering Limited. All rights reserved.