Comunidad Game Maker

Ayuda => Preguntas y respuestas => Mensaje iniciado por: carlos81lp en Febrero 25, 2016, 06:06:35 PM

Título: d3d_draw_floor
Publicado por: carlos81lp en Febrero 25, 2016, 06:06:35 PM
Realmente me llama la atencion, que la funcion
d3d_draw_floor(0,0,0,x+room_width,y+room_height,0,background_get_texture(bg_suelo),1,1)
en GMS si le pongo que repita la textura varias veces en vez de una sola estirada como aparece ahi, no me dibuja el suelo.
Lo llamativo es que en GM8 si.


Yo lo que quiero hacer es repetir la textura bg_suelo varias veces para que no pierda definicion.
Seria algo como esto:

d3d_draw_floor(0,0,0,x+room_width,y+room_height,0,background_get_texture(bg_suelo),room_width / 128, room_height / 128)
Pero no funciona...
????

Alguna sugerencia ???
Título: Re:d3d_draw_floor
Publicado por: jmbs19 en Febrero 25, 2016, 06:39:09 PM
yo no e usado mucho las funciones 3d del gms, sin embargo la documentacion me dice lo siguiente:

[gml]d3d_draw_floor(x1, y1, z1, x2, y2, z2, tex, hrepeat, vrepeat)[/gml]

donde :

Citar
x1    The initial x coordinate of the floor.
y1    The initial y coordinate of the floor.
z1    The initial z coordinate of the floor.
x2    The opposite x coordinate of the floor.
y2    The opposite y coordinate of the floor.
z2    The opposite z coordinate of the floor.
tex    The id of the texture to use (-1 for no texture)
hrepeat    Amount of horizontal repetitions for the texture.
vrepeat    Amount of vertical repetitions for the texture.
siendo hrepeat vrepeat los que te interesan, esto es la cantidad de veces que se repetira la textura horizontal y vertical respectivamente.
al tu hacer

[gml]room_width / 128, room_height / 128[/gml] lo que haces es dividir el alto y ancho del cuarto entre 128 y esa va a ser la cantidad de repeticiones que tendra tu textura, aqui tu deverias de colocar el numero de veces que quieres que se repita tu textura, tanto horizontal como verticalmente.

otra cosa la documentacion me dice lo siguiente
CitarNote:If the texture has to repeat over the floor, the source texture must be a power of 2 in size (eg: 8x8, 128x128, 256x256 etc...), otherwise you can use any size texture.
asi que ya sabes que si tu textura se repetira tiene que tener una resolucion que sea multiplo de 2 y ser un cuadrado. de otra forma no se repetira.

para terminar te dejo esto:
http://docs.yoyogames.com/source/dadiospice/002_reference/drawing/drawing%203d/3d%20drawing/d3d_draw_floor.html
Título: Re:d3d_draw_floor
Publicado por: carlos81lp en Febrero 25, 2016, 06:48:39 PM
El manual ya lo lei. Lo que preunto es porque en GM8 funciona y en gms me hace errores. O no me dibuja el suelo.
Algo esta faltando...
:S
Título: Re:d3d_draw_floor
Publicado por: Iros en Febrero 25, 2016, 06:57:29 PM
¿Le tildaste en el background la opción texture?
Título: Re:d3d_draw_floor
Publicado por: Clamud en Febrero 25, 2016, 10:49:53 PM
También debes usar
[gml]
texture_set_repeat( true );
[/gml]