Canvas 2½D

(Copyright Philip Quaife April 2007)

Version 1.0



Abstract

There are numerous improvements that could be made to the Tk canvas widget. There have been repeated requests for the addition of scalable images, rotated text, and gradient fills, however there has been no will in the Tcl community to effect any signification change.
There have been a number of attempts to create a Next Generation canvas, dating as far back as 1996 with a 3D attempt. More recently there has been 3dcanvas by Dr R Hipp. None of these efforts have received widespread usage. Mostly this has been I believe because the new canvas widgets all used a different API to the Tk canvas. This requires modifying the existing application code to make use of the new canvas features.

Design Rational

The design of this widget is based on the Togl widget written by Brian Paul and Benjamin Bederson in 1996. Along with the Tclogl package by Paul Obermier in 2005 which wraps the GL API, allowing it to be called from within TCL. This widget allows full 3D rendering capability using a well known standard for graphics generation. Most modern computer systems have dedicated hardware for rendering 3D graphic primatives so that 3D graphics can be performed at the same speed as 2D. The API is designed to be 100% compatible with the Tk Canvas. This allows existing code to run unmodified as well as providing exentions that new code can use for added effects.

API

The API is a replica of the Tk Canvas widget. See the Tk documentation for a description of the Tk canvas widget.
The following man page describes the extensions to the GLCanvas widget.

A demonstration starkit Canvas2½d.kit is available to run under the tcl3dsh runtime available from tcl3d.org

Screenshots


The program that created the above screen shot is here


Back To TCL index