[Radiance-general] Math Help Needed

Thomas Bleicher tbleicher at arcor.de
Wed Dec 14 00:44:49 CET 2005


On 13.12.2005, at 21:00, Mark de la Fuente wrote:

> Hi group,
>
> I'm trying to write a tool for calculating the rotation angles  
> necessary
> to aim a light fixture.  The tool will basically export a text file  
> from
> AutoCAD containing xform rotation and transformation commands.
>
> So far I've been approaching this problem using vectors (one at the  
> fixture
> origin oriented down and one for the aiming direction based on the  
> coordinate points of the source and target) and using the dot  
> product to find the angles between the vectors. Unfortunately so  
> far this only works for some cases.
>
> Is there a better way to approach this?

Can you give us an example of the problem cases?

If you have a target object to get the coords from I'd reduce the  
process
to two rotations: one around x or y (tilt) and one around z  
(orientation).
You can calculate both rotations with simple trigonometry (dx,dy and dz
between light fixture and target).

Remember that Radiance uses a "world coordinate system" - the  
sequence of
rotations matters and Euler rotation angles (around object coordinates)
are different from Radiance angles.


Thomas




More information about the Radiance-general mailing list