[Interest] How to set absolute Qt3D::QCamera rotation/orientation

Sean Harmer sean.harmer at kdab.com
Fri Jun 17 12:56:23 CEST 2016


Hi,

On Friday 17 June 2016 13:36:40 Oleg Evseev wrote:
> Qt3DRender::QCamera as an QEntity has QTransform component. You can get it
> with help of Qt3DCore::QTransform *transform() const function and then
> setTranslation, setRotation or setMatrix for it as you wish.
> 
> Maybe that is what are you looking for?

Sorry didn't see this as I was away on vacation when it arrived and got lost 
in my backlog.

Yes, as Oleg suggests or make your own QEntity subclass that aggregates a 
QTransform and QCameraLens and give it the API you need. All the renderer 
looks for in a camera is a QCameraLens for the projection matrix and a 
transform for the view matrix.

If you'd like to see some more convenience API on QCamera itself then please 
file a JIRA with your suggestions.

Cheers,

Sean

> 
> Regards, Oleg.
> 
> 2016-06-08 14:32 GMT+03:00 Ola Røer Thorsen <ola at silentwings.no>:
> > I need to set a Qt3D::QCamera orientation directly. I've got the position
> > in a QVector3D and the rotation in a QQuaternion. I can't seem to find any
> > API for this. The "rotate"-function just adds my quaternion to the
> > existing
> > orientation which is not what I'm looking for. Is there some better way to
> > do this?
> > 
> > Cheers,
> > Ola
> > 
> > 
> > 
> > 
> > _______________________________________________
> > Interest mailing list
> > Interest at qt-project.org
> > http://lists.qt-project.org/mailman/listinfo/interest

--
Dr Sean Harmer | sean.harmer at kdab.com | Managing Director UK
Klarälvdalens Datakonsult AB, a KDAB Group company
Tel. UK +44 (0)1625 809908, Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-independent software solutions



More information about the Interest mailing list