Click here to Skip to main content
15,884,628 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
lately i am tring to drawing texture bitmap on the 3d object, with the same drawing texture interface, i used double-buffering both in directx and DrawDibDraw. it performs in the right way when to rotate texture object with directx, while when it comes to DrawDibDraw, i put back buffer in drawdibdraw, texture bitmap will be deformated when being rotated.

pseudo-code:

DrawDibDraw;

load_bitmap_file(file->buffer, bitmap);

load_image_bitmap(lpobj->buffer, file->buffer);

draw_texture(back_buffer, lpobj->buffer);

DrawDibDraw(hdc, back_buffer);

DirectX

load_bitmap_file(file->buffer, bitmap);

load_image_bitmap(lpobj->buffer, file->buffer);

draw_texture(back_buffer, lpobj->buffer);

DDraw_Lock_Back_Surface()

DDraw_Unlock_Back_Surface()

DDraw_Flip()
Posted
Updated 7-Feb-14 13:35pm
v2
Comments
AARON_ZXF 8-Feb-14 22:03pm    
oh, i have found my problem, it seems my camera is wrong. when i change my camera sight distance formula from (dis = 0.5*width / tan(fov/2)) to (dis = 0.5*width * tan(fov/2)), texture runs right. but my question is why? according to trigonometric function, dis should be equal to 0.5*width / tan(fov/2), 0.5*width * tan(fov/2) doesn't make sense.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900