camera.orbit 8
Circles around a point looking at it, starting from the side the camera is on. Call cut right before it to choose where it starts.
Return value
| Return Type | Description |
|---|---|
| void | This function doesn't return anything |
Parameters
| Parameter | Type | Description |
|---|---|---|
| 1 | void | The point to circle around and look at |
| 2 | Number | Horizontal distance of the camera from the point, in meters |
| 3 | Number | Height of the camera above the point, in meters |
| 4 | Number | How much it turns in total: 360 is a full turn, a negative value turns the other way |
| 5 | Number | Duration of the shot |
| 6 | Number | Optional, default 50. Field of view in degrees |
Examples
A flag shown to everybody when it is raised
-- In a phase script: the flag appears and the camera circles around it for 10 seconds
local flag = vec3(-1764.1, 114.1, -2021.3) -- the base of the pole
local top = vec3(-1764.1, 118.1, -2021.3) -- the point to look at
er2.createProp("FlagWaving_1", flag, vec3(0, 0, 0), false, function(prop)
prop:setAlbedo(er2.getFactionFlag(er2.getInvadersFaction()))
end)
camera.orbit(top, 14, 3, 120, 10) -- 14 m away, 3 m above, a third of a turn