axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Axiom-developer] alternative geometry/graphics framework


From: Martin Baker
Subject: [Axiom-developer] alternative geometry/graphics framework
Date: Wed, 8 Sep 2010 17:46:29 +0100
User-agent: KMail/1.13.5 (Linux/2.6.34-12-desktop; KDE/4.4.4; x86_64; ; )

I have written an alternative geometry/graphics framework.

I have put links to the code and documentation at the bottom of this
page here:
http://www.euclideanspace.com/maths/standards/program/mycode/graph/

It is based on a scenegraph structure which allows
lines, surfaces and higher dimensional structures to be defined and
modified by transforms, clipping boxes, material (line width, colour and
so on) which control individual nodes or whole branches in the
scenegraph. This means that, for example, transforms can be applied
continuously to a whole branch without altering the nodes in that branch,
this means that we can avoid a cumulative build up of floating point errors
when many transforms are applied.

This framework supports all the 2D and 3D draw and plotting that the
existing framework supports. Use of transforms in the scenegraph means that
many plots can be combined together, either overlayed or next to each other
and combined with various show scales, grids text annotations and so on.

The framework supports:
* Different algebras: vector, matrix, complex numbers and Clifford Algebra.
* Different geometries: Euclidean, projective, conformal (hyperbolic to be
  added later)
* Different coordinate systems: Cartesian coordinates, Argand Plane,
  Spherical, Cylindrical.
* Different number of dimensions: 2,3 (4 and more to be added)

The aim is not just to draw plots but also to allow experimentation with
arbitrary shapes being transformed, for instance to transform a given shape
by reflecting in a circle. To see the sort of thing I am trying to do here
see first chapter of [Dorst,Fontijne & Mann 2007] except this is not just
limited to Clifford algebra and conformal space.

Currently Axiom/FriCAS has domains that represent transforms:
(for example: dhmatrix.spad.pamphlet, moebius.spad.pamphlet and so on) but
they are just standalone domains which don't fit into a wider graphics
framework so it is more difficult to combine them with other things and
to experiment. The aim of this framework is to create a way for geometry
and graphics related entities to interwork.

This scenegraph framework currently exports to file formats like: SVG,X3D,
VRML and Wavefront(obj) but currently there is not the capability to interact
directly in a graphical way, that is, there is no xwindow support. The
existing graphics framework allows user interaction in a very limited way in
that the graphics can be displayed in an xwindow and there is then the
ability to do simple transforms like pan and zoom.
However this is not suitable for the new framework because the existing
framework builds a data structure to represent the graphics
using SPAD and then passes this to 'C' code. The 'C' code then does the pan,
zoom and so on and can then save to a file format.

Apart from being very messy trying to mix different languages, this would not
work for the new framework because:
* We want to use non-linear as well as linear transforms.
* I would like to be able to work with discontinuous (fractal) shapes.
* I want to use different algebras such as vector, matrix, complex numbers
  and Clifford algebras and I would not want to implement these algebras
  using 'C'.

Possible options might be:
* Implement an OpenGL canvas in SPAD which allows SPAD to directly output to
  OpenGL (a thin wrapper for OpenGL calls) and also to read and process mouse
  position.
* Implement Axiom/FriCAS as library code that can be called from other
  languages.
* Implement some form of two-way API which allows other programs to use SPAD
  algebra.

Bill Page mentioned that there is an OpenGL binding for lisp.
http://common-lisp.net/project/cl-opengl/
http://repo.or.cz/w/cl-glfw.git
Would it be possible to create a thin wrapper to allow these functions to be
called from SPAD?
OpenGL consists of a couple of hundred function calls but this would only need
a small subset of those (because transforms would be done by SPAD and not 
OpenGL).
We would also need the ability to read mouse movements from SPAD to allow user
interaction.

Do you think this would be possible?

Martin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]