DX built-in function for drawing geometry

Source: Internet
Author: User

There are several ready-made functions in D3DX to draw common 3D models

D3dxcreatebox

D3dxcreatesphere

D3dxcreatecylinder//Cylinder

D3dxcreateteapot

D3dxcreatepolygon

D3dxcreatetorus//Torus, similar to donut

These functions have the same three parameters, respectively, which are

1. First parameter lpdirect3ddevice9 pdevice//This is the device used to draw

2. Second-to-last parameter Lpd3dxmesh * Ppmesh//used to store the created mesh

3. Last parameter lpd3dxbuffer * ppadjacency//used to optimize mesh, we set it here to null

Other parameters are related to the specific model, such as box to specify the size, sphere to specify the radius and so on.

Let's take d3dxcreatesphere as an example to explain the general steps of using these functions

Prototype

HRESULT D3dxcreatesphere (

Lpdirect3ddevice9 pdevice,

FLOAT Radius,

UINT Slices,

UINT Stacks,

Lpd3dxmesh * Ppmesh,

Lpd3dxbuffer * ppadjacency

);


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.