This code fades a model out on distance from the camera.
Almost everything is tweekable in WED by resources/scripts/customize.
It's very simple, but I thought that some people could use it.
The only requirement from me is for you to post any cool moddifications of this code in this thread for others.
///////////////////////////////////////////
//Include this wdl as the first include
//in your main script. After the path definitions.
//Then choose the action that you want to have the
//detain model properties and put detail_model();
//at the top of its action.
///////////////////////////////////////////optimizer
var DM_Dist;
// entry: fading speed
// help: This is the fading speed of the model.
var DM_ClipAmt = 0.025;//fading speed
// entry: fading distance
// help: This is the fading distance of the model.
var DM_FadeDist = 999;//distance from cam
var DM_DistFromCam;
function detail_model()
{
while(1)
{
DM_DistFromCam = vec_dist(my.x, camera.x);
if(vec_dist(my.x, camera.x) > DM_FadeDist)
{
my.alpha = 100;
my.transparent = off;
}else{
my.transparent = on;
DM_Dist = 100 - DM_DistFromCam * DM_ClipAmt;
vec_set(my.alpha, DM_Dist);
}
wait(1);
}
}
///////////////////////////////////////////