REALLY stuck..

Started by
16 comments, last by Solarbeam 23 years, 6 months ago
Ok, this is my problem. Up till now, ive been using DrawPrimitive to render everything; is that ok? Now, i want to do visibility, but i cant exclude certain polygons for rendering or not rendering; i have to render the whole thing as a call to DrawPrimitive. Is there any way to draw polygon by polygon thats efficient? I just want something that allows me to, say, not draw polygons that are far away...Also, can someone give me some example code on how to use d3dxsimpleshapes? There isnt any REAL documentation on them in the SDK.
------------------------------*Large explosion consumes building, hero walks away unharmed* (wtf? why?) CUT
Advertisement
please? Im really stuck; i seriously need a clue...How do the real programmers do this kind of stuff?
------------------------------*Large explosion consumes building, hero walks away unharmed* (wtf? why?) CUT
Where does the data you pass to DrawPrimitive come from? You must generate it somehow!

When you''re building your list of triangles to draw, cull the ones which are wholly outside the view frustrum. Avoid costly memory allocations by allocating enough memory for all triangles beforehand.

When culling, do the z (depth) test first. This is a simple comparison of z-values. The other sides of the view frustrum are trickier to deal with.

Dave
IDirect3DDevice7::ComputeSphereVisibility will clip stuff to the viewing frustrum. YOu should change your data structures for storing the primitives.

------------------------------
#pragma twice


sharewaregames.20m.com

To my homepage is link to my d3dxsimpleshape demo that I released few months ago. Link is somewhere to news page, so you should check that.

Esa Salminen
python@dlc.fi
www.saunalahti.fi/~python
Data structures for storing the primitives? right now, im storing them in an array; is that ok? Also, how can i tell if a polygon is inside or not or behind another polygon and then how do i delete it from the array?
------------------------------*Large explosion consumes building, hero walks away unharmed* (wtf? why?) CUT
*sigh*...
------------------------------*Large explosion consumes building, hero walks away unharmed* (wtf? why?) CUT
what you mean to ask is how to create your own z-buffer. DirectX can do one for you if you want.
___________________________Freeware development:ruinedsoft.com
No, ive got a z-buffer, but i have the feeling that it''s not culling faces covered by other faces (i.e. its slow when i look at a polygon with other polygons behind it). Um, i still dont understand how to cull to the viewing frustrum. Also, i dont understand how to make distant polygons in an array not draw...Please, im begging you, i need help! My project is at a standstill because of this!
------------------------------*Large explosion consumes building, hero walks away unharmed* (wtf? why?) CUT
Are you using indexed primitives?

------------------------------
#pragma twice


sharewaregames.20m.com

This topic is closed to new replies.

Advertisement