Home Unity3D Channel [Institute of Unity3D game development hello Unity3D] [] [] [NGUI essays Unity Unity plugin Institute of channels [game] Android Android Institute of Development Research] [the] application development Android IOS Channel [Cocos2D Game Development Institute of IOS application development] digestive system [] [Institute of Institute of Objective-C digestive system syntax] [application development] Three20 Institutes of my work contact webmaster
5
We define its own vertex format, including D3DFVF_XYZRHW (after conversion of coordinates) and D3DFVF_DIFFUSE (diffuse). One thing to note is that there can not be used D3DFVF_XYZRHW D3DFVF_XYZ, D3DFVF_NORMAL simultaneously, because D3DFVF_XYZRHW vertex coordinates are converted through both conflict and post. VERTEX vertex structure definition, I do not just want to match the flexible vertex digestive system format defined in the order of attributes also consistent with DirectX3D given: Location (eg: x, y, z), RHW (Reciprocal of the Homogenous W, ie 1 / W), mixed weighted vertex normals, vertex size, diffuse, specular reflection, texture coordinates. digestive system
HRESULT digestive system InitVB () {VERTEX vertexes [] = {{0.0f, 200.0f, 1.0f, 1.0f, 0xff112233}, {150.0f, 0.0f, 1.0f, 1.0f, 0xff224488}, {300.0f, 200.0f, 1.0f, 1.0f, 0xff789034}}; if (FAILED (g_pDevice-> CreateVertexBuffer (sizeof (vertexes), 0, FVF, D3DPOOL_DEFAULT, & g_pVB, NULL))) {return E_FAIL;} void * pvertexes = NULL; if (FAILED (g_pVB-> Lock (0, sizeof (vertexes), (void **) & pvertexes, 0))) {return E_FAIL;} memcpy (pvertexes, vertexes, sizeof (vertexes)); g_pVB-> Unlock (); return S_OK ;}
10
26
{0.0f, digestive system 200.0f, digestive system 1.0f, 1.0f, 0xff112233},
0
, FVF
, D3DPOOL _ DEFAULT
, & G _ pVB
, NULL)))
In InitVB, first define the vertex graph, where we initialize the three vertices of a triangle, stored in vertexes array (Note: the order is filled with cutting the way the vertices, the default is clockwise, you can g_pDevice-> SetRenderState (...) to be set, we'll explain digestive system later). g_pDevice DirectX3D device pointer is valid, CreateVertexBuffer method is to create a vertex buffer, the first parameter indicates the size you want to create a vertex buffer digestive system (number of bytes), in which we set to the size of the array; second argument property that represents digestive system the vertex buffer, in this setting is 0; third parameter indicates a flexible vertex format, set to a defined FVF; fourth parameter indicates the vertex buffer memory types, enumerated types D3DPOOL choose from, and in this Select the default type D3DPOOL_DEFAULT (vertex digestive system buffer is stored in memory as possible, and when the device is lost, the data will be lost); fifth parameter is the address of the vertex buffer interface; sixth parameter is reserved in this set to NULL.
void Render () {if (NULL == g_pDevice) {return;} g_pDevice-> Clear (0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB (30, 60, 90), 1.0f, 0); if (SUCCEEDED (g_pDevice-> digestive system BeginScene ())) {g_pDevice-> SetStreamSource (0, g_pVB, 0, sizeof (VERTEX)); g_pDevice-> SetFVF (FVF); g_pDevice-> DrawPrimitive (D3DPT_TRIANGLELIST, 0, 1); g_pDevice-> EndScene ();} g_pDevice-> Present (NULL, NULL, NULL, NULL);}
14
{
1
Donate If you are willing to spend 10 bucks I drink a cup of coffee, please, digestive system please scan the QR code with a mobile phone can be oh donations through Paypal directly to me.
You may also be interested in these articles! Institute of Direct3D lighting, material (seven) by the coordinate transformation Direct3D digestive system Institute of simple solar system (six) T Direct3D Institute of & L lines (five) Institute of index buffer using Direct3D graphics rendering DirectX3D (four) DirectX3D Institute of The basic primitives (two) to create Direct3D DirectX3D Institute's first project (a) acquaintance Rails Ruby On Rails Institute of (a)
Pingback: artificial digestive system turf malibu
Pingback: tarjetas de plastico,
Pingback: slankekurer
Pingback: clove cigarettes online
Research Institute of the article digestive system summary digestive system [iTween Unity plug-in application development Android] [] [Games Android Institute of Development Research digestive system Institute of the Academy of Cocos2D] [Game] [PC gaming developers Direct3D Institute of Development] digestive system [FingerGestures the Unity plugin IOS application development] [] [NGUI Research Institute of the Unity plugin] [Institute digestive system of Objective-C syntax] [Ruby On Rails Application Development Institute] [] [Unity3D Three20 Institute of Development Research Editor] [Unity3D Academy of essays Unity Game Development] [] [] [hello Unity3D Institute of Development Tutorial digestive system Video Song] [rain] tags Xuanyu Song MOMO Institute Life (181) Rain Song MOMO (168) Game Development (105) Unity3D research Academy (102) "Unity 3D game development" (67) Android Research (42) C # (10) Objective-C Institute (10) Three20 Academy (10) IOS Academy (10) NGUI Institute (9) Zhang Xiao (8) ZXGoto (8) cocos2d (6) if (6) Lost universe (6) Direct3D Institute (6) database (5) frame animation (4) UISprite (4) screen switching (3) gravity sensing (3 ) characters move (3) Camera (3) UITexture (3) Weibo (3) Assetbundle (3) Game Script (3) video tutorial (3) JSON (3) multi-touch (2) Cocos2D Institute (2) HelloWorld (2) IOS and Unity interaction (2) navigation (2) key response (2) painted lines face painting (2) game map (2) flight shooting (2) ListView (2) WebView (2) third-party database ( 2) Map Editor (2) Scene effects (2) Camera Update (2) Institute of recent articles Unity3D digestive system listening Hierachy, Project and other structural changes in view of the judgment of the event Institute Unity3D script variables are pre-assignment or assignment editor Unity3D digestive system Prefab Prefab Unity3D Research Institute digestive system of the inside of the problems associated with the Institute of obtaining viewport area Unity3D resolve Scene view camera is not displayed in the Institute's role in post random digestive system stuff Unity3D controller component studies (xxii) Unity3D Institute of Build Assetbundle combat (sixty-three) Unity3D digestive system Institute of Jane
No comments:
Post a Comment