Jump to content
  • Advertisement

Archived

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

VyvyanBasterd

D3D Cubes...

This topic is 6628 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

What''s the best way to draw a cube in D3D? Should I use Triangle Strips, 2 big Triangle Fans, or what? Basically, I''ve got a six-sided cube (duh) with three textures; front & back share one, top & bottom another, and left & right the third. Interestingly enough, I''ve currently implemented it as a vertex buffer drawn as a Triangle Strip (24 points). All three textures have been put into a 256 x 256 texture map, each taking up 64x64 (with one 64x64 block going unused). This works fine on my Voodoo 3. However, it will *NOT* work on my friend''s TNT2 Ultra! This is why I''m asking...I want to find out the best way to draw/implement my cubes and ensure that they work. Any help or ideas?

Share this post


Link to post
Share on other sites
Advertisement
The way you''re doing it is the best way to do it. It should work on the TNT2 Ultra as well, you are probably making some mistake. Check the error codes that you should get from the DX calls.

- WitchLord

Share this post


Link to post
Share on other sites
I have exactly the same problem! The texture is not showing up, right? Try to switch to RGB Emulation...

I also think triangle strip is the best chooise.

Gandalf the White

Share this post


Link to post
Share on other sites
Thanks for the advice, Witchlord & Gandalf, but interestingly enough, when I had the texture as a long one, 64x512 (instead of 256 square), it worked fine on my friend''s TNT2, but it didn''t work on my Voodoo3! So I squared it up, and now the reverse is true! Ack!

All return codes are DD_OK, which makes it REALLY odd. Is there something going on with my vertex buffer? I know I changed the VERTEXBUFFER struct flag from SYSTEMMEMORY to simply ''0''. Any other ideas?

Share this post


Link to post
Share on other sites
Okay , real simple one here - the reason the texture creation
failed on the voodoo3 is that (with the later DX7 drivers) the
V3 can no longer do non-square textures - I know this cos I''ve
got an engine that used to work pre-dx7 drivers creating up
textures. After upgrading the drivers it fell over. I even
had the code checking the the appropriate DX7 flag in the
devicedesc and it said you could do non-square - bah!

Anyway - as to the other problem - can you be more specific
on the way that the textures are created ? I''m not sure but
there might be a problem in the way you are uploading the texture
to the board that the TNT2 doesn''t like.

Suggestions:

Set the texture to NULL for all renderings and color each pair
of faces (or have seperate color for each one). Do you get
anything rendered ?

If yes - then there is a problem in your code uploading the texture to the TNT2

If no - Hmm ... strange - sounds like a VB problem of some sort.
Not sure how this should be bad. If you are leaving the driver to
decide where to put the VB then it should be fine.

Really need more info on this.

--
Code..reboot..code..reboot..sigh!

Share this post


Link to post
Share on other sites
Yeah, *I* need more info on it, too! Unfortunatly, both of our machines aren''t side by side, so I can''t test this very dynamically. The texture is getting created properly on the TNT, because it is used elsewhere in the program. I''ll give your suggestion a try tomorrow night, though, when we get together again, and see if it produces any new results.

I''m thinking it MAY also be a driver problem...I''ll have to look into which version of drivers he is using.

Thanks!

James

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!