Archived

This topic is now archived and is closed to further replies.

kmsixpence

D3D8 Problem, need help from xperts

Recommended Posts

I started working with d3d8 after getting used to d3d7im. Eventually, i figured i needed a good engine to work with so i started one with a CPrimitive3D class that draws points, triangles(tris), squares(which i call quads) and cubes. I got points up and running easily. Triangles and quads took a little work but i got them up within a week. Now for cubes. I tried a bunch of methods. Indexed primitives confused me so i skipped them. Instead, i tried doing on big triangle strip but that didn''t work either. Eventually, i decided i would create one vertex buffer that would hold 6 faces, 2 triangles in each. It would drawprimitive a triangle strip 6 times, calling each face once. It worked, but the problem I got though is that faces overlap each other. ZBuffering is set. Cullmode is CW. I can''t figure it out. Should i try doing the testing of which to draw first by hand, doing a million calculations? or should i create multiply vertex buffers because i think i might of heard that zbuffering and culling and such only works on a single vertex buffer so the individual vertices won''t be affected. Is that correct? Can zome1 help me plz?

Share this post


Link to post
Share on other sites
or jsut use the D3DXCreate* set of functions. you can create boxes (which are cubes), spheres and other assorted simple geometry. also, just to let you know, everyone calls to triangles together to form a rectangular polygon, a quad. since they are obviusly not squares (since they can be rectangles) and they are not rectangles (since they can have non 90 corners)

Share this post


Link to post
Share on other sites
That''s what the''yre called in the engine. I didn''t want to compare it to opengl quads. I do have 6 quads, 4 vertices in each, rendering each one as a triangle fan. They are all in one vertex buffer. I don''t know why they draw in the order you draw them. I thought d3d8 could do the math for you to order the scene. Is that normal? Also, i looked into the d3dxcreatebox function already and I didn''t want to use it because i like to create stuff by myself. I wouldn''t learn anything if i just used that function.

Share this post


Link to post
Share on other sites