# How can set camera to get the result that see from the back?

**URL:** https://discourse.vtk.org/t/how-can-set-camera-to-get-the-result-that-see-from-the-back/1730
**Category:** Support
**Created:** [September 10, 2019, 6:20am UTC](https://discourse.vtk.org/t/how-can-set-camera-to-get-the-result-that-see-from-the-back/1730 "2019-09-10T06:20:14Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![pingdan](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/p/22d042/32.png) [@pingdan](https://discourse.vtk.org/u/pingdan)
#### Post date: [September 10, 2019, 6:20am UTC](https://discourse.vtk.org/t/how-can-set-camera-to-get-the-result-that-see-from-the-back/1730/1 "2019-09-10T06:20:14Z")

</div>

I vtkSmartPointermyCamera = vtkSmartPointer::New();  
myCamera-\>SetClippingRange(0,2);//  
myCamera-\>SetFocalPoint(212, 212, 148);//  
myCamera-\>SetPosition(212,900,148);//  
myCamera-\>ComputeViewPlaneNormal();  
myCamera-\>SetViewUp(0, 0, -1);  
m\_Renderer-\>SetActiveCamera(myCamera);  
now I use these functions to set camera that can see from the front of image, but I want to see from the back of image. I tried to modify position parameter, but it doesn’t work at all.  
how can I set the camera? ![1](https://discourse.vtk.org/uploads/default/original/1X/0909dcc1b1424129b3c71a8ea2037c22a689fd62.png)

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [September 11, 2019, 5:19am UTC](https://discourse.vtk.org/t/how-can-set-camera-to-get-the-result-that-see-from-the-back/1730/2 "2019-09-11T05:19:00Z")

</div>

Are you sure that your clipping range is correct? I would recommend to [reset the camera clipping range](https://vtk.org/doc/nightly/html/classvtkRenderer.html#a7be279d6fb4a9a8adfd7db97a5560735) after you’ve set up its position and added all actors to the renderer.

---

<div class="post-metadata">

### Author: ![pingdan](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/p/22d042/32.png) [@pingdan](https://discourse.vtk.org/u/pingdan)
#### Post date: [September 11, 2019, 8:13am UTC](https://discourse.vtk.org/t/how-can-set-camera-to-get-the-result-that-see-from-the-back/1730/3 "2019-09-11T08:13:00Z")

</div>

the real range are (858,1845)  
now I want to set the camera to the back. so I reset the camera position at the opposite direction. and it doesn’t work.  
Do you mean that when I reset the position, I should reset the cliprange?then what value I will set for cliprange?  
thanks a lot

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [September 11, 2019, 12:53pm UTC](https://discourse.vtk.org/t/how-can-set-camera-to-get-the-result-that-see-from-the-back/1730/4 "2019-09-11T12:53:36Z")

</div>

Instead of setting clipping range manually, I would recommend to reset the camera clipping range after you’ve set up the camera position and focal point and added all actors to the renderer. It does not matter what was the clipping range before the reset.

---

<div class="post-metadata">

### Author: ![pingdan](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/p/22d042/32.png) [@pingdan](https://discourse.vtk.org/u/pingdan)
#### Post date: [September 12, 2019, 1:38am UTC](https://discourse.vtk.org/t/how-can-set-camera-to-get-the-result-that-see-from-the-back/1730/5 "2019-09-12T01:38:01Z")

</div>

In fact, the actor is a image got by reslice(see the image below, the red circle), at first, I didn’t set the camera and use the default camera. but I want to exchange the image’s left and right, so I think, if I reset the camera to the opposite direction, then the image just meet my idea. but when I reset the camera parameter, I found it didn’t work at all.  
image1 is the source image, look at the right top view, the green circle is on the left, I want to get the result as image2  
image1

 ![4](https://discourse.vtk.org/uploads/default/original/1X/56d3f9144f518b0a106ed2728d8e4f427e4aea98.png)  
image2  
 ![5](https://discourse.vtk.org/uploads/default/original/1X/bce5ae1a0b6550f4942cff9b925b34544c1a2cf2.png)

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [September 12, 2019, 3:56am UTC](https://discourse.vtk.org/t/how-can-set-camera-to-get-the-result-that-see-from-the-back/1730/6 "2019-09-12T03:56:24Z")

</div>

Sorry, I cannot help you with this any further. This question (and most other questions that you have asked in the past few months) have been already answered, implemented, tested, and provided for free in several open-source medical image viewers. It would be much better use of your and the community member’s time if you built your application by extending an existing software and focus your attention to problems that have not been already solved.

---

<div class="post-metadata">

### Author: ![pingdan](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/p/22d042/32.png) [@pingdan](https://discourse.vtk.org/u/pingdan)
#### Post date: [September 12, 2019, 5:15am UTC](https://discourse.vtk.org/t/how-can-set-camera-to-get-the-result-that-see-from-the-back/1730/7 "2019-09-12T05:15:12Z")

</div>

I am confused by what your said. I can explore other open-source medical image viewers, but that doesn’t effect I research vtk. In fact, you can take this question as a common question focus on how to use a camera, it has no any links with medical.maybe I need other industry image.

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [September 12, 2019, 11:24pm UTC](https://discourse.vtk.org/t/how-can-set-camera-to-get-the-result-that-see-from-the-back/1730/8 "2019-09-12T23:24:56Z")

</div>

There are good application frameworks for other domains, too (for example, you can use ParaView for general engineering applications).

---

<div class="post-metadata">

### Author: ![pingdan](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/p/22d042/32.png) [@pingdan](https://discourse.vtk.org/u/pingdan)
#### Post date: [September 18, 2019, 7:08am UTC](https://discourse.vtk.org/t/how-can-set-camera-to-get-the-result-that-see-from-the-back/1730/9 "2019-09-18T07:08:11Z")

</div>

hi, Andras Lasso,  
thank you for your advice. but the other application frameworks can’t solve my confusion.  
the first question, why some situations, setting the camera parameter are useful, and with some situations, the setting of camera don’t work at all.  
for example, I have a vtkRenderer and vtkRenderWindow, which has some actors, created by other persons, when I try to reset the camera, it doesn’t work except SetViewUp() function. but if I get the actors from the vtkRenderer and added them to another vtkRenderer, all the camera setting are ok.  
another example,I reset the actor with SetUserTransform() function, and I can get the new position value after setting.the x,y,z value have change. But the display of vtkRenderer has no changes.  
I think it must exist some questions I don’t know.

In fact, I don’t care which industry or any frameworks. I don’t develop any products. I am just researching the vtk itself.

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [September 23, 2019, 6:26pm UTC](https://discourse.vtk.org/t/how-can-set-camera-to-get-the-result-that-see-from-the-back/1730/10 "2019-09-23T18:26:51Z")

</div>

> [@pingdan](#):
>
> In fact, I don’t care which industry or any frameworks. I don’t develop any products. I am just researching the vtk itself.

Actually, you need to care about this. VTK feature development and community support is paid for by specific industries and VTK-based frameworks. Even if your question is valid, if you cannot demonstrate that it is relevant or helpful for any of these sponsored groups then it is less likely that anyone can allocate time to answer it. There is no established rules for this, it is just my theory of why the response rate on VTK forum is relatively low.

This theory would explain why forums that are more focused on a particular industry or framework have higher response rate. For example, VTK-based 3D Slicer has about 5x more traffic than the general VTK forum but there _all the questions are answered_, even if the question related to usage of VTK, ITK, numpy, or any other underlying library (of course the answers will describe how to achieve your goals within that framework).

---

<div class="post-metadata">

### Author: ![pingdan](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/p/22d042/32.png) [@pingdan](https://discourse.vtk.org/u/pingdan)
#### Post date: [September 24, 2019, 1:20am UTC](https://discourse.vtk.org/t/how-can-set-camera-to-get-the-result-that-see-from-the-back/1730/11 "2019-09-24T01:20:28Z")

</div>

oh, so that is what it is. I see.thank you very much.  
can you give me a link for other forum?

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [September 24, 2019, 2:16am UTC](https://discourse.vtk.org/t/how-can-set-camera-to-get-the-result-that-see-from-the-back/1730/12 "2019-09-24T02:16:06Z")

</div>

> [@pingdan](#):
>
> oh, so that is what it is.

That is my theory at least.

> [@pingdan](#):
>
> can you give me a link for other forum?

If you mean the 3D Slicer forum, it’s here: [https://discourse.slicer.org/](https://discourse.slicer.org/)  
Note that if you ask how to do something you’ll get answer about how to do it using not just plain VTK but all the other tools available in Slicer.

---

<div class="post-metadata">

### Author: ![dporter](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/d/b5ac83/32.png) [@dporter](https://discourse.vtk.org/u/dporter)
#### Post date: [September 24, 2019, 11:47pm UTC](https://discourse.vtk.org/t/how-can-set-camera-to-get-the-result-that-see-from-the-back/1730/13 "2019-09-24T23:47:27Z")

</div>

Hey pingdan, I’m with you on this. VTK has a huge learning curve and I’m currently tackling with my volumes being displayed upside down. Do i use a combination of camera too, pitch and yaw to put it in the orientation that I want? I think you have to become really great at searching the open source code.

May I ask though, would you be kind snout the share the code that produced that orthogonal slice triangulation? You display it in that first picture consisting of axial, sagittal and coronal slices. Where can I find that code? Thanks.

---

<div class="post-metadata">

### Author: ![pingdan](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/p/22d042/32.png) [@pingdan](https://discourse.vtk.org/u/pingdan)
#### Post date: [September 25, 2019, 1:44am UTC](https://discourse.vtk.org/t/how-can-set-camera-to-get-the-result-that-see-from-the-back/1730/14 "2019-09-25T01:44:42Z")

</div>

you can give me a email. and after reorganize, I can send you email.

---

<div class="post-metadata">

### Author: ![dporter](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/d/b5ac83/32.png) [@dporter](https://discourse.vtk.org/u/dporter)
#### Post date: [September 25, 2019, 5:31pm UTC](https://discourse.vtk.org/t/how-can-set-camera-to-get-the-result-that-see-from-the-back/1730/15 "2019-09-25T17:31:30Z")

</div>

Thanks so much!!! 🙂 my email in porter.douglas@mayo.edu
