mirror of
https://github.com/overte-org/overte.git
synced 2025-08-05 00:59:56 +02:00
Render circle in 3D space for lookatIndicator. Still not normal to the screen.
This commit is contained in:
parent
6006b8e96b
commit
7ee0d8da2e
4 changed files with 11 additions and 7 deletions
|
@ -1907,9 +1907,12 @@ void Application::renderLookatIndicator(glm::vec3 pointOfInterest, Camera& which
|
|||
|
||||
glColor3f(1.0f, 0.0f, 0.0f);
|
||||
// renderCircle(haloOrigin, 0.1f, glm::vec3(0.0f, 1.0f, 0.0f), 30);
|
||||
// glm::vec3 normal;
|
||||
// _viewFrustum.computeNormalToNearClipPlane(normal);
|
||||
renderCircle(indicatorOrigin, 0.1f, _viewFrustum.getDirection(), 30);
|
||||
loadViewFrustum(_myCamera, _viewFrustum);
|
||||
glm::vec3 normal;
|
||||
_viewFrustum.computeNormalToOffset(normal);
|
||||
|
||||
// Plane::Plane p(_viewFrustum.getOffsetPosition(), _viewFrustum.getOffsetUp(), _viewFrustum.getOffsetRight());
|
||||
renderCircle(indicatorOrigin, 0.1f, normal, 30);
|
||||
}
|
||||
|
||||
void Application::update(float deltaTime) {
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
#include "ViewFrustum.h"
|
||||
#include "VoxelSystem.h"
|
||||
#include "Webcam.h"
|
||||
#include "Plane.h"
|
||||
|
||||
|
||||
class QAction;
|
||||
|
|
|
@ -364,9 +364,9 @@ bool ViewFrustum::matches(const ViewFrustum& compareTo, bool debug) const {
|
|||
return result;
|
||||
}
|
||||
|
||||
void ViewFrustum::computeNormalToNearClipPlane(glm::vec3& normal) const {
|
||||
Plane nearClipPlane(_nearTopLeft, _nearTopRight, _nearBottomLeft);
|
||||
normal = nearClipPlane.getNormal();
|
||||
void ViewFrustum::computeNormalToOffset(glm::vec3& normal) const {
|
||||
Plane offsetPlane(_offsetPosition, _offsetRight, _offsetUp);
|
||||
normal = offsetPlane.getNormal();
|
||||
}
|
||||
|
||||
void ViewFrustum::computePickRay(float x, float y, glm::vec3& origin, glm::vec3& direction) const {
|
||||
|
|
|
@ -83,7 +83,7 @@ public:
|
|||
bool matches(const ViewFrustum& compareTo, bool debug = false) const;
|
||||
bool matches(const ViewFrustum* compareTo, bool debug = false) const { return matches(*compareTo, debug); };
|
||||
|
||||
void computeNormalToNearClipPlane(glm::vec3& normal) const;
|
||||
void computeNormalToOffset(glm::vec3& normal) const;
|
||||
|
||||
void computePickRay(float x, float y, glm::vec3& origin, glm::vec3& direction) const;
|
||||
|
||||
|
|
Loading…
Reference in a new issue