Quantcast
Channel: Daz Script Developer Discussion - Daz 3D Forums
Viewing all articles
Browse latest Browse all 1036

A script to Orbit Camera around a point

$
0
0

This topic seems to come up occasionally, but I couldn't find an existing "Orbit Camera" script, so I've written one (CameraOrbit.dsa) and attached it to this post.  It shows one way to Orbit Camera around a point, via Slider controls.

It lets you control the Longitude, Latitude and Radius of the Orbit.

By default it controls the built-in Perspective Camera of the Viewport, and Orbits around the point [ 0, 100, 0 ], but:
    * If your Scene contains a visible Node labelled "Orbit-Point" then that will be used as the point to Orbit instead.
    * If your Scene contains a visible Camera labelled "Orbit-Camera" then that will be used as the controlled Camera instead.
You can enable/disable this behaviour by simply turning off the Visibility of what you don't want to test.

The guts of it is the maths to convert between Cartesian and Spherical coordinates, as per Wikipedia: Spherical coordinates

Hope you find it useful.

 

 


Viewing all articles
Browse latest Browse all 1036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>