SchemeExt:Entity:material-reflection
From DocR23
Contents |
Action
Gets the reflection properties of the material associated with a geometric entity.
Filename
scm/scmext/rnd/mat_scm.cpp
APIs
api_rh_get_material_reflection
Syntax
(entity:material-reflection entity)
Argument Types
| Argument | Scheme Data Type |
|---|---|
| entity | entity |
Returns
(real, real, real, real)
Errors
Returns boolean #f if the material or material-reflection cannot be found.
Description
This extension returns the material reflection properties (if any) associated with the entity. The first three real values returned are the ambient reflection, diffuse reflection, and specular reflection, respectively, which range from 0 to 1. The last real value returned is the exponent.
Arguments
- entity specifies an entity to be queried.
Example
; entity:material-reflection ; Create a solid cylinder. (define cyl1 (solid:cylinder (position 0 0 0)(position 30 30 0) 20)) ;; cyl1 ; Determine if the cylinder has a material. (entity:material cyl1) ;; #f ; Create a material. (define matter1 (material)) ;; matter1 ; Set the material. (entity:set-material cyl1 matter1) ;; () ; Get the default material reflection properties. (entity:material-reflection cyl1) ;; (1 0.75 0.5 10)