# Difference between revisions of "GEF3D Coordinate Systems"

Line 1: | Line 1: | ||

In GEF, there usually is one global coordinate system and figure-local coordinate systems to deal with. Generally, mouse coordinates can be translate to the global coordinate system and the figure-local coordinate systems in a simple and straightforward fashion, and users of the framework seldomly have to deal with these issues. In GEF3D however, there are more coordinate systems involved and dealing with those can become cumbersome. This article aims to describe the concepts of coordinate systems and coordinate system conversion in GEF3D. | In GEF, there usually is one global coordinate system and figure-local coordinate systems to deal with. Generally, mouse coordinates can be translate to the global coordinate system and the figure-local coordinate systems in a simple and straightforward fashion, and users of the framework seldomly have to deal with these issues. In GEF3D however, there are more coordinate systems involved and dealing with those can become cumbersome. This article aims to describe the concepts of coordinate systems and coordinate system conversion in GEF3D. | ||

− | |||

− | |||

− | |||

− | |||

− | |||

− | |||

− | |||

− | |||

− | |||

− | |||

− | |||

− | |||

− | |||

− | |||

− | |||

− | |||

− | |||

== Coordinate Systems == | == Coordinate Systems == | ||

=== Screen Coordinates === | === Screen Coordinates === | ||

+ | also called mouse coordinates in GEF or window coordinates in OpenGL | ||

=== Global World Coordinates === | === Global World Coordinates === | ||

+ | 3D coordinates in world space | ||

==== Inverted Coordinate System ==== | ==== Inverted Coordinate System ==== | ||

+ | origin seems to be in the upper left / front corner | ||

==== Figure-local 3D Coordinates ==== | ==== Figure-local 3D Coordinates ==== | ||

=== Surface Coordinates === | === Surface Coordinates === | ||

+ | 2D coordinates on the surface of a 3D host figure | ||

==== Figure-local 2D Coordinates ==== | ==== Figure-local 2D Coordinates ==== | ||

+ | only applies to embedded 2D editors | ||

== Coordinate Conversion == | == Coordinate Conversion == | ||

+ | * global world coordinates <-> figure-local 3D coordinates | ||

+ | * surface coordinates <-> global world coordinates | ||

+ | * screen coordinates + depth value -> global world coordinates | ||

+ | * screen coordinates -> figure-local 3D coordinates | ||

+ | * screen coordinates -> surface coordinates | ||

== Embedded 2D GEF Editors == | == Embedded 2D GEF Editors == | ||

=== Make Yourself at Home: Creating a Fake 2D Environment === | === Make Yourself at Home: Creating a Fake 2D Environment === | ||

Coordinate conversion, Virtual picking, modified SWT events | Coordinate conversion, Virtual picking, modified SWT events |

## Revision as of 04:03, 29 June 2009

In GEF, there usually is one global coordinate system and figure-local coordinate systems to deal with. Generally, mouse coordinates can be translate to the global coordinate system and the figure-local coordinate systems in a simple and straightforward fashion, and users of the framework seldomly have to deal with these issues. In GEF3D however, there are more coordinate systems involved and dealing with those can become cumbersome. This article aims to describe the concepts of coordinate systems and coordinate system conversion in GEF3D.

## Coordinate Systems

### Screen Coordinates

also called mouse coordinates in GEF or window coordinates in OpenGL

### Global World Coordinates

3D coordinates in world space

#### Inverted Coordinate System

origin seems to be in the upper left / front corner

#### Figure-local 3D Coordinates

### Surface Coordinates

2D coordinates on the surface of a 3D host figure

#### Figure-local 2D Coordinates

only applies to embedded 2D editors

## Coordinate Conversion

- global world coordinates <-> figure-local 3D coordinates
- surface coordinates <-> global world coordinates
- screen coordinates + depth value -> global world coordinates
- screen coordinates -> figure-local 3D coordinates
- screen coordinates -> surface coordinates

## Embedded 2D GEF Editors

### Make Yourself at Home: Creating a Fake 2D Environment

Coordinate conversion, Virtual picking, modified SWT events