Skip to content

Viewport

Jirka Dell'Oro-Friedl edited this page Aug 31, 2022 · 5 revisions

Rendering

A viewport ties a display area to what is actually supposed to be seen there an how. To operate, the viewport needs to know what to render, where to render it to and which camera to use. There can be multiple viewports being used at the same time. Several viewports might render the same graph from different perspectives, or each rendering a completely different graph, they might render their results to different canvases or onto different areas of the same canvas (see Framing)

Transformation

The Framing cascade of the viewport also makes it possible to transform display-locations into locations in the various renderbuffers or the threedimensional world.

Animation

To display continuous movement, a viewport must be rendered periodically. To do so, add an event listener to your applications Loop that invokes a handler function calling the viewports draw-method

Pointer Interaction

While the viewport routes the contents of a graph to an output to stimulate the users visual sensory system, it can also route the users pointer input into the graph to stimulate activities there. Given a pointer event, the viewport can dispatch it to all nodes with a pick component attached that were hit by the event. The event may travel up the graph.

Clone this wiki locally