Kons-9 API Reference

Table of Contents

[in package KONS-9]

1 KONS-9 ASDF System

2 Introduction

Kons-9 is a 3D IDE written in Common Lisp.

This manual aspires to be a full description of the Lisp programming interface to Kons-9. This manual presumes that you are familiar with Common Lisp programming. (If you are not already a Common Lisp hacker then consider reading Practical Common Lisp.)

Beware! This manual is new and incomplete. It will require the contributions of many authors to achieve its goal of completeness. If the documentation you are looking for is not yet written then please consider writing the first draft.

The documentation is prepared using MGL-PAX by Gábor Melis.

Now let's get cracking!

3 Points

Points are three-dimensional coordinates represented as specialized single-float vectors.

Point operations are all non-destructive unless stated otherwise.

3.1 Point arithmetic

Point-arithmetic supports either a point or a scalar on the right-hand-side (VAL).

3.2 Point metrics

3.3 Computing new points

3.4 Vectors as points

Vectors are conveniently represented as points too.

3.4.1 Trigonometry

Trigonometric functions are defined on vectors (represented as points.)

3.5 Geometry operations on points

3.6 Lisp object operations on points

4 Color

Colors are four-channel RGBA values represented as vectors of single-float levels between 0.0 and 1.0.

Operations on colors are non-destructive unless stated otherwise.

5 Matrix

A matrix is a 4x4 array of numbers that represents an affine transformation in 3D space.

6 Shape

Relative.

Absolute.

Special.

6.1 Point cloud

A point-cloud is a shape made up of colored points.

6.1.1 Polyhedron

A polyhedron is a 3D shape formed by flat polygonal faces. The faces of a polyhedron are represented in terms of the vertices of an underlying point-cloud.

Polyhedrons can be constructed to represent (or approximate) many common geometric shapes.

7 Groups (mixin)

7.1 Shape Groups

8 Scene and item

Item

Scene item

Scene

9 Command table

One command table is active at any given time.

Commands and nested command tables are defined using macros.

Here is an example of constructing a command table:

   (let ((table (make-instance 'command-table :title "Example")))
     ;; note: these macros depend on the variable name 'table'
     (ct-entry :C "Make a Cube" (make-cube 2.0))
     (ct-subtable :S "My Submenu" (make-command-table 'my-submenu))
     (entries table))

10 Top-level

Kons-9 runs on a dedicated thread.