File: TestPythonCamera.py

package info (click to toggle)
f3d 1.3.1%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 20,420 kB
  • sloc: cpp: 28,581; sh: 306; xml: 155; python: 65; makefile: 21; javascript: 17
file content (37 lines) | stat: -rw-r--r-- 842 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import f3d

engine = f3d.engine(f3d.window.NATIVE_OFFSCREEN)
camera = engine.getWindow().getCamera()

# Behavior is tested in the SDK test, test only the bindings

# TODO Once angle_deg_t is an actual struct, this will need to be changed
angle = 30
camera.setViewAngle(angle)
camera.getViewAngle(angle)
angle = camera.getViewAngle()

point = f3d.point3_t(0, 0, 0)
camera.setPosition(point)
camera.getPosition(point)
point = camera.getPosition()

camera.setFocalPoint(point)
camera.getFocalPoint(point)
point = camera.getFocalPoint()

vector = f3d.vector3_t(0, 0, 1)
camera.setViewUp(vector)
camera.getViewUp(vector)
vector = camera.getViewUp()

camera.dolly(10)
camera.roll(angle)
camera.azimuth(angle)
camera.yaw(angle)
camera.elevation(angle)
camera.pitch(angle)

camera.setCurrentAsDefault()
camera.resetToBounds()
camera.resetToDefault()