c# - How to get the PAN and TILT of a DMX spotlight from the X and Y of a plan (Camera View) -


context

i have dmx spotlights fixed round platform located @ 12 meters above floor. camera fixed centre (approximately) of platform. camera supposed film ground find , track targets. camera static , give me 2d plan x/y cartesian coordinates system. when found target, need put spotlight on it.

illustration

top view of scene top view image http://img15.hostingpics.net/pics/635699691.png side view of scene side view image http://img15.hostingpics.net/pics/275272232.png

problem

to light target spotlight, need find pan , tilt angles corresponding of x/y position of target. these spotlights have no specific orientation, can find x/y projection point of on ground camera.

some data

i found formulas on web :

float radius = sqrt( x*x + y*y + z*z ); float inclination = atan2( y, x ) * 180.0 / pi; float azimuth = acos( z/radius ) * 180.0 / pi; 

or

rotx = math.atan2( y, z ) roty = math.atan2( x * math.cos(rotx), z ) rotz = math.atan2( math.cos(rotx), math.sin(rotx) * math.sin(roty)  

but don't know if correct after inconclusive tests..

i don't know if have corresponding x, y , z values.

i can find want on 2d plan: points, vectors, zenith point of spotlights , can positioning spotlights ever want too. can't find corresponding pan , tilt of particular x/y point (the target in camera view) , don't know how find its.

i develop in c#.


Comments

Popular posts from this blog

c++ - No viable overloaded operator for references a map -

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - Cannot secure connection using TLS -