瀏覽代碼

Additional camera clarifications

Björn Ritzl 6 年之前
父節點
當前提交
e6be0b454e
共有 1 個文件被更改,包括 7 次插入7 次删除
  1. 7 7
      docs/en/manuals/camera.md

+ 7 - 7
docs/en/manuals/camera.md

@@ -16,7 +16,7 @@ To create a camera, <kbd>right click</kbd> a game object and select <kbd>Add Com
 
 ![create camera component](images/camera/create.png){srcset="images/camera/[email protected] 2x"}
 
-The camera component has the following properties that defines the camera *frustum*:
+The camera component has the following properties that defines the camera *frustum* (perspective camera only):
 
 ![camera settings](images/camera/settings.png){srcset="images/camera/[email protected] 2x"}
 
@@ -86,6 +86,10 @@ An alternative way is to update the position of the game object the camera compo
 
 When the camera has panned, zoomed or changed it's projection from the default orthographic Stretch projection the mouse coordinates provided in the on_input() lifecycle function will no longer match to the world coordinates of your game objects. You need to manually account for the change in view or projection. Converting from mouse/screen coordinates to world coordinates from the default render script is done like this:
 
+::: sidenote
+Both the RenderCam and Orthographic camera extensions mentioned at the top of the document provides functions for converting to and from screen coordinates.
+:::
+
 ```Lua
 -- builtins/render/default.render_script
 --
@@ -101,10 +105,6 @@ local function screen_to_world(x, y, z)
 end
 ```
 
-::: sidenote
-Both the RenderCam and Orthographic camera extensions mentioned at the top of the document provides functions for converting to and from screen coordinates.
-:::
-
 ## Projections
 
 The camera component supplies the render script with a perspective projection. This is well suited for 3D games. For 2D games, it is often desirable to render the scene with *orthographic projection*. This means that the view of the camera is no longer dictated by a frustum, but by a box. Orthographic projection is unrealistic in that it does not alter the size of objects based on their distance. An object 1000 units away will render at the same size as an object right in front of the camera.
@@ -122,8 +122,8 @@ msg.post("@render:", "use_fixed_fit_projection", { near = -1, far = 1 })
 Note that the near and far planes are also specified in the message. The near and far planes set on the camera properties are only used for the perspective projection.
 :::
 
-::: sidenote
-Note that the with an orthographic projection the view will be positioned such that the lower-left corner of the rendered portion of the screen will correspond to the position of the game object the camera component is attached to.
+::: important
+With an orthographic projection the view will be positioned such that the lower-left corner of the rendered portion of the screen will correspond to the position of the game object the camera component is attached to.
 :::
 
 Learn more about the render script and how to change which type of orthographic projection to use in the [Render manual](/manuals/render/#_default_view_projection).