<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>Thank you David,<br/></div><div><br/></div><div>It still does not work for me. I made a very small example, explaining my problem. <br/><br/>What I expect to see when I shine on the surface is for it to look something like this:<br/>http://i.imgur.com/DpH6m.jpg<br/><br/>Instead it looks like this:<br/>http://i.imgur.com/Wz4ga.jpg<br/><br/>But when I just make the surface to be shined on smaller (-5, 5, -5, 5, -5, 5) instead of (-500, 500, -500, 500, -5, 5) it look like this:<br/>http://i.imgur.com/Je5BD.jpg<br/><br/>Is there a away to make it look like picture 1?<br/><br/>Here's the short code used for this example:<br/></div><div><br/></div><div><br/></div><div>#include "stdafx.h"<br/>#include "vtkRenderer.h"<br/>#include "vtkRenderWindow.h"<br/>#include "vtkWin32RenderWindowInteractor.h"<br/>#include "vtkCubeSource.h"<br/>#include "vtkPolyDataMapper.h"<br/>#include "vtkActor.h"<br/>#include "vtkLight.h"<br/><br/>int main ()<br/>{<br/> vtkRenderer *renderer = vtkRenderer::New(); <br/><br/> int x = 0;<br/> int y = 0;<br/> int z = 100;<br/><br/> //Create a light<br/> vtkLight *light = vtkLight::New();<br/> light->SetLightTypeToSceneLight();<br/> light->SetPosition(x, y, z);<br/> light->SetFocalPoint(0, 0, 0);<br/> light->SetIntensity(0.5);<br/> light->SetConeAngle(20);<br/> light->SetPositional(1);<br/> renderer->AddLight(light);<br/><br/> //Create a cube where the light is<br/> vtkCubeSource *lightCube = vtkCubeSource::New();<br/> lightCube->SetBounds(x-2, x+2, y-2, y+2, z-2, z+2);<br/><br/> vtkPolyDataMapper *maplightCube = vtkPolyDataMapper::New();<br/> maplightCube->SetInput(lightCube->GetOutput());<br/><br/> vtkActor *alightCube = vtkActor::New();<br/> alightCube->SetMapper(maplightCube);<br/><br/> renderer->AddActor(alightCube);<br/><br/> //Create a cube for the light to shine on<br/> vtkCubeSource *cube = vtkCubeSource::New(); //obst1<br/> cube->SetBounds(-500, 500, -500, 500, -5, 5);<br/><br/> vtkPolyDataMapper *mapCube = vtkPolyDataMapper::New();<br/> mapCube->SetInput(cube->GetOutput());<br/><br/> vtkActor *aCube = vtkActor::New();<br/> aCube->SetMapper(mapCube);<br/><br/> renderer->AddActor(aCube);<br/> renderer->SetBackground(1,1,1);<br/> <br/> vtkRenderWindow *renWin = vtkRenderWindow::New();<br/> renWin->AddRenderer(renderer);<br/><br/> vtkWin32RenderWindowInteractor *iren = vtkWin32RenderWindowInteractor::New();<br/> iren->SetRenderWindow(renWin);<br/><br/> renWin->SetSize(1200,800);<br/> renWin->Render();<br/><br/> iren->Start();<br/><br/>}<br/><br/>
<br/></div><div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="margin:0 0 10px 0;">
<b>Gesendet:</b> Mittwoch, 21. November 2012 um 16:28 Uhr<br/>
<b>Von:</b> "David Doria" <daviddoria@gmail.com><br/>
<b>An:</b> Kein Empfänger<br/>
<b>Cc:</b> "web-Dmitri web-Danewitz" <d.danewitz@web.de>, vtkusers@vtk.org<br/>
<b>Betreff:</b> Re: [vtkusers] Light source similar to a flashlight?
</div>
<div name="quoted-content">
On Wed, Nov 21, 2012 at 9:50 AM, Joachim Pouderoux <span><<a href="joachim.pouderoux@kitware.com" target="_parent">joachim.pouderoux@kitware.com</a>></span> wrote:<br/><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0 0 0 0.8ex;border-left: 1.0px rgb(204,204,204) solid;padding-left: 1.0ex;">
Hello Dmitri,<br/><br/>Yes of course it is possible. Take a look at the vtkLight documentation here:<br/><a href="http://www.vtk.org/doc/nightly/html/classvtkLight.html#details" target="_blank">http://www.vtk.org/doc/nightly/html/classvtkLight.html#details</a><br/>
<br/>Consider to set the light position, focal point and cone angle then call SetPositionalOn().<br/><br/>Hope it helps,<br/><br/>Regards,</blockquote><div><br/></div>There is a shadow example here:<div><a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/Shadows" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/Shadows</a><br clear="all"/>
<br/></div><div>If you could extract just what you said (a light making a circle on a plane) into a simple "Light" example, that would be a nice addition to the examples!</div><div><br/></div><div>David</div></div>
</div>
</div><div><br/><br/></div></div></body></html>