<p dir="ltr">Den 21 juni 2016 4:45 em skrev "Ken Martin" <<a href="mailto:ken.martin@kitware.com">ken.martin@kitware.com</a>>:<br>
><br>
> That image doesn't match what I think you are saying, so maybe you can help me understand. You mention the camera is positioned on a cylinder of radius 3.0 and from your code it looks like the focal point is not changing.<br>
><br>
> If that is true then at some point some of the cones will be behind your camera. For example if your focal point was (0,0,0) and your camera was at (3,10,0) then you would be looking mostly down the y axis and from your code you have a cone positioned at (0,20,0) which would be behind you.<br>
><br>
> Having said all that your image looks funny anyhow. With a parallel projection all the cones should look the exact same aside from clipping but the first cone really looks off from the rest and the others are all identical so something is off.</p>
<p dir="ltr">If by the first cone you mean the one at the bottom of the shot I sent, the one closest to the camera, then it's exactly that which I identify as clipping taking place. The clipping makes you see up into the tip of the cone I think, which is what makes it look funny.</p>
<p dir="ltr">But I'll look closer and get you that test case once I'm home.</p>
<p dir="ltr">Elvis</p>
<p dir="ltr">><br>
> I did look through that code and it looks reasonable to me (the patch referenced is not correct BTW, parallel projection still requires proper z buffer scaling and clipping) If you could provide a few more images from different viewpoints, ideally with the resulting camera <br>
><br>
> clipping range<br>
> parallel scale <br>
> position<br>
> focal point<br>
><br>
> for those images that would help me see what is going on.<br>
><br>
> Thanks<br>
> Ken<br>
><br>
><br>
><br>
><br>
><br>
> On Tue, Jun 21, 2016 at 7:06 AM, Elvis Stansvik <<a href="mailto:elvis.stansvik@orexplore.com">elvis.stansvik@orexplore.com</a>> wrote:<br>
>><br>
>> Hi all,<br>
>><br>
>> I have a setup where the camera always moves on a cylinder of radius 3.0 around my subject (just testing with a stack of cones at the moment). The focal point is always positioned along the Y axis, and the camera may be moved up and down independent of the focus point, but the camera is always at a distance of 3 from the Y axis.<br>
>><br>
>> As soon as the user moves the camera, I reset the camera clipping range with ResetCameraClippingRange(). Despite this, when the camera and the focal point are far away from eachother, the actors (my stack of cones) get clipped by the near plane for some reason.<br>
>><br>
>> See the attached screenshot which shows the clipping.<br>
>><br>
>> What I'm doing to my camera (in response to Shift+mouse drag in my custom interactor) to end up in this situation is just:<br>
>><br>
>> camera = renderer.GetActiveCamera()<br>
>> (x, y, z) = camera.GetPosition()<br>
>> camera.SetPosition(x, y - self.PanningFactor * dy, z)<br>
>> renderer.ResetCameraClippingRange()<br>
>><br>
>> and I've verified that the camera is always at a distance of 3.0 from the Y axis.<br>
>><br>
>> The cones I'm using in this test were created with:<br>
>><br>
>> for i in range(-10, 20):<br>
>> coneSource = vtkConeSource()<br>
>> coneSource.SetDirection(0, 1, 0)<br>
>> coneSource.SetResolution(8)<br>
>> coneSource.SetCenter(0, i, 0)<br>
>><br>
>> coneMapper = vtkPolyDataMapper()<br>
>> coneMapper.SetInputConnection(coneSource.GetOutputPort())<br>
>><br>
>> coneActor = vtkActor()<br>
>> coneActor.SetMapper(coneMapper)<br>
>><br>
>> widget.renderer.AddActor(coneActor)<br>
>><br>
>> I don't understand why I see clipping occur here, since I'm using ResetCameraClippingRange, and nothing is behind the camera. The radius of these cones is the default (0.5).<br>
>><br>
>> It's probably something stupid, but any advice is much appreciated.<br>
>><br>
>> Elvis<br>
>><br>
>> _______________________________________________<br>
>> Powered by <a href="http://www.kitware.com">www.kitware.com</a><br>
>><br>
>> Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br>
>><br>
>> Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
>><br>
>> Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers">http://markmail.org/search/?q=vtkusers</a><br>
>><br>
>> Follow this link to subscribe/unsubscribe:<br>
>> <a href="http://public.kitware.com/mailman/listinfo/vtkusers">http://public.kitware.com/mailman/listinfo/vtkusers</a><br>
>><br>
><br>
><br>
><br>
> -- <br>
> Ken Martin PhD<br>
> Chairman & CFO<br>
> Kitware Inc.<br>
> 28 Corporate Drive<br>
> Clifton Park NY 12065<br>
> 518 371 3971<br>
><br>
> This communication, including all attachments, contains confidential and legally privileged information, and it is intended only for the use of the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on it is prohibited and may be unlawful. If you received this communication in error please notify us immediately and destroy the original message. Thank you.</p>