WorldViz User Forum

WorldViz User Forum (
-   Vizard (
-   -   Camera Position And Viztask (

kovitch 01-10-2011 10:23 AM

Camera Position And Viztask

I have a simple script that makes the camera move forward in my scene. The camera moves through some balls. Now I want to accomplish a task every time the camera's position surpasses the ball's.

I use the following lines to move the camera:


class AmblioCameraHandler( viz.CameraHandler ):
        def _camUpdate( self, e ):
                e.view.move( 0, 0, speed)

Nextly, I need to get the cameras position by doing:


cam_pos = viz.MainView.getPosition()
And then I need to compare it with the ball's z coord.

How can I do that using this viztask method?

Best regards!

Jeff 01-10-2011 05:36 PM

You can create you own custom condition that checks the position of the viewpoint in relation to the balls. The following page has a section on writing a viztask condition:

kovitch 01-11-2011 06:36 AM

That did the trick. Thanks!

All times are GMT -7. The time now is 11:10 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Copyright 2002-2018 WorldViz LLC