VB->IB->Render method?

Started by
3 comments, last by kaostika 22 years ago
I have a bit of code that puts my mesh format into a vertex buffer and then the face of the mesh into an index buffer. I am stuck on how to get the little (animated) bugger to render though. right now i am updating the VB and IB each frame, and then rendering(in theory). What is the right way to do this (or at least a way that works)?
If they're called waiters, why do _I_ have to wait on _them_?
Advertisement
DrawIndexedPrimitive ??

Sorry, I don''t fully understand what you''re asking, and what you''re having difficulty with. Are you looking for code? A way to organise your data? A way to render a complicated mesh that uses several different materials? What do you want?

John B
The best thing about the internet is the way people with no experience or qualifications can pretend to be completely superior to other people who have no experience or qualifications.
Sorry. I am using DrawIndexedPrimitive to render, but am not getting any visible results. pseudo code below:

count meshes
for each mesh
count submeshes
for each submesh
check vertex data
lock vertex buffer
update buffer with new mesh data
unlock buffer

check face data
lock index buffer
update buffer with face data
unlock buffer

set stream source, stream data, vertex shader etc.
DrawIndexedPrimitive
end
end

I think that my logic is flawed but I''m not sure how. Is this the proper method to update and render vertex and index buffers? Is there a better way (that actually works)?
If they're called waiters, why do _I_ have to wait on _them_?
Have you tried setting D3DRS_CULLMODE to D3DCULL_NONE, to turn face culling off? Are you setting any world matricies? If not, try setting that matrix to an Identity matrix. Try changing the clear color to something odd (magenta is good) to see if its just being rendered black. Turn on the Debug runtimes, and see what pops up in the Output Window, if anything...

Z.
______________"Evil is Loud"
I set the clear color to every color I could think of, so I am sure it isn''t being rendered black. CULLMODE_NONE slowed the frame rate to 5 fps (from 40 fps), I also tried CULLMODE_CW and CCW, both of which returned my frame rate. I am having a devil of a time with it''s matrices, so I''ll try to fiddle with these. Is it a possibility that it actually is being rendered, just in some area of my world that I don''t have access to (i.e. outside my map)? I think it could be. I will try increasing the zbuffer, as well as turning it completely off (I love how that looks), and then rendering in wireframe mode to see if the little bugger is under my map. Grr... this is too much fun.
If they're called waiters, why do _I_ have to wait on _them_?

This topic is closed to new replies.

Advertisement