*SetGraphicAttributes()
Sets the visualization properties for the Graphic entity.
Syntax
*SetGraphicAttributes(varname, shade_option,
mesh_option)
Arguments
- varname
- The variable name of the graphic entity.
- shade_option
- Specifies the shading option for the graphic entity.
- mesh_option
- Specifies the mesh line option for display.
Example
Example 1
In the following example, the sphere graphic has its shading turned off and mesh lines
turned
on:
*BeginMDL( the_model, "Model")
*StandardInclude(FILE)
*SetCurrentSolverMode(MotionSolve)
*Point( p_0, "Point 0" )
*Body( b_0, "Body 0", p_0, , , , )
*SetBodyInertia( b_0, 1, 10000, 10000, 10000 )
*Set( b_0.usecm, true )
*Graphic( gsph_0, "Sphere", SPHERE, b_0, p_0, 10 )
*SetGraphicAttributes( gsph_0, OFF, WIREFRAME )
*EndMDL()
Example 2
In the following example, the sphere graphic is assigned a user created color material. The
transparency is set to that of the material using the USE_MATERIAL
keyword.
*BeginMDL( the_model, "Model")
*StandardInclude(FILE)
*SetCurrentSolverMode(MotionSolve)
*Point( p_0, "Point 0" )
*Body( b_0, "Body 0", p_0, , , , )
*Graphic( gsph_0, "Sphere", SPHERE, b_0, p_0, 10 )
*SetBodyInertia( b_0, 1, 10000, 10000, 10000 )
*Set( b_0.usecm, true )
*SetGraphicAttributes( gsph_0, USE_MATERIAL, FREE_EDGE_LINES )
*ColorMaterial( mat_MyMaterial, "My_Material" )
*SetColorMaterialReference( gsph_0, mat_MyMaterial )
*SetColorMaterialComplex( mat_MyMaterial, 0.7, 20, 0.50196, 0.00000, 0.00000, 0.50196, 0.50196, 0.00000, 0.50196, 0.25098, 0.00000, 0.00000, 0.25098, 0.00000 )
*EndMDL()
Example 3
In the following example, attributes of each side of graphic pair in a system is set. The
left graphic display is set to transparent with feature lines, while on the right side the
shading is set to wireframe and the feature lines are turned
on.
*BeginMDL( the_model, "Model")
*StandardInclude(FILE)
*SetCurrentSolverMode(MotionSolve)
*System( sys_0, "System 0", def_sys_0 )
*DefineSystem( def_sys_0 )
*PointPair( p_0, "Point 0" )
*BodyPair( b_0, "Body 0", p_0, , , , )
*GraphicPair( gcyl_0, "Cylinder 0", CYLINDER, b_0, p_0, VECTOR, V_Global_Z, 10, gcyl_0.r1, 10, 0.0, CAPBOTH )
*Set( b_0.usecm, true )
*EndDefine()
*BeginContext( sys_0 )
*SetPoint(p_0, LEFT, 0, -100, 0)
*SetBodyInertia( b_0, LEFT, 1, 10000, 10000, 10000 )
*SetGraphicAttributes( gcyl_0.l, TRANSPARENT, FEATURE_LINES )
*SetGraphicAttributes( gcyl_0.r, OFF, FEATURE_LINES )
*SetColorMaterialReference( gcyl_0.l, mat_violetred4 )
*SetColorMaterialReference( gcyl_0.r, mat_steelblue )
*EndContext()
*EndMDL()
Context
Comments
This statement is used to set the graphic entity display modes. To change the color of the entity, use the *SetColorMaterialReference() statement.
- shade_option
-
- OFF
- Sets no shading and offers 100% transparent display through the graphics.
- OPAQUE
- Sets the shading and provides an opaque display.
- USE_MATERIAL
- Sets the transparency as defined in the material property. Note that, using this option provides the same display as opaque if a color is used. This option is applicable if any material instead of a color is selected using the *SetColorMaterialReference() statement.
- TRANSPARENT
- Sets the display to the MotionView default transparent display.
- mesh_option
-
- WIREFRAME
- Displays the mesh lines in the tessellated graphics.
- FEATURE_LINES
- Displays the prominent feature lines of the tessellated graphics. The feature lines appear at the edge common to adjacent elements having an angle more than 15 degrees between them.
- FREE_EDGE_LINES
- Displays only the free edge lines of the graphic entity, or in other words, the edges that belong to only one element (not shared with any other elements) in the tessellated graphics.
- OFF
- Turns all edge lines off.
This statement is applied on a graphic single only. For graphic pairs, separate statements should be used to set the display properties on each side.