M
Mooshim
Guest
So I'm trying to create a program that renders an image and saves it in your folder.
The issue I'm having is that rather than rendering things relative to distance and what's in front of what, it's rendering it from which object I draw first.
http://i.imgur.com/M80crQM.png
(The hands are part of the head model because of their colour) As you can see from the code below, it draws Legs>Torso>Head, and creates that.
Is there anyway I can configure this so that it draws it all correctly, or should I just change the way I've made the models?
Create Event:
Draw Event:
Thanks
The issue I'm having is that rather than rendering things relative to distance and what's in front of what, it's rendering it from which object I draw first.
http://i.imgur.com/M80crQM.png
(The hands are part of the head model because of their colour) As you can see from the code below, it draws Legs>Torso>Head, and creates that.
Is there anyway I can configure this so that it draws it all correctly, or should I just change the way I've made the models?
Create Event:
Code:
{
d3d_start();
display_mouse_set(display_get_width()/2,display_get_height()/2);
d3d_set_perspective(true);
x = 0
y = 0
head = d3d_model_create();
d3d_model_load(head,"Head.d3d");
face = background_get_texture(tex_face);
torso = d3d_model_create();
d3d_model_load(torso,"Torso.d3d");
shirt = background_get_texture(tex_shirt);
legs = d3d_model_create();
d3d_model_load(legs,"Legs.d3d");
pants = background_get_texture(tex_pants);
render = surface_create(512,512);
}
Code:
surface_set_target(render);
d3d_set_hidden(true);
d3d_set_lighting(true);
d3d_set_shading(true);
d3d_set_culling(false);
texture_set_interpolation(true);
d3d_light_define_ambient(make_color_rgb(240,240,240));
d3d_set_projection_ext(x,y,6,x+cos(point_direction(x,y,-10,25)*pi/180),y-sin(point_direction(x,y,-10,25)*pi/180),5.75,0,0,1,45,room_width/room_height,1,100);
d3d_light_define_point(1,-4,10,6,100,c_white);
d3d_light_enable(1,1);
d3d_transform_set_identity();
d3d_transform_add_scaling(0.6,0.6,0.6);
d3d_transform_add_rotation_x(-90);
d3d_transform_add_translation(-4,10,0);
d3d_model_draw(legs,0,0,0,pants);
d3d_model_draw(torso,0,0,0,shirt);
d3d_model_draw(head,0,0,0,face);
d3d_transform_set_identity();
surface_reset_target();
surface_save(render,"ID.png");
draw_surface(render,0,0);
game_end();