Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
TracePro_User_Manual_5.0.pdf
Источник:
Скачиваний:
281
Добавлен:
03.05.2015
Размер:
6.09 Mб
Скачать

Technical Reference

// isotropic scattering, i.e. g = "anisotropy" coefficient else

{

// theta is the same as alpha in tissue scattering notes cos_temp = (1.0-g2) / (1.0 - g + 2.0*g*frand());

cos_theta = (0.5/g) * ( 1.0 + g2 - ( cos_temp * cos_temp ) );

 

}

 

*phi = frand() * TWOPI;

 

return (double) cos_theta;

 

}

 

Common Arguments passed from TracePro

wave

current raytrace wavelength

temp

current raytrace temperature

rindex

refractive index on the object as defined by the applied Material Property

bulkabso

bulk absorption for the object as defined by the applied Material Property

num

number of elements in the coef array

coef

array of user data defined in the spreadsheet area of the Bulk Scatter Editor

 

Each function takes the current wavelength (wave), temperature (temp), refractive index

 

(rindex), bulk absorptance (bulkabso), coefficient count (num) and coefficient array (coef). The

 

coefficient array has 8 elements for each count in num. The Temperature is currently passed as

 

0.0 for all rows.

Bulk Scattering Editor where the array elements are

coef[0]

= temp,

(First Editor Row)

coef[1]

= wave,

 

coef[2]

= Coeff 0

 

coef[3]

= Coeff 1

 

coef[4]

= Coeff 2

 

coef[5]

= Coeff 3

 

coef[6]

= Coeff 4

 

coef[7]

= Coeff 5

 

coef[8]

= temp,

(Second Editor Row)

coef[9]

= wave,

 

coef[10] = Coeff 0 coef[11] = Coeff 1 coef[12] = Coeff 2 coef[13] = Coeff 3 coef[14] = Coeff 4

coef[15] = Coeff 5 and so on.

DLL Export Definitions

Several programming languages may be used to compile the Scatter DLL. An example using Microsoft Visual C++ is included on the CD in the Bulk Scatter Property folder. Windows requires that the functions be Exported in order that TracePro may access them. A typical Exports file (DEF) is shown below.

LIBRARY bulk

7.60

TracePro 5.0 User’s Manual

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]