From 25c5eac5e6ca1035db1eddd7bea9ac78531da57e Mon Sep 17 00:00:00 2001 From: David Thompson Date: Thu, 28 Dec 2023 11:23:49 -0500 Subject: Delete manuals! Good riddance! These are hosted on files.dthompson.us now! --- manuals/chickadee/Models.html | 167 ------------------------------------------ 1 file changed, 167 deletions(-) delete mode 100644 manuals/chickadee/Models.html (limited to 'manuals/chickadee/Models.html') diff --git a/manuals/chickadee/Models.html b/manuals/chickadee/Models.html deleted file mode 100644 index 4d319a1..0000000 --- a/manuals/chickadee/Models.html +++ /dev/null @@ -1,167 +0,0 @@ - - - - - - -Models (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Next: , Previous: , Up: Graphics   [Contents][Index]

-
-
-

5.3.8 Models

- -

Disclaimer: Chickadee is alpha software, but 3D model support is -even more alpha than that. There are many missing features in both -the model loading and rendering components, so set your expectations -accordingly! -

-

The (chickadee graphics model) module provides procedures to -load and render 3D models in the classic OBJ and more modern glTF 2.0 -formats. -

-

Here’s some basic boilerplate to render a 3D model: -

-
-
(use-modules (chickadee graphics light)
-             (chickadee graphics model)
-             (chickadee graphics skybox))
-
-(define model (load-gltf "Suzanne.gltf"))
-(define camera-position (vec3 0.0 0.0 3.0))
-(define world (make-identity-matrix4))
-(define view (look-at camera-position (vec3 0.0 0.0 0.0) (vec3 0.0 1.0 0.0)))
-(define projection (perspective-projection (/ pi 3.0) (/ 4.0 3.0) 0.1 5.0))
-
-(define (draw alpha)
-  (with-projection projection
-    (draw-model model world view camera-position
-
- -
-
Procedure: load-obj file-name
-

Load the OBJ formatted model in file-name and return a 3D model -object. -

-

OBJ models are rendered using a Phong lighting model, which is a -work-in-progress. -

- -
-
Procedure: load-gltf file-name
-

Load the glTF 2.0 formatted model in file-name and return a 3D -model object. -

-

glTF models are rendered using a physically based lighting model, -which is currently a stub to be implemented later. -

- -
-
Procedure: model? obj
-

Return #t if obj is a 3D model. -

- -
-
Procedure: draw-model model [#:model-matrix] [#:view-matrix] [#:camera-position (vec3 0 0 0)] [#:skybox] [#:lights '()]
-
-

Render model with the transformation matrices model-matrix -and view-matrix applied. camera-position is the world -position of the camera, for correct specular lighting calculations. -skybox is used to apply ambient lighting to the model. -lights contains all of the dynamic lights (see Lights) that -should have an effect on the model. -

- -

Models are composed of simpler data types: meshes, primitives, and -materials. Let’s start with materials. A material controls the -appearance of a 3D object. Is the object a rough stone? Or maybe a -smooth metal? Materials control all of this and more. -

-

There are two types of materials in Chickadee: Phong and PBR. -

-
-
-

-Next: , Previous: , Up: Graphics   [Contents][Index]

-
- - - - - -- cgit v1.2.3