CanvasMap
Getting Started Tutorials 3D Reference

Core Classes for 3D

Below are additional details on the design of the additional classes for the 3D exnteions to CanvasMap.

New areas

The following are new areas (including base classes) for managing 3D maps:

There are also new utilities and other classes:

Core Classes

CM3Item

CMBase Functions

A CM3Item inherits from CMItem and appears in a CM3Scene, CM3Geo, or another CM3Item. CM3Items add:

One problem is that there is significant code in the 2D classes that would be replicated in a number of the 3D classes. In OOD terms, should something like a CM3Layer inherit from it's related parent class or inherit from CM3Item? Since JavaScript does not support muitple inheritance, the classes that can inherit from CM3Item do while other classes inherit from their 2D counterpart and then they replicate the CM3Item funcionality. To limit the amount of code, the CM3Item's functions are represented by static functions that can be called by the other 3D classes. We refer to this as "Item-Like" inheritance.

Overriden functions:

Additional CM3Item functions :

 

 

CM3Scene

Inherits from CMScene rather than CM3Item.