Resolve "Kamera - Erstellung und Handling"
Closes #35 (closed)
Merge request reports
Activity
- A deleted user
changed milestone to %Texture Cube
added 1 commit
- 199adb36 - [#35 (closed)] initial work on camera objects
added 7 commits
- a26f9a0a - [#14 (closed)] add event struct
- 05cb8f79 - [#14 (closed)] add basic events to window
- 3dc17e38 - [#14 (closed)][Code] move pollEvents to Core.beginFrame()
- da91ed91 - [#14 (closed)] add event boilerplate for swapchain recreation
- f2d4b9d8 - [#14 (closed)] add example code for window event
- 639385be - [#14 (closed)] add header so MSVC can compile
- 639f5f75 - Merge remote-tracking branch 'origin/14-eventpoll-mit-lambdas' into...
Toggle commit listadded 1 commit
- 79d415f8 - [#35 (closed)] worked on camera class/trackball camera class and camera application in main.cpp
added 1 commit
- 9ddd711f - [#35 (closed)] add mouse scroll event, mouse move functionalities
added 1 commit
- a6b6fbb1 - [#35 (closed)] Moved code into own module directory, added submodule, removed glfw dependency
added 1 commit
- 2a64c0a1 - [#35 (closed)] Fixed triangle application using cameras
Die Kamera könnte von außen folgendermaßen eingebunden werden.
vkcv::Camera cam; bind_camera(window, cam); unbind_camera(window, cam);
Dafür braucht die Kamera nicht zwangsweise zu wissen, was ein Window ist oder wie Events funktionieren, wenn man
bind_camera()
undunbind_camera()
als Preprocessor-Commands definiert:#define bind_camera(window, cam) do {\ window.e_key.add(cam.onKey);\ window.e_mouseMove.add(cam.onMouseMove);\ } while(0);
..oder so ähnlich. Die Schleife ist bloß, damit alles in einem Code-Block zusammen ist.
added 1 commit
- f9be0060 - [#35 (closed)]Hacked camera into push constants
added 2 commits
- f95d9d9f - [#35 (closed)] Added framework as dependency of module
- 06fe11dc - Merge branch '35-kamera-erstellung-und-handling' of...
added 1 commit
- d41529a5 - [#35 (closed)] created CameraManager class and managed event handler
added 1 commit
- fa7a669f - [#35 (closed)] removed members and read + write from viewMatrix
CameraManager.cpp Zeile 70: setFront(direction) verändert die view matrix. Die view matrix wird bei der Rekunstruktion der Position benutzt und da die verändert wurde, verändert sich auch die Position, die dann abdriftet. Ich würde empfehlen die Position getrennt zu speichern, aus der Matrix zu lesen macht oft solche Probleme.
Das ist ja der Bug, das setFront() die Position beeinflusst. Die Position wird nicht explizit abgespeichert, sondern immer nur aus der ViewMatrix berechnet. Da in der ViewMatrix die Position aber in Kamera-Koordinaten drin steht muss das in Weltkoordinaten gerechnet werden. Dafür muss der 3x3 Teil der ViewMatrix invertiert werden. Da setFront() auch direkt in die ViewMatrix schreibt verändert das die Inverse und damit die nächste Berechnung der Position.
added 2 commits
- d54f0064 - [#35 (closed)][Fix] remove setting of camera pos and front
- 758c1e74 - [#35 (closed)] remove setFront and setPosition functions
added 1 commit
- 99cf27e5 - [#35 (closed)] refactor Camera to move functions to camera.cpp