Hi all, I am trying to build a DMX moving head control patch as a basis for controlling multiple moving heads with MoCap data. (beam following a physical tracker as a first test). I’ve managed to get one fixture in the centra of the scene working perfectly fine (with the use of the example provided in this old thread: Need Help! SHARPY PAN/TILT control in 3d space - #6 by sssslamin cleverly using the atan function for converting x and y coordinates into the two rotational values needed for a moving head)

I’m now figuring out how to translate the lightsource to a different location in the room and still have the rotation values calculated to aim the beam directly on the tracker. But I find my math knowledge seriously lacking… I am adding the position coordinates of the source to the angle calculation, to calculate for the offset of the source. This works perfectly fine for one axis. I can put the source anywhere along the x-axis, and the calculation still gets the beam on the tracked spot. However, when I alter the Z position, the angle calculation just doesn’t follow along. The light beam is still following the tracked spot, only with a constant offset. I can’t seem to find a way to correct this. Hope that someone can look into my patch and give me a hint on how to get this second axis working too! Thanks in advance!

Hi Markus, thanks a lot for clearing this up for me… I found the stackoverflow post you mention during my initial research, but my math understanding couldn’t grasp it at the time, so I decided on the trial and error workflow (always a bad idea). Your division and cleaning up of the calculation Component helped me make more sense of the underlying math (still a bit behind on that…). Will try and calibrate with the physical Moving heads next week when I’m back in the studio. There’s probably gonna be some need for matching the physical and virtual coordinate systems onto each other (direction of the fixture, the max and min rotation values - the DMX PAN is 540deg over a 256 range, max tilt angles are just over 90deg both sides…) but with this as a basis, and some step by step calibration that’ll probably pan out pretty easily (pun intended).