I would like to set up an initial centered view of a volume. I have 
different examples without errors of how to do it in c++, tcl and python. 
When I tried to translate in clojure I get errors. Where is the error in my 
clojure code?

In C++ is as follow:
  ren->AddViewProp(volume);
  vtkCamera *camera = ren->GetActiveCamera();
  double *c = volume->GetCenter();
  camera->SetFocalPoint(c[0], c[1], c[2]);
  camera->SetPosition(c[0] + 400, c[1], c[2]);
  camera->SetViewUp(0, 0, -1);

In TCL:
ren AddViewProp volume
set camera [ren GetActiveCamera]
set c [volume GetCenter]
$camera SetFocalPoint [lindex $c 0] [lindex $c 1] [lindex $c 2]
$camera SetPosition [expr [lindex $c 0] + 400] [lindex $c 1] [lindex $c 2]
$camera SetViewUp 0 0 -1

In Python:
ren.AddViewProp(volume)
camera =  ren.GetActiveCamera()
c = volume.GetCenter()
camera.SetFocalPoint(c[0], c[1], c[2])
camera.SetPosition(c[0] + 400, c[1], c[2])
camera.SetViewUp(0, 0, -1)

And this what I have written in Clojure (with errors):
        ren (doto (vtkRenderer.)
              (.AddViewProp volume)
              (-> (.GetActiveCamera) (.SetFocalPoint (.GetCenter volume 0 1 
2)))
              (-> (.GetActiveCamera) (.SetPosition (.GetCenter volume 0 1 
2)))
              (-> (.GetActiveCamera) (.SetViewUp 0 0 -1))
              )

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to