Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • ParaView ParaView
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,961
    • Issues 1,961
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 97
    • Merge requests 97
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • ParaViewParaView
  • ParaViewParaView
  • Issues
  • #19967
Closed
Open
Issue created May 29, 2020 by Dennis Ogiermann@termi-official

Camera position ignored when using parallel projection

Hi,

I cannot find any information about setting the camera position through a script for a camera with parallel projection enabled. I tried to approach this through the tracing mechanism in paraview, but setting the camera position programatically keeps getting ignored when in parallel projection mode and I cannot track down futher why this happens or whether I do something wrong.

To reproduce I execute the following script in Paraview 5.8.0 (current release)

# trace generated using paraview version 5.8.0
#
# To ensure correct image size when batch processing, please search 
# for and uncomment the line `# renderView*.ViewSize = [*,*]`

#### import the simple module from the paraview
from paraview.simple import *
#### disable automatic camera reset on 'Show'
paraview.simple._DisableFirstRenderCameraReset()

# create a new 'Sphere'
sphere1 = Sphere()

# get active view
renderView1 = GetActiveViewOrCreate('RenderView')
# uncomment following to set a specific view size
# renderView1.ViewSize = [1372, 791]

# show data in view
sphere1Display = Show(sphere1, renderView1, 'GeometryRepresentation')

# trace defaults for the display properties.
sphere1Display.Representation = 'Surface'

# update the view to ensure updated data information
renderView1.Update()

# Properties modified on renderView1
renderView1.CameraParallelProjection = 1

#### saving camera placements for all active views

# current camera placement for renderView1
renderView1.CameraPosition = [0.0, 0.0, 1.0]

#### uncomment the following to render all views
# RenderAllViews()
SaveScreenshot("screenshot.png", renderView1)

gives me the following result.

screenshot

Now, commenting renderView1.CameraParallelProjection = 1 allows me to freely move the camera by changing CameraPosition.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking