Skip to main content
GameDev.net gamedev.net
🔒 Locked

rendering woes

Started by fireking Oct 18, 2003 at 11:58 PM 6 replies 950+ views
Original Post
fireking
fireking
bleh!!!!!!!!!!!!!!!!!!!!!!! ok had to get that out of my system... im using the code from "programming role playing games with direct x" written by jim adams, and i took his mesh level application from chapter 12, and im loading a direct x model of my own into it... here's the deal, it looks like total crap, and i dont know why here's the picture... whats up with this? [edited by - fireking on October 19, 2003 1:00:15 AM]
--FirekingOwner/LeaderFiregames Development &Blackdragon Studios
billybob
billybob
that is Z fighting. what are you using for your projection matrix values? near should be at least 1.0, far depends on your unit scale. or use a higher Z precision, but you shouldn''t have any trouble with a 16 bit z buffer.
fireking
fireking
so basically i need to set the presentation struct to have the D3DFMT_D16 and clear the zbuffer in the frame procedure?

if so, thanks!
--FirekingOwner/LeaderFiregames Development &Blackdragon Studios
fireking
fireking
its still messing up... zbuffer is definately enabled, i checked

GetRenderState(D3DRS_ZENABLE,&res);
if(res)
MessageBox(NULL,"TRUE","ZBUFFER ENABLED?",0);

any other suggestions?
--FirekingOwner/LeaderFiregames Development &Blackdragon Studios
Nik02
Nik02
Whether z-buffer is enabled or not wasn''t the point. Try setting a smaller ratio of your z-near and z-far planes when you construct your projection matrix. Especially the near plane should be set to as high as you can afford.

-Nik
Niko Suni
emilk
emilk
as billybob pointed out, check your values for near and far.
If your world is a room thats 10 meters wide, you should try with near = 0.1 and far = 20, or something similair (provided one unit is one meter).
fireking
fireking
m_Graphics.SetPerspective(D3DX_PI/4,1.3333f,0.1f,10000.0f);
--FirekingOwner/LeaderFiregames Development &Blackdragon Studios
fireking
fireking
OH! now i see! i set it to 10.0f, and everything is fine! now i just have to figure out why my guy is moving all twitchy-like (its the new word for the day), some of this dood''s code is broken
--FirekingOwner/LeaderFiregames Development &Blackdragon Studios

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.