Jump to content
  • Advertisement

Archived

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

BeRSeRKeR[DGT]

Problem with D3D8...

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

Hi all! I have 2 questions for you about D3D8: 1st) I have drawn a cube (with DrawIndexedPrimitive...24 vertices and 36 indices) that is shown perfectly (culling mode CCW so backfaces aren''t drawn) but when I draw another cube behind the first, the last cube is shown in front of the first one!!...I have enabled the ZBuffer and I clear the screen with D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER but the problem persist...what must I do to show the second cube hide for the first one?... 2nd) I want make a smoke effect like q3a when you fire the rocket launcher. I thought that the view look vector would be the direction that represent the smoke quad direction so if I add some value to this vector I get the quad at some distance in the view direction but it isn''t work...do you know how to make this?... Ok that''s all for now.....THANK YOU!!

Share this post


Link to post
Share on other sites
Advertisement
I just started learning about the Z-Buffer, so I don''t know if this will be of any help. I would try using SetRenderState(D3DRS_ZFUNC, value) The value would probablly depend on what corrd system your using. Either D3DCMP_LESS or D3DCMP_GREATER should do it. Hope this helps!

"I kinda think, therefore, I kinda... am?"

Share this post


Link to post
Share on other sites
You only need 8 vertices in that indexed cube. Think about it. That is what struck me at first. And also the two cubes can use the same index buffer. Set the Z function and set the value for it to be compared with as well. Have a look at the samples and see how they do Z-Buffering. That''s what they''re there for.



Please state the nature of the debugging emergency.


sharewaregames.20m.com

Share this post


Link to post
Share on other sites
Ok...my first cube was created with 8 vertices, but I didn''t know how to texture this cube with only 8 vertices...because I tried with some combinations but the texture was applied to the face incorrectly because 2 faces had the following texture coordinates:

(0.0f, 0.0f)
(1.0f, 0.0f)
(0.0f, 0.0f)
(1.0f, 1.0f)

or something similar...

Can you tell me how must I define the texture coordinates and the indices to apply the texture correctly on a 8 vertices cube??

Thankx

Share this post


Link to post
Share on other sites
Ok...my first cube was created with 8 vertices, but I didn''t know how to texture this cube with only 8 vertices...because I tried with some combinations but the texture was applied to the face incorrectly because 2 faces had the following texture coordinates:

(0.0f, 0.0f)
(1.0f, 0.0f)
(0.0f, 0.0f)
(1.0f, 1.0f)

or something similar...

Can you tell me how must I define the texture coordinates and the indices to apply the texture correctly on a 8 vertices cube??

Thankx

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!