Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Default = Origin(0, 0, 1, 1)
Functions ¶
This section is empty.
Types ¶
type Viewport ¶
Viewport
func Center ¶
Center creates a viewport in which the scene's origin maps to the centre of the view.
By default the projection's scale and camera distance follow the view's width and height, so the scene fills the view and rescales as the view is resized.
Pass an optional dist to lock the projection to that fixed reference distance instead. The scale and camera distance then no longer depend on width and height — those only position the centre — so one world unit projects to a constant number of pixels at any view size. Use this to keep on-screen size from changing as the window resizes; only the first dist value is used. Center(ox, oy, s, s) and Center(ox, oy, w, h, s) coincide when w == h == s.
func Origin ¶
Origin creates a viewport in which the scene's origin aligns with the view's origin ([0, 0]), which is usually the top left.
As with Center, the projection by default follows the view's width and height. Pass an optional dist to lock the scale and camera distance to that fixed reference instead, so on-screen size stays constant as the view is resized (width and height then only place the origin); only the first dist value is used.