Trouble with simple 3d projection in GMS2

J

Jimmyturbo

Guest
Hello! I'm trying to create a scene in 3d that's largely static, but takes advantage of depth in order to create a beautiful parallaxing effect when the camera moves slightly or screenshake is applied. You can see in the bottom picture what I'm going for. Basically sprites acting like they were cardboard cutouts on a stage, their depth providing the 3d feel.



I've managed to get the bottom sprite and camera set up nicely following tutorials and videos. But I can't seem to figure out how to make objects draw their sprite in 3d space. This is all I've got at the moment:



Would be super grateful for any help or tips
 

Roa

Member
you can apply the sprites as a texture to a quadrilateral model.

create event
Code:
//create storage for a model
model=d3d_model_create();

//load the sprite as a texture, the sprite name, then the index of the subimage. Must be a power of 2, clicking the 3d texture box helps prevent pixel leaks on the edges
tex1=sprite_get_texture(sprite_index,image_index);

//creates a plane aligned with the zaxis. You have a top left corner, and a bottom right corner. Your image will be stretched over this polygon. These cords are relative to its own 0,0,0 coordinate.
d3d_model_wall(model,x1,y1,z1,x2,y2,z2)
draw event
Code:
//tells where to draw the model in relation to world coordinates and with what texture.
d3d_model_draw(model,x,y,z,tex1)
Your question was probably ignored cause you posted it in a questionable forum. Probably would have done better in Q&A
 

andev

Member
If you're only looking to create a parallax effect using cardboard cut outs and not 3d models, why even bother with 3D? Nice artwork by the way, it already looks good and you've only done the floor.
 
H

HammerOn

Guest
If you're only looking to create a parallax effect using cardboard cut outs and not 3d models, why even bother with 3D?
Perspective distortion visually enhances parallax and zoom effects. Even if all the assets are 2D, a lot of special effects are way easier to achieve and set up in a 3D scene.
 
Top