Description This function queries a ray for its wave vector direction components and returns a true or false indicating whether the query was successful. When a ray is immersed in a birefringent medium, the wave vector and the ray's direction vector will not necessarily be equivalent. Depending on the number of rays traced, it may be necessary to dimension ray index and ray counter variables as data type Huge_ instead of Long. Please see Multi-threaded Raytracing for more information.
Syntax bSuccess = GetRayWaveVector( rayId, wvX, wvY, wvZ )
Parameters bSuccess (Boolean) Returned boolean indicating whether the ray was successfully queried for its wave vector components.
rayId As Long (or Huge_) ID number of the ray being queried.
wvX As Double Passed in as an argument, this variable contains the X component of the wave vector in global coordinates after the function is evaluated.
wvY As Double Passed in as an argument, this variable contains the Y component of the wave vector in global coordinates after the function is evaluated.
wvZ As Double Passed in as an argument, this variable contains the Z component of the wave vector in global coordinates after the function is evaluated.
Example The example below demonstrates a simple script that queries two rays in the buffer for their wave vectors, ray type (ordinary/extraordinary), and refractive index and reports the information to the output window.
Sub Main
ClearOutputWindow()
Dim bWv As Boolean Dim wvx As Double, wvy As Double, wvz As Double Dim tRay As T_RAY Dim rType As String
'Header Print "Ray ID" & Chr(9) & "Success?" & Chr(9) & "X-Dir" & Chr(9) & "Y-Dir" & Chr(9) & "Z-Dir" & Chr(9) & "n" & Chr(9) & "Type"
'Query ray #0 bWv = GetRayWaveVector( 0, wvx, wvy, wvz ) rType = GetRayOrdinaryExtraType( 0 ) GetRay(0, tRay)
'Summary output for ray #0 Print 0 & Chr(9) & bWv & Chr(9) & wvx & Chr(9) & wvy & Chr(9) & wvz & Chr(9) & tRay.indexref & Chr(9) & rType
'Query ray #1 bWv = GetRayWaveVector( 1, wvx, wvy, wvz ) rType = GetRayOrdinaryExtraType( 1 ) GetRay(1, tRay)
'Summary output for ray #1 Print 1 & Chr(9) & bWv & Chr(9) & wvx & Chr(9) & wvy & Chr(9) & wvz & Chr(9) & tRay.indexref & Chr(9) & rType
End Sub
See Also Basic Ray Data Script Commands
|