3D 3d collision part 2

phillipPbor

Member
I having problems with a player mask

the 3d player wont respond to the mask
the sprite is 32 x 32
the mask is 16 x 16

the player thinks the mask is 32x32
not to mantion the collision is off place



{
spt = sprite_index;
if (point_distance(x,y,global.camx,global.camy) > 240) exit;
var tex;
tex = sprite_get_texture(spt,image_index);
d3d_draw_wall(x+8*global.camsin,y+8*global.camcos,z+height,
x-8*global.camsin,y-8*global.camcos,z,tex,1,1);
draw_set_alpha_test(1);
// draw_set_alpha_test(true);
// draw_set_alpha_test_ref_value(128);
///background
var tex2;
tex2 = background_get_texture(BG_CLD);
d3d_draw_ellipsoid(x-420,y-420,z-420,x+420,y+420,z+420,tex2,6,6,16);
}
 
Last edited:
Hi again.

Can you describe your problem a little more exactly.

It is not clear to me how the code you posted relates to the probelm you are trying to solve.
 
Do you mean you don't want the sprite to appear to change height as the camera pitches up and down?

Because at first, I thought your problem had to do with collision detection.
 

phillipPbor

Member
Do you mean you don't want the sprite to appear to change height as the camera pitches up and down?

Because at first, I thought your problem had to do with collision detection.
well I also was trying to fix the mask for the player
the sprite is 32x32 while the mask is 16x16
instead it wont listen to the program.
the player thinks the mask is 32x32
 
You're talking about the collision, mask, correct?

Is the origion of the mask centered in the sprite editor?

Also check that the mask sprites for other things are the correct size and have the correct origin offset.

And have you changed image_xscale or image_yscale in the player object?
 

phillipPbor

Member
You're talking about the collision, mask, correct?

Is the origion of the mask centered in the sprite editor?

Also check that the mask sprites for other things are the correct size and have the correct origin offset.

And have you changed image_xscale or image_yscale in the player object?
i have not changed the size of the player object

yes the mask is origion at the center


((Also check that the mask sprites for other things are the correct size and have the correct origin offset.)) how?
 
One of a few things are probably going wrong.

You might be drawing the player in the wrong position or at the wrong size.

Or, you might be drawing everything else in the wrong position.

Or, the collision masks have the incorrect origin offset or are not scaled correctly.

So make sure you double check all of those things.

After you've done that, and if you still can't figure out what's wrong, probably the fastest way to solve this problem would be to look at the project itself.

EDIT: I presume you aren't doing something really weird with your collision checks, but if anything unusual is going on there, it could also be the source of the problem.
 
Top