SmallisBeautiful
Member
Hi! I'm just starting with 3D, going through some tutorials but there are some informations I can't find.
Setup :
The green ground is a tileset layer setup in the room.
The white rectangle is vertex drawn using a vertex buffer (code sample below).
3d camera.
Scripts used to draw the white triangles :
MY QUESTIONS ARE :
Why is the white rectangle unaffected by the camera?
How do I clear the background so there's no residual green pixel from the ground layer? (Clear Buffer Display doesn't do it)
Thanks!
Setup :
The green ground is a tileset layer setup in the room.
The white rectangle is vertex drawn using a vertex buffer (code sample below).
3d camera.
Scripts used to draw the white triangles :
GML:
vbuffer = vertex_create_buffer();
vertex_begin(vbuffer, vertex_format);
var x1 = 400;
var y1 = 400;
var x2 = 600;
var y2 = 600;
vertex_add_point(vbuffer, x1, y1, 100, 0, 0, 1, 0, 0, c_white, 1);
vertex_add_point(vbuffer, x2, y1, 100, 0, 0, 1, 0, 0, c_white, 1);
vertex_add_point(vbuffer, x2, y2, 100, 0, 0, 1, 0, 0, c_white, 1);
vertex_add_point(vbuffer, x2, y2, 100, 0, 0, 1, 0, 0, c_white, 1);
vertex_add_point(vbuffer, x1, y2, 100, 0, 0, 1, 0, 0, c_white, 1);
vertex_add_point(vbuffer, x1, y1, 100, 0, 0, 1, 0, 0, c_white, 1);
vertex_end(vbuffer);
function vertex_add_point(vbuffer, xx, yy, zz, nx, ny, nz, utex, vtex, color, alpha)
{
vertex_position_3d(vbuffer, xx, yy, zz);
vertex_normal(vbuffer, nx, ny, nz);
vertex_texcoord(vbuffer, utex, vtex);
vertex_color(vbuffer, color, alpha);
}
Why is the white rectangle unaffected by the camera?
How do I clear the background so there's no residual green pixel from the ground layer? (Clear Buffer Display doesn't do it)
Thanks!