Skip to content

3b/sb-cga

 
 

Repository files navigation

-*- mode: org; mode: auto-fill -*-

Version 1.0

Porting

Who woulda thunk people want to port this?

Guidelines & Principles
No #+sbcl #-sbcl in source files that exist for other reasons than portability.Nikodemus will not maintain portability: SBCL port will be the canonical one.Uglified code is allowed in shared files if it makes things faster for SBCL.Uglified code is not allowed in shared if it makes code faster for implementation X. (Put it in an implementation specific file instead.)
add ports/sbcl.lisp
Add file to build with feature dep.define SB-CGA::DEFKNOWN as an empty wrapper around SB-C:DEFKNOWN, etc.
add ports/<other-impl>.lisp

These files will define appropriate versions of SB-CGA::DEFKNOWN, etc.

restructure vm1.lisp & vm2.lisp for portability

Probably add vm-<impl>.lisp which should contain the DEFINE-VOP equivalents, so that the load-order would be something like fndb.lisp (defknowns for the whole system), vm-<impl>.lisp (define-vop equivalents for ports that have them), vm-common.lisp (stuff in vm2.lisp, mostly).

Generic port.

Looking at ccl.lisp, aside from the NaN issues a generic port should not be too hard. To work around the unportability of NaN a generic port could maybe use NIL for NaN and most-positive/negative-single-float for infinities.

Switch to plain RT or another test framework.
Rename to CL-CGA, maybe

Iff there are at least two ports with maintainers that use them and will probably continue to do so.

Defsystem

Defpackage

WIP Manual

Format & docstring extraction.
WIP Writing
WIP Overview What SB-CGA is and isn’t. What sort of things may change if you use the repo directly. Design choises relating to single/double floats.WIP VectorsdocstringsUsing dynamic-extentoptimizations doneWIP MatricesdocstringsWIP Root solversdocstringsnew rootsMiscellany

WIP Root Solvers

QUADRATIC-ROOTS-ABOVE
QUADRATIC-ROOTS
CUBIC-ROOTS-ABOVE
CUBIC-ROOTS
QUADRIC-ROOTS-ABOVE
QUADRIC-ROOTS

VEC

VEC type
Additional operations
NORMALIZED-VECNORMALIZED-CROSS-PRODUCTNORMALIZED-TRANSFORM-POINT The reason these seem worthwhile is that they avoid memory traffic – but it is probably not a good idea to expose them as part of the interface!ADJUST-VECImplement VEC-MIN/MAX using MINPS/MAXPS.Tests for these
Predicates
TestsVECPPOINTPVECTOR3PVEC=
Constructors & copiers
TestsALLOC-VECVECCOPY-VEC, %COPY-VECPOINTVECTOR3POINT->VECTOR3VECTOR3->POINT
Arithmetic
VEC+, %VEC+VEC-, %VEC-VEC*, %VEC*VEC/, %VEC/DOT-PRODUCTHADAMARD-PRODUCT, %HADAMARD-PRODUCTVEC-LENGTHVEC-LERPNORMALIZE, %NORMALIZEVEC-MIN, VEC-MAXCROSS-PRODUCT

MATRIX

MATRIX-, MATRIX+
Tests
TRANSFORM-VEC, %TRANSFORM-VEC
MATRIX type
MREF
MATRIXP
WIP MATRIX* (variable arity)
MATRIX x scalar
MATRIX
MAKE-TRANSLATION-MATRIX
MAKE-SCALING-MATRIX
MAKE-ROTATION-MATRIX
MAKE-REORIENTING-MATRIX
TRANSPOSE-MATRIX
INVERSE-MATRIX (orthogonal and affine only)
MAKE-ZERO-MATRIX
MAKE-IDENTIY-MATRIX
MATRIX=

Compiler macros to transform nested operations for less consing.

Consider bang-style public API

Version 2.0

Separate transform type, used double-floats in matrices.

Variable arity in vector arithmetic without memory traffic for intermediate results

About

Computer graphics algebra library for SBCL

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Common Lisp 100.0%