Re: [Interest] Drawing Frustum on Scene3D

2021-03-06 Thread Mike Krus via Interest
Hi

in Qt 3D you can use a QGeometryRenderer with primitiveType set to Lines (or 
LineLoop, LineStrip depending on how you structure your data). Checkout 
https://code.qt.io/cgit/qt/qt3d.git/tree/tests/manual/raycasting-qml/LineEntity.qml


Mike

> On 5 Mar 2021, at 14:16, Alex john  wrote:
> 
> But in quick3D that would be done with a class derived from
> QQuick3DGeometry with primitives set to lines
> "setPrimitiveType(QQuick3DGeometry::PrimitiveType::Lines)"
> to construct a cube. Then register that class to qml and use it in
> your View3D. Hope it helps.
> 
> Any alternative to QQuick3DGeometry as I'm using 5.10?
> 
> On Fri, Mar 5, 2021 at 5:00 PM joao morgado  wrote:
>> 
>> Hi
>> 
>> That frustum is just a group of lines in cube shape, you see it as a frustum 
>> because the camera is in perspective mode.
>> I never used Qt3D so cannot help with scene3d.
>> But in quick3D that would be done with a class derived from QQuick3DGeometry 
>> with primitives set to lines 
>> "setPrimitiveType(QQuick3DGeometry::PrimitiveType::Lines)"
>> to construct a cube. Then register that class to qml and use it in your 
>> View3D. Hope it helps.
>> 
>> João
>> Em sexta-feira, 5 de março de 2021 09:46:15 GMT, Alex john 
>>  escreveu:
>> 
>> 
>> Hello Qt
>> 
>> I like to render a frustum as here https://imgur.com/a/BzmCQ2D on
>> Scene3d. Can you let me know how it can be done? If I have to get the
>> custom QML ,do I have to get it from the C++ and then push it to the
>> QML context? Any pointers to basic code is appreciated.
>> 
>> Thanks.
>> ___
>> Interest mailing list
>> Interest@qt-project.org
>> https://lists.qt-project.org/listinfo/interest
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest

—
Mike Krus | mike.k...@kdab.com | Senior Software Engineer & Teamlead
KDAB (UK) Ltd., a KDAB Group company
Tel: UK Office +44 1625 809908   Mobile +44 7833 491941
KDAB - The Qt Experts, C++, OpenGL Experts




smime.p7s
Description: S/MIME cryptographic signature
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Drawing Frustum on Scene3D

2021-03-05 Thread Alex john
But in quick3D that would be done with a class derived from
QQuick3DGeometry with primitives set to lines
"setPrimitiveType(QQuick3DGeometry::PrimitiveType::Lines)"
to construct a cube. Then register that class to qml and use it in
your View3D. Hope it helps.

Any alternative to QQuick3DGeometry as I'm using 5.10?

On Fri, Mar 5, 2021 at 5:00 PM joao morgado  wrote:
>
> Hi
>
> That frustum is just a group of lines in cube shape, you see it as a frustum 
> because the camera is in perspective mode.
> I never used Qt3D so cannot help with scene3d.
> But in quick3D that would be done with a class derived from QQuick3DGeometry 
> with primitives set to lines 
> "setPrimitiveType(QQuick3DGeometry::PrimitiveType::Lines)"
> to construct a cube. Then register that class to qml and use it in your 
> View3D. Hope it helps.
>
> João
> Em sexta-feira, 5 de março de 2021 09:46:15 GMT, Alex john 
>  escreveu:
>
>
> Hello Qt
>
> I like to render a frustum as here https://imgur.com/a/BzmCQ2D on
> Scene3d. Can you let me know how it can be done? If I have to get the
> custom QML ,do I have to get it from the C++ and then push it to the
> QML context? Any pointers to basic code is appreciated.
>
> Thanks.
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Drawing Frustum on Scene3D

2021-03-05 Thread joao morgado via Interest
 Hi

That frustum is just a group of lines in cube shape, you see it as a frustum 
because the camera is in perspective mode.I never used Qt3D so cannot help with 
scene3d. But in quick3D that would be done with a class derived from 
QQuick3DGeometry with primitives set to lines 
"setPrimitiveType(QQuick3DGeometry::PrimitiveType::Lines)"to construct a cube. 
Then register that class to qml and use it in your View3D. Hope it helps.

JoãoEm sexta-feira, 5 de março de 2021 09:46:15 GMT, Alex john 
 escreveu:  
 
 Hello Qt

I like to render a frustum as here https://imgur.com/a/BzmCQ2D on
Scene3d. Can you let me know how it can be done? If I have to get the
custom QML ,do I have to get it from the C++ and then push it to the
QML context? Any pointers to basic code is appreciated.

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


[Interest] Drawing Frustum on Scene3D

2021-03-05 Thread Alex john
Hello Qt

I like to render a frustum as here https://imgur.com/a/BzmCQ2D on
Scene3d. Can you let me know how it can be done? If I have to get the
custom QML ,do I have to get it from the C++ and then push it to the
QML context? Any pointers to basic code is appreciated.

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