Navigation: Scripting Reference Manual > Functions & Subroutines > SourcePrimSetDrawColor

 

SourcePrimSetDrawColor

 

Contact Us: fredsupport@photonengr.com

 

Description

This subroutine sets the draw color specification of of a Source Primitive using R,G,B integers.

 

 

Syntax

SourcePrimSetDrawColor( spNode, R, G, B )

 

 

Parameters

spNode As Long

Node number of the Source Primitive being modified.

 

R As Integer

Integer for the Red component (0 <= value <= 255).

 

G As Integer

Integer for the Green component (0 <= value <= 255).

 

B As Integer

Integer for the Blue component (0 <= value <= 255).

 

Example

The example below demonstrates how to create a new Point Source (incoherent) type Source Primitive with a total power of 2.0 Watts and emitting 10,000 rays into a cone with a semi-angle of 10 Degrees.  A single wavelength value of 0.5 microns is assigned and the draw color is set to red.

 

Sub Main

 

    Dim spNode As Long

    Dim spType As String

    Dim tEnt As T_ENTITY

 

    'String specifying the type of SP being created

    spType = "Point Source (incoherent)"

 

    'Generic entity information

    InitEntity( tEnt )

    tEnt.name        = spType

    tEnt.Description = "Added via scripting"

 

    'Add the node

    spNode = AddSourcePrim( spType, tEnt )

    Print "Source primitive added at node number " & spNode

 

    'Configure parameter settings

    SourcePrimSetParmValue( spNode, 0, 2.0   ) 'power in watts

    SourcePrimSetParmValue( spNode, 1, 10000 ) 'total number of random ray directions

    SourcePrimSetParmValue( spNode, 2, 10.0  ) 'emission cone semi-angle (degrees)

 

    'Configure wavelength settings

    'Use single wavelength

    SourcePrimSetWavelSpectValue( spNode, "Single" )

    SourcePrimSetWavelSingle( spNode, 0.5 )

 

    'Source draw color R=255, G=0, B=0

    SourcePrimSetDrawColor( spNode, 255, 0, 0 )

 

    'Update the document

    Update

 

End Sub

 

See Also

Source Primitive Script Commands

SourcePrimGetDrawColor

SourcePrimGetParmValue

SourcePrimSetParmValue

 

 

 

 

 

Copyright © Photon Engineering, LLC