Skip to main content
GameDev.net gamedev.net
🔒 Locked

(DX) Draw simple primitives

Started by crucifer Apr 24, 2006 at 9:09 PM 2 replies 800+ views
Original Post
crucifer
crucifer
I know how to use VertexBuffers and IndexBuffers ... but often, I need some simple primitives shapes only for testing purpose (ie : a sphere to represent the location of a light I just added). I have heard that there is a way to have DX generate such shapes without having to provide a VB or IB. ... generic parametric shapes. I was unable to find the API to do so ? any suggestions ? anybody knows how ? Thx
crucifer
crucifer
bump
noNchaoTic
noNchaoTic
look under the D3D docs, there are some Create functions to make spheres, teapots and crap, and they return a D3DXMesh object. Which to draw you would just call:

ID3DXMesh::DrawSubset()

Use the index of 0 for most of the mesh's returned by the stock create methods.
Steven ToveySPUify | Twitter

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.