Pan Tilt Moving Lights to dmx? Pls thanksss!

Hi alls!

I have a question about rotation paramters translate to dmx value from 0-255. i have been working on a project of moving headlights: 4 lights that track an object in space using Pozyx sensor. i have managed to prototype a 3d space in which the lights and the objects s coordinates are calculated, however, to dmx out, I need these to be translated to 0-255. Pan degree 0=,255=540degree/ tilt is 0-255=0-270degree…
the problem is that all parameters in touch are negetive and positive along x,y axis, how can I translate this? And, i will change positions of light so what method could be used that simply flexible in this case?

Please help me!
Thank you so much❤️

I think you are looking for the mathCHOPs range function.
Put the values from TD to ‘from range’
And the expectedn DMX values to ‘to range’

Also keep in mind some dmx moving heads have pan fine and tilt fine parameters you might have to manage.