Set Camera: Difference between revisions

Create infobox, and change details
(Created page with "Sets the position, rotation (angle) and range of the camera. Works in two modes: orthographic (isometric) and perspective. /uploads/Set Camera.png === Inputs === * Position: The coordinate of the camera's *focus* (defaults to the center of the world) * Rotation: The camera angle (defaults to a [true isometric](https://en.wikipedia.org/wiki/Isometric_video_game_graphics) view of 35.264,45,0) * Range: This value depends on the mode of the...")
 
(Create infobox, and change details)
Line 1: Line 1:
{{Block
|image=Set_Camera.png
|type=s
|folder=Game
|input1={{Port|e|Before}}
|input2={{Port|v|Position}}
|input3={{Port|r}}
|input4={{Port|n|Range}}
|output1={{Port|e|After}}
}}
Sets the position, rotation (angle) and range of the camera. Works in two modes: orthographic (isometric) and perspective.
Sets the position, rotation (angle) and range of the camera. Works in two modes: orthographic (isometric) and perspective.


[[width=336px,alt=Set Camera|/uploads/Set Camera.png]]
== Notes ==
 
=== Inputs ===


* Position: The coordinate of the camera's *focus* (defaults to the center of the world)
The camera's default position and rotation are the center of the world and [https://en.wikipedia.org/wiki/Isometric_video_game_graphics true isometric] (approximately<code>35.264, 45, 0</code>) angle respectively.
* Rotation: The camera angle (defaults to a [true isometric](https://en.wikipedia.org/wiki/Isometric_video_game_graphics) view of 35.264,45,0)
* Range: This value depends on the mode of the camera


=== Settings ===
== Settings ==


The camera uses the orthographic mode by default. If you look at the bottom right side of the hotbar, you'll find the perspective switch.
The camera uses the orthographic mode by default. The perspective switch can be found at the bottom-right of the hotbar.


[[File:perspective-camera-switch.png]]
[[File:Set_Camera_perspective_button.png]]


=== Modes ===
== Modes ==


==== Orthographic mode ====
=== Orthographic mode ===


Using this mode is quite easy. To calculate the Range input, multiply the amount of blocks you need to fit on the screen by 5.  
To calculate the Range input, multiply the amount of blocks needed to fit on the screen by 5.  


[[File:ortho-camera-range.png]]
[[File:Set_Camera_orthographic_range.png]]


==== Perspective mode ====
=== Perspective mode ===


Range is the angle of the bisecotor of the [Field of View](https://en.wikipedia.org/wiki/Field_of_view_in_video_games) of the camera. The FoV of a human is considered 120°, so if you want to make first-person games, use 60° as Range. The minimum and maximum is 1-65 (inclusive).
Range is the angle of the bisector of the [https://en.wikipedia.org/wiki/Field_of_view_in_video_games Field of View] of the camera. The FoV of a human is considered 120°, so if you want to make first-person games, use 60° as Range. The minimum and maximum is 1-65 (inclusive).


[[File:perspecive-camera-range.png]]
[[File:Set_Camera_perspective_range.png]]


==== Comparison ====
=== Comparison ===


[[File:camera-modes-comparison.jpg]]
[[File:Set_Camera_modes_comparison.jpg]]


=== Tips ===
== Tips ==


If you want to adapt your 2D game to the perspective view, this is the way to do it. (The Size variable defines the amount of blocks you want to fit)
If you want to adapt your 2D game to the perspective view, this is the way to do it. (The Size variable defines the amount of blocks you want to fit)


[[File:2d-scene-to-perspective.png]]
[[File:Set_Camera_2D_game_to_perspective.png]]




[[Category:Blocks]]
[[Category:Blocks]]