Create, Compete & Win at Redbrick Connect 2024! 🎉

Perspective cameras

This is the commonly used camera class.

The Perspective Camera also inherits from Object3D, so in addition to the properties and functions described below, you can also use the properties and functions that exist in THREE.Object3D and THREE.Object3D.PerspectiveCamera.

Setting Camera Parameters

  1. Add any object to the scene.
  2. Select the camera in the left object panel.
  3. Adjust the detailed parameters (position, angle, distance, etc.) of the camera in the right property panel.
  4. Check how it will appear in the actual game through the camera view.

Setting detailed camera parameters


scriptlist

Properties

.fov

.fov : Float

Represents the vertical field of view of the camera, meaning the angle of view from bottom to top.
The default value is 50, and you can adjust this value to change the field of view width.

.far

.far : Float

Represents the far plane of the perspective camera.
Objects farther than this value will not be rendered.
The default value is 1000, and you can adjust this value to control the rendering distance.

.near

.near : Float

Represents the near plane of the perspective camera.
Objects closer than this value will not be rendered.
The default value is 0.1, and you can adjust this value to control the rendering distance.

Methods

.updateProjectionMatrix()

.updateProjectionMatrix () : undefined

If you change the camera parameters(.fov, .far, .near) through code within the script, you need to use this method to immediately apply the changes.

example
const camera = WORLD.getObject("MainCamera");
 
camera.fov = 100;
camera.near = 3;
camera.far = 1500;
 
camera.updateProjectionMatrix(); //updateProjectionMatrix()로 변경된 값을 업데이트
⚠️

It is not necessary if you modify the values in the object property panel.