Profile


Name
refaxis
ID
48212
Shared with
Public
Parent
None
Children
None
Created on
February 14, 2014 at 17:43 PM UTC
Updated on
February 14, 2014 at 17:43 PM UTC
Description

creates axes as reference markers

Best for


Code


--[[ Creates Axes for Reference Attaches a set of disabled bands to segment 1 as visual reference marks. Since these are referenced to segment 1, 2, and 3 the orientation can change as those segments are rebuilt. The first angle argument (theta) is "angle from zenith" (like latitude, but 0 is north pole, pi/2 (90 deg) is equator, pi (180 deg) is south pole). The Z axis is longer and thicker. X and Y follow a "Right Hand" convention (as the fingers of the right hand curl from X toward Y, the thumb points to Z.) The second angle argument, Phi, is measured from X, going positive toward Y (just like longitude). ]]-- function refaxis() axisbands={} local theta=math.pi/2 axisbands[1]=band.Add(1,2,3,10,theta,0) axisbands[2]=band.Add(1,2,3,10,theta,theta) axisbands[3]=band.Add(1,2,3,15,0,0) for idx=1,3 do band.Disable(axisbands[idx]) end band.SetStrength(axisbands[3],5) end refaxis()

Comments


bob1928 Lv 1

Attaches a set of disabled bands to segment 1
as visual reference marks. Since these are
referenced to segment 1, 2, and 3 the orientation
can change as those segments are rebuilt.

The first angle argument (theta) in the code is
"angle from zenith" (like latitude, but 0 is north pole,
pi/2 (90 deg) is equator, pi (180 deg) is south pole).

The Z axis is longer and thicker. X and Y follow
a "Right Hand" convention (as the fingers of the
right hand curl from X toward Y, the thumb points
to Z.)

These are visual reference marks only. They are not
universal and serve no purpose in setting or
reading positions.

The second angle argument (last entry in the band.Add
commands) is usually know as Phi. It is measured going
around Z and is positive going from X toward Y, just
like longitude.