Hi all.
I am having a bit of trouble understanding vertices and indices...
I understand the Lock/Unlock concept but i don't get this part...Code:Vertex* vertices; /*Lock the Vertex buffer to access it's memory*/ VB->Lock( 0, /*Offset, in bytes, from the start of the buffer to the location to begin the lock*/ 0, /*Number of bytes to lock*/ (void**)&vertices, /*A pointer to the start of the locked memory, converted from Vertex** to void** */ 0); /*Flags describing how the lock is done*/ /*Vertices of a unit cube*/ vertices[0] = Vertex(-1.0f, -1.0f, -1.0f); vertices[1] = Vertex(-1.0f, 1.0f, -1.0f); vertices[2] = Vertex(1.0f, 1.0f, -1.0f); vertices[3] = Vertex(1.0f, -1.0f, -1.0f); vertices[4] = Vertex(-1.0f, -1.0f, 1.0f); vertices[5] = Vertex(-1.0f, 1.0f, 1.0f); vertices[6] = Vertex(1.0f, 1.0f, 1.0f); vertices[7] = Vertex(1.0f, -1.0f, 1.0f); VB->Unlock(); /*Unlock the Vertex buffer*/
Mayby if you help me understand this i might not have to ask about indices... HopefullyCode:/*Vertices of a unit cube*/ vertices[0] = Vertex(-1.0f, -1.0f, -1.0f); vertices[1] = Vertex(-1.0f, 1.0f, -1.0f); vertices[2] = Vertex(1.0f, 1.0f, -1.0f); vertices[3] = Vertex(1.0f, -1.0f, -1.0f); vertices[4] = Vertex(-1.0f, -1.0f, 1.0f); vertices[5] = Vertex(-1.0f, 1.0f, 1.0f); vertices[6] = Vertex(1.0f, 1.0f, 1.0f); vertices[7] = Vertex(1.0f, -1.0f, 1.0f);



LinkBack URL
About LinkBacks



CornedBee