Créditos: brac37& Mitch Graham
Esse código pode ser usado para desenhar o modelo normal ou importado
com sombra, use :
// d3d_model_draw_ext( modelo, x, y, z, texid, direction, lightx, lighty, lightcor )
:D
Esse código pode ser usado para desenhar o modelo normal ou importado
com sombra, use :
// d3d_model_draw_ext( modelo, x, y, z, texid, direction, lightx, lighty, lightcor )
- Código:
// d3d_model_draw_ext( index, x, y, z, texid, direction, lightx, lighty, lightcol )
// some credit must go to brac37 for a part of this script
// i, Mitch Graham, also require some credit. not much, but some.
var xo, yo,a, d;
xo = (argument6-argument1)/-20;
yo = (argument7-argument2)/-20;
a = sqrt
(xo*xo+yo*yo);
d3d_transform_stack_push()d3d_set_lighting( true );
d3d_light_define_direction( 30, xo, yo, -.2, argument8 )d3d_light_define_direction( 31, -xo, -yo, .2, c_dkgray );
d3d_light_enable( 30, 1 )
d3d_light_enable( 31, 1 )
d3d_transform_set_identity()
d3d_transform_add_rotation_z( argument5 )
d3d_transform_add_translation( argument1, argument2, argument3 )
d3d_model_draw( argument0, 0, 0, 0, argument4 )
d3d_transform_set_identity ();d3d_set_lighting( false )d3d_transform_add_rotation_z( argument5 )
if (abs(a) > 0.0001) {
d = radtodeg(arctan2(yo,xo))
d3d_transform_add_rotation_z (d)
d3d_transform_add_scaling(1/1.73205081,1,-a/2)
d3d_transform_add_rotation_y (60)
d3d_transform_add_scaling(3,1,-1)
d3d_transform_add_rotation_y(30)
d3d_transform_add_scaling(1,1,2/1.73205081/a)
d3d_transform_add_rotation_z(-d)
d3d_transform_add_scaling(1,1,0) }
d3d_set_fog( 1, c_black, 0, 0 )
d3d_transform_add_translation( argument1, argument2, argument3 + .1 )d3d_model_draw( argument0, 0, 0, 0, argument4 )
d3d_set_fog( 0, c_black, 0, 0 )
d3d_transform_set_identity()
d3d_transform_stack_pop()
:D