Advertisement Jump to content
Sign in to follow this  

Half of my level is out of purportion?

This topic is 5130 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Not sure what could be causing it, but it looks as if something is garbling the geometry data. I notice some messed up texture coordinates. It makes me wonder if everything is being loaded in poperly. (But then again, I have never tried loading Doom 3 levels or anything of the like).

Share this post

Link to post
Share on other sites
i dont have any suggestions unless you post code... but speaking of code, where are you learning the details on the file format? ;-) linky linky?

Share this post

Link to post
Share on other sites
Here is my source:

void dx9System::RenderPlane(model thisplane);

void dx9System::RenderPlane(model thisplane)
int i,a;
int texcoordnum = 0;

device->SetRenderState(D3DRS_COLORWRITEENABLE, 0xf);
if(thisplane.numofsurfaces < 1)
sys_error("RenderPlane: Numofsurfaces is invalid for this model\n");

for(a = 0; a<thisplane.numofsurfaces; a++)
IDirect3DVertexBuffer9 *vb;
IDirect3DIndexBuffer9 *ib;

if(thisplane.mapsurfaces[a].numofverts < 1 || thisplane.mapsurfaces[a].numofindexs < 1)
sys_error("RenderPlane: This surface has a illegal number of verts or indexs\n");

device->CreateVertexBuffer(thisplane.mapsurfaces[a].numofverts * sizeof(NormalTexVertex),
device->CreateIndexBuffer(thisplane.mapsurfaces[a].numofindexs * sizeof(WORD),

NormalTexVertex *verts;

vb->Lock(0,0,(void **)&verts,0);
int c = 0;
for(i = 0; i < thisplane.mapsurfaces[a].numofverts; i++)
float trixyz[3];
float oldxyz[3];

if(thisplane.mapsurfaces[a].verts[c] == 0 && thisplane.mapsurfaces[a].verts[c+1] == 0 &&
thisplane.mapsurfaces[a].verts[c+2] == 0)
sys_error("RenderPlane: Invalid triangle found\n");

trixyz[0] = thisplane.mapsurfaces[a].verts[c];
trixyz[1] = thisplane.mapsurfaces[a].verts[c+2];
trixyz[2] = -thisplane.mapsurfaces[a].verts[c+1];

verts = NormalTexVertex(trixyz[0],trixyz[1],

texcoordnum += 2;
c += 3;
WORD *indicies;

ib->Lock(0,0,(void **)&indicies,0);
for(i = 0; i< thisplane.mapsurfaces[a].numofindexs; i++)
indicies = thisplane.mapsurfaces[a].indexs;

device->DrawIndexedPrimitive(D3DPT_TRIANGLELIST,0,0,thisplane.mapsurfaces[a].numofverts,0,thisplane.mapsurfaces[a].numofverts / 3);

Doom 3 Unoffical File Formats

The above link gives you all the various for Doom III except the AAS format, which is the AI helper file.

Everything is being loaded correctlly. Ive debugged the points being added to the final arrays(NormalTexVertex *verts, and WORD *indicies), and they are all correct.

Makes me wonder if Doom III has any type of scaling to do before you render the points?


TExture corrds are probley wrong because the polygons are streched out to much.

Share this post

Link to post
Share on other sites
Guest Anonymous Poster
Looks like you have error either in your data as it is read, or your creation of your vertex buffers, (size, count, offset, stride etc). The give away is the funky skewed texture coordinates, and planes appear to span forever.

Also your code above is not near enough complete for anyone to help you. Try posting some more.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!