Jump to content
Developer Wiki and Function Reference Links ×

SetBeamAngle not producing expected results


Mike C

Recommended Posts

When I apply SetBeamAngle to a spot light object, it doesn't appear to be setting the light to the proper angle.

I can can create the light object "manually" within a symbol to an 15 degree beam angle, which produces the correct light output. But if I then set that same light object to an 15 degree angle with code, the edited light object outputs a larger angle (perhaps around 30 degrees?).

I'm also editing color and intensity within the same script, so I know I'm affecting the correct light object.

If GetTypeN(hndBody)=81 then begin {Light object}

hndBeam := hndBody;

SetLightInfo(hndBeam, 2, pIntensity, True, True);

SetBeamAngle(hndBeam,15);

SetSpreadAngle(hndBeam,18);

SetLightFalloff(hndBeam,1,1);

if pColor='' then begin

ColorIndextoRGB(0,realRed,realGreen,realBlue);

end

else begin

mcGelColor(pColor);{Internal subroutine to set RGB values}

end;

SetLightColorRGB(hndBeam, realRed, realGreen, realBlue);

end;

Thanks in advance.

Link to comment

Thanks, Kevin.

That possibility dawned on me as I wrote "(possibly 30 degrees?)".

Is that little tip documented anywhere, or is it a math function I'm not aware of? Since I don't need to divide the number in half when I enter it into the "Spot Light Specs" dialog box, it doesn't seem very intuitive to include it in the VS function.

The light object I'm editing via Vectorscript is part of a PIO, so I didn't have the feedback of the OIP of the light itself.

Thanks again.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...