Noah Copeland
Member
Hello,
I'm working on mode 7 type of game. I'm using projection for most things and it's working fine. However, I want to get the object sprite (rings, springs, etc) to keep their absolute sprite size (i.e. completely ignoring deformation/transform caused by the 3D matrix). This is because I want to handle the scaling by hand drawn frames, like old school games did. Like this:
So, I need to figure out how to translate the xyz coordinates of an object in 3D world-space to where it is in on 2D screen space, and then draw the sprite there. (I can probably figure out the frame scaling after that, don't worry about that part).
Does anyone have any idea how to do this?
For reference, this is how I'm projecting the 3D, in my objCamera object.
note: Yes, I've search the forums and found a few topics on it. Unfortunately, most of them relate to shaders, which I don't think is a good solution for this. I did try them though, and could not get them working. Not 100% they were even trying to achieve the same thing. Others were examples from Gm8 that don't seem to translate to my application in GMS2. Trust me, I've tried.
I'm working on mode 7 type of game. I'm using projection for most things and it's working fine. However, I want to get the object sprite (rings, springs, etc) to keep their absolute sprite size (i.e. completely ignoring deformation/transform caused by the 3D matrix). This is because I want to handle the scaling by hand drawn frames, like old school games did. Like this:
So, I need to figure out how to translate the xyz coordinates of an object in 3D world-space to where it is in on 2D screen space, and then draw the sprite there. (I can probably figure out the frame scaling after that, don't worry about that part).
Does anyone have any idea how to do this?
For reference, this is how I'm projecting the 3D, in my objCamera object.
Code:
//Create
global.ViewWidth = 398
global.ViewHeight = 224
fov = 60;
xto = 0;
yto = 0;
zto = 0;
Code:
//draw
d3d_set_projection_ortho(0, 0, 320, 240, 0);
d3d_set_projection_ext(x, y, z, xto, yto, zto, 0, 0, 1, fov, global.ViewWidth / global.ViewHeight, 1, 32000);
note: Yes, I've search the forums and found a few topics on it. Unfortunately, most of them relate to shaders, which I don't think is a good solution for this. I did try them though, and could not get them working. Not 100% they were even trying to achieve the same thing. Others were examples from Gm8 that don't seem to translate to my application in GMS2. Trust me, I've tried.
Last edited: