Hi all,

I implemented a custom camera controller (implementing the ExaminerViewer camera handling from OpenInventor) and don't know how to select the linearSpeed and the lookSpeed values dependent on the size of the scene as my scenegraph can be changed at runtime. I came up with a solution but it is not working as expected.

    auto heightAngle = theCamera->fieldOfView() / 180.0f * static_cast<float>(M_PI);
    auto focalDist = theCamera->viewVector().length();
    auto height = 2.0f * focalDist * std::tan(heightAngle / 2.0f);
    height = height < 1.0f ? 1.0f : height;
    auto width = height / theCamera->aspectRatio();
    // NDC (left, right, bottom, top) (-1, 1, -1, 1)
    // MagnificationFactor: max(height, width)/linearSpeed()
    auto linearSpeedMagnificationFactor = std::max(height, width)/linearSpeed();

Are there any examples/experiences implementing custom camera controllers?

Thanks in advance,

Cheers, Volker

--

_______________________________________________
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest

Reply via email to