KUIML
Blue Cat's User Interface Programming Language
COLOR_SURFACE_3D

Description

This object represents the shape of a surface in a 3D scene with a color scale.

Inherited Attributes

See Attributes Common to 3D Objects. Also, as a surface viewing element, this object shares Attributes Common to Surface Viewers, except the attributes specific to widgets.

Specific Attributes

Name Value Type Default Value Description Comment V. Exp.

low_color

color

#000000 (black)

Color for the min value.


1.6

No

high_color

color

#ffffff (white)

Color for the max value.


1.6

No

Examples

Formula Surface

The example below displays a surface defined by a Math Formula and lets the user change several options for the 3D view. 3D renderer characteristics are also displayed:

doc_ref_3d_objects_color_surface_3d_element_example1.png
<?xml version="1.0" encoding="utf-8" ?>
<SKIN text_color="#ffffff">

	<!-- Custom Viewer definition -->
	<DEFINE>
        <CUS_3D_VIEWER base_type="VIEW_3D" width="600" height="400" grid.opacity=".8" cursor="system::open_hand" 
        y_ratio=".8" z_ratio=".5" transform.tz="-1.3" persistent_viewpoint="true" transform.rx="60" transform.rz="20"/>
 	</DEFINE>
	
	<!-- The formula that defines the surface -->
	<FORMULA_SURFACE formula="cos(2*pi*x)*sin(2*pi*y)*sqrt(1-x^2-y^2)" id="my_formula" x_min="-1" x_max="1" x_default="0" y_min="-1" y_max="1" y_default="0" z_min="-1" z_max="1" z_default="0"/>
	
	<!-- Main layout-->
	<ROW spacing= "5">
        <COLUMN>
            <!-- The 3D Viewer -->
            <CUS_3D_VIEWER id="3d_view">
                <!-- Grid object -->
                <GRID_3D id="3d_view.grid" x_param_info_id="my_formula.x_info" y_param_info_id="my_formula.y_info" z_param_info_id="my_formula.z_info" 
                y_positions_count="11" x_positions_count="11" z_positions_count="11" x_position="-.5" y_position="-.5" z_position="-.5" x_offset=".5" y_offset=".5" z_offset=".5"/>
                <!-- The Color surface-->
                <COLOR_SURFACE_3D id="3d_view.surface" surface_id="my_formula" visible="true" high_color="#ff0000" low_color="#000001" opacity=".8" 
                x_positions_count="100" y_positions_count="100" x_offset=".5" y_offset=".5" z_offset=".5" x_position="-.5" y_position="-.5" z_position="-.5"/>
            </CUS_3D_VIEWER>
        </COLUMN>
        <!-- User Controls-->
        <COLUMN spacing="20">
            <COLUMN spacing="2">
                <!-- Select Objects Opacity -->
                <TEXT value="Opacity:"/>
                <PARAM_TEXT_EDIT_BOX param_id="3d_view.surface.opacity" width="100" background_color="#00000"/>
                <PARAM_TEXT_EDIT_BOX param_id="3d_view.grid.opacity" width="100" background_color="#00000"/>
            </COLUMN>
            <PARAM_TEXT content="3D Style: {text_value}" param_id="3d_view.surface.draw_style" width="100">
                <INVISIBLE_PARAM_MENU_BUTTON param_id="3d_view.surface.draw_style" width="100%" height="100%" cursor="system::hand"/>
            </PARAM_TEXT>
            <!-- Display information about the OpenGL Renderer -->
            <COLUMN spacing="2">
                <TEXT value="OpenGL Renderer:" />
                <TEXT string_id="3d_view.vendor" width="200" height="10" />
                <TEXT string_id="3d_view.renderer" width="200" height="10"/>
                <TEXT string_id="3d_view.version" width="200" height="10"/>
            </COLUMN>
        </COLUMN>
	</ROW>
</SKIN>