<div dir="ltr">Hi all,<div><br></div><div>I am trying to create a positional vtkLight (without having necessary the spotlight (vtkLightActor)) and I have troubles with the function: </div><div>setPositional when setting it to 1 it makes my rendering crashes without clear message when I add the light to the renderer. </div><div><br></div><div>Indeed, I never managed to have simultaneously the lightning generated by the vtkLight and the vtkLightActor allowing me to visualize the position of the light. </div><div><br></div><div>Here is a piece of my code: </div><div><br></div><div><div>vtkSmartPointer<vtkLight> light = vtkSmartPointer<vtkLight>::New();</div><div><span class="" style="white-space:pre"> </span><b>light->SetPositional(1);</b></div><div><span class="" style="white-space:pre"> </span>light->SetPosition(-15, 21, 5);</div><div><span class="" style="white-space:pre"> </span>light->SetLightTypeToSceneLight();</div><div><span class="" style="white-space:pre"> </span>light->SetFocalPoint(m_FocusPoint[0], m_FocusPoint[1], m_FocusPoint[2]);</div><div><span class="" style="white-space:pre"> </span>light->SetColor(1, 1, 1.0);</div><div><span class="" style="white-space:pre"> </span>light->SetIntensity(1));</div><div><span class="" style="white-space:pre"> </span>light->SetConeAngle(angle);<br></div><div><span class="" style="white-space:pre"> </span>light->SetSwitch(true);</div><div><br></div><div><br></div><div><span class="" style="white-space:pre"> </span>if (m_SpotLightsVisible == false)<br></div><div><span class="" style="white-space:pre"> </span>{</div><div><span class="" style="white-space:pre"> </span><b>m_Renderer->AddLight(m_LigthsCollection[i]);</b></div><div><span class="" style="white-space:pre"> </span>}</div><div><span class="" style="white-space:pre"> </span>if (m_SpotLightsVisible == true)</div><div><span class="" style="white-space:pre"> </span>{</div><div><div><span class="" style="white-space:pre"> vtkSmartPointer<vtkLightActor> lightActor = vtkSmartPointer<vtkLightActor>::New();
lightActor->SetLight(</span><b>light</b><span style="white-space:pre">);</span></div><div><span class="" style="white-space:pre"> m_Renderer->AddViewProp(lightActor);</span></div></div><div><span class="" style="white-space:pre"><br></span></div><div><span class="" style="white-space:pre"> </span>m_Renderer->Render();<br></div><div><br></div><div><span class="" style="white-space:pre"> </span>std::cout << "ligth can not be added when using spots ligths..." << std::endl;</div><div><span class="" style="white-space:pre"> </span>}</div><div><span class="" style="white-space:pre"> </span>}</div></div><div><br></div><div>Let me know if you need more information to understand what it is going on with my lights.</div><div>Rémi</div></div>