Hi alle,
ich versuch gerade selbst eine einfache kleine 3d-engine zu schreiben(nur als Übung). Mit Fluchtpunkten und so.
Jetzt mein Problenm: wie kann man sprites/backgrounds zerren?
Bis jetzt hab ich es so gelöst:
Alles anzeigen
aber das zerrt nicht richtig.
Hilfe und Forensuche hab ich schon probiert aber nichts gefunden(villeicht bin ich auch nur zu blöd).
mfg Alron
ich versuch gerade selbst eine einfache kleine 3d-engine zu schreiben(nur als Übung). Mit Fluchtpunkten und so.
Jetzt mein Problenm: wie kann man sprites/backgrounds zerren?
Bis jetzt hab ich es so gelöst:
GML-Quellcode
- var tex,flpx,flpy,entf,xx,yy;
- tex = background_get_texture(argument0)
- flpx = 320
- flpy = 240
- entf = max(argument1,0.1)
- draw_set_color(c_white)
- draw_primitive_begin_texture(pr_trianglestrip,tex)
- xx = flpx+lengthdir_x(point_distance(flpx,flpy,640,0)/(entf+5),point_direction(flpx,flpy,640,0))
- yy = flpy+lengthdir_y(point_distance(flpx,flpy,640,0)/(entf+5),point_direction(flpx,flpy,640,0))
- draw_vertex_texture(xx,yy,0,0)
- xx = flpx+lengthdir_x(point_distance(flpx,flpy,640,0)/entf,point_direction(flpx,flpy,640,0))
- yy = flpy+lengthdir_y(point_distance(flpx,flpy,640,0)/entf,point_direction(flpx,flpy,640,0))
- draw_vertex_texture(xx,yy,0,1)
- xx = flpx+lengthdir_x(point_distance(flpx,flpy,640,480)/(entf+5),point_direction(flpx,flpy,640,480))
- yy = flpy+lengthdir_y(point_distance(flpx,flpy,640,480)/(entf+5),point_direction(flpx,flpy,640,480))
- draw_vertex_texture(xx,yy,1,0)
- xx = flpx+lengthdir_x(point_distance(flpx,flpy,640,480)/entf,point_direction(flpx,flpy,640,480))
- yy = flpy+lengthdir_y(point_distance(flpx,flpy,640,480)/entf,point_direction(flpx,flpy,640,480))
- draw_vertex_texture(xx,yy,1,1)
- draw_primitive_end()
aber das zerrt nicht richtig.
Hilfe und Forensuche hab ich schon probiert aber nichts gefunden(villeicht bin ich auch nur zu blöd).
mfg Alron

.
.