entity:set-material-texture
List of: Scheme Extensions
Subjects: Entity, Materials, Textures
Contents: Rendering Base

Action: Sets the texture file name in a material associated with a geometric entity.

Filename: rbase/rnd_scm/mat_scm.cxx

APIs: api_rh_set_material_texture

Syntax: (entity:set-material-texture entity filename)

Arg Types: entity entity

filename string

Returns: material

Description: This extension sets the texture file name in a material accosted with the entity. If no named file is found, it returns #f. The color type is set to "wrapped image" and sets its "file name" property to the filename string. See material:set-color-prop for more details.


entity specifies an entity to which the material is attached.


filename specifies the file name of the texture to be attached.

Example: ; entity:set-material-texture

; 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)

;; ()

; Set the texture of the material.

(entity:set-material-texture cyl1 "brick.bmp")

;; ()
PDF/RBASE/02SCA.PDF
HTM/DATA/RBASE/RBASE/02SCA/0018.HTM