[QGIS-Developer] Rendering simple 3D lines
rnathreddy at sanasw.com
rnathreddy at sanasw.com
Tue Dec 14 03:03:36 PST 2021
Dear Nyall,
Hope you are doing well.
We could not see the symbols in 3D View when we symbolize (3D View) the
point layer in QGIS 3.16 version.
The following properties for the point layer are given:
3D View => Single Symbol
Shape => Sphere
Radius => 50.0
Amplitude clamping => Absolute
The same is working fine in QGIS 3.20 and 3.22.
Can you please help us in this regard?
Regards
Raghunath
-----Original Message-----
From: rnathreddy at sanasw.com [mailto:rnathreddy at sanasw.com]
Sent: 08 September 2021 09:39
To: Nyall Dawson
Cc: qgis-developer
Subject: Re: [QGIS-Developer] Rendering simple 3D lines
Dear Nyall,
Thank you very much for your help. I was struggling from the past couple of
days to resolve this issue.
As you said I missed out calling Qgs3D::Initialize () and
Qgs3DAppUtils::initialize() at the startup.
Now it is working.
Regards
Raghunath
On 2021-09-07 20:41, Nyall Dawson wrote:
> On Wed, 8 Sept 2021 at 13:27, <rnathreddy at sanasw.com> wrote:
>>
>> Hi,
>>
>> We are developing a simple 3D viewer to display the DEM and overlay a
>> trajectory (vector layer) as a simple 3d lines. It is working fine
>> and vector file is draped on to the terrain. We want to display the
>> vector file as simple 3d lines.
>>
>> We could see the same in QGIS application by setting the Vector Layer
>> properties 3D View => Render as simple 3D lines.
>>
>> Trying to set same programmatically, but getting the following error.
>>
>> " ..\..\..\src\3d\qgsvectorlayerchunkloader_p.cpp(57) :
>> (QgsVectorLayerChunkLoader::QgsVectorLayerChunkLoader)
>> [15960ms] Unknown
>> 3D symbol type for vector layer: line "
>
> Possibly you are missing a call to Qgs3D::initialize() somewhere in
> your application startup.
>
> Nyall
>
>>
>> The following code snippet used:
>>
>> if (pcLyr != nullptr) {
>>
>> std::unique_ptr< QgsLine3DSymbol > sym = qgis::make_unique<
>> QgsLine3DSymbol >();
>> std::unique_ptr< QgsPhongMaterialSettings > mCurrentSettings;
>>
>> mCurrentSettings = qgis::make_unique< QgsPhongMaterialSettings
>> >();
>>
>> sym->setWidth (1);
>> sym->setHeight (0);
>> sym->setExtrusionHeight(0);
>> sym->setAltitudeClamping(Qgs3DTypes::AltClampAbsolute);
>> sym->setAltitudeBinding(Qgs3DTypes::AltBindVertex);
>> sym->setRenderAsSimpleLines(true);
>> sym->setMaterial(mCurrentSettings->clone());
>>
>> QgsVectorLayer3DRenderer *pcR = new QgsVectorLayer3DRenderer
>> (sym->clone());
>> pcLyr->setRenderer3D(pcR);
>> }
>>
>>
>> Can any one help us in this regard?
>>
>> Regards
>> Raghunath
>> _______________________________________________
>> QGIS-Developer mailing list
>> QGIS-Developer at lists.osgeo.org
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
More information about the QGIS-Developer
mailing list