#How to vertex submit inside a surface?
8 messages · Page 1 of 1 (latest)
not sure if it will work for that, but I do this to get room coordinates on a surface
vx = (Top left corner of your camera)
vy = (Top left corner of your camera)
if (surface_exists(tail_surf) == false) {
tail_surf = surface_create(320,180) //make your surface, no bigger than your camera
}
matrix_set(matrix_world, matrix_build(-vx,-vy,0,0,0,0,1,1,1)); //Do this to use in room x/y cordinates
surface_set_target(tail_surf); //start drawing to the surface
draw_clear_alpha(c_black, 0); //clear previous data
//just draw with normal x/y
surface_reset_target(); //reset draw target
matrix_set(matrix_world, matrix_build(0,0,0,0,0,0,1,1,1)); //undo matrix change
draw_surface_ext(tail_surf, vx, vy,0,c_white,1) //draw your surface
prob is a better way, but maybe this will be of use.
but changing the matrix causes vertex breaks
maybe doing camera_apply inside the surface would work?
maybe,
or like, try to have them located in the upper left corner of the room so the positions in the room match the positions of the surface?
like, move whatever you are trying to work with to the upper left of the room, then back when you are done working on the surface?
idk I'm randomly spitballing, maybe someone else will know.
I have not really worked with vertex buffers
@shell arch I discovered recently camera_apply to do just that, just call it after setting your surface and you're good to go
I tried to use it but for some reason It didn't worked for me, it streched everything that was drawn into the surface
Sorry I just saw that you had mentioned the function already. Did you keep your matrix world changes ? They shouldn't be needed
Also is your camera the same size as the surface you're drawing into ? What about viewports ?