2D bitmaps in 3D
Hi all. I am hoping you can help me with this latest prob. I am near the end of making my first 3D game, and I am trying to make it so a 2D explosion bitmap appears when a bad guy is killed.
Now, this works perfick, but I wanted bigger explosions so I increased the scale (I created a class that has ''scale'' as one of its attributes (explosion.scale += 3)). Now when I play, the explosions occur, but in completely messed up locations, nowhere near where they are supposed to be.
The problem is in the scaling - I know that much, and I was wondering, is there a solution that doesn''t involve me having to open the bmp in Paint and increasing the scale myself?
I read something about having an orthogonal projection matrix to display 2D objects in 3D - would this help?
Your input would be much valued. Thanks.
"Sweetie! Get Mommy''s bazooka!"
How are you applying the scale? Wen you scale something that is not centered about the origin, you translate the point as well..
heres the function:
Should I change the order the matrices in the multiply function? Or is it something else?
Edit - Nope. Changing the multiplication order made things worse.
"Sweetie! Get Mommy's bazooka!"
[edited by - Mister Stewart on November 22, 2002 11:31:38 AM]
void MWS_3DBitmap::set_matrices(LPDIRECT3DDEVICE8 global_device){ //translation D3DXMatrixTranslation(&translate_matrix, move_x, move_y, move_z); //scaling D3DXMatrixScaling(&scale_matrix, scale_x, scale_y, scale_z); //multiply D3DXMatrixMultiply(&world_matrix, &translate_matrix, &scale_matrix); //set the transform global_device->SetTransform(D3DTS_WORLD, &world_matrix);}//END SET_MATRICES()
Should I change the order the matrices in the multiply function? Or is it something else?
Edit - Nope. Changing the multiplication order made things worse.
"Sweetie! Get Mommy's bazooka!"
[edited by - Mister Stewart on November 22, 2002 11:31:38 AM]
are your verts centered around the geometric middle of your quad? if not the scaling will not work out correctly.
quote:Original post by Anonymous Poster
are your verts centered around the geometric middle of your quad? if not the scaling will not work out correctly.
Sorry I do not understand...
Also, regarding doing the scale first, then the translate, I tried it and it did not work.
[edited by - Mister Stewart on November 22, 2002 3:54:17 PM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement