This tutorial is part of a Collection: 02. DirectX 10 - Braynzar Soft Tutorials
rate up
0
rate down
2983
views
bookmark
17. Loading 3D Models

In this lesson, we will learn how to use the ID3D10Mesh interface to store a 3d model file exported from a 3d modeler such as 3D Studio Max. Since you can find free loaders for almost any 3d model format, we will load a custom 3d model format exported from 3ds max, just to show you how it is done. We will be learning about and using the ID3D10Mesh interface, which we will use to store our 3d model into. This lesson builds off the last lesson, Direct Input.

There are no files for this tutorial
We will be building off the Direct Input lesson. I think this lesson is very exciting! In this lesson, I have made a custom 3d model format, with the simple extension .dat. The reason i have done this is to make it very clear what we are doing and how to go about loading a 3d model. I would have used another format such as .obj, but there are many parsers our there for the common 3d model formats, and instead of walking you through a complex parser, we just have a simple one (which is strongly based of a couple others i was looking at) to parse through our dat file containing the geometry for a sphere, normals, texture coordinates, index list (or face/triangle list), and the textures we will use. I am not very good with 3d modelers, so it was quite annoying trying to create a script to export a model how i wanted, i ended up copying a bunch of peoples scripts and putting the parts together which i needed, and somehow managed to get it to work. Since i'm using a free web hosting service right now to host this site, downloading is not possible, so to use the model which i've created, you must copy it from here then paste it to notepad, and save it as "sphere.dat". If you had experience with directx 9.0, you might have known about a function which created mesh from loading an x file. This function was removed from directx 10.0. So now we must load our models manually. In this lesson, we will be loading a 3d model from a file, and storing it into a ID3DX10Mesh. When using a mesh, we do not need to create our own buffers anymore, the mesh will create them for use, as long as we provide information. We can also use the optimizing feature, which will take away extra vertices, or combine them into one, depending on how close together they are. As you can see at the beginning of our code, we have included 3 new files into our project. The first two will be used to load the 3d model from a file, and the third one is so we can use vectors, which are basically dynamic arrays, meaning we do not have to declare the size when we first create them, and we can add things and take things out, whereas in an array, we must define the exact size when first making it, and that size can never be changed after we make it. You should already know this, but i thought i'd just mention it since it took me a long time to learn about vectors for some reason. #include <fstream> #include <istream> #include <vector> First we are creating a vector of ID3DX10Mesh objects to hold our meshes. Vectors will be usefull here if you want to load more than one model this way, and don't know how many. Then we make a variable to take count of our meshes that we loaded. The next line is declaring our new function, called LoadMesh(). It takes one argument, and that is the filename we will be loading the 3d model from. After that we have another vector to hold the texture (subset) count for each mesh, and then another vector to hold our texture resource views. vector<ID3DX10Mesh*> meshes; int meshCount; bool LoadMesh(wstring filename); vector<UINT> meshSubsets; int meshTextures = 0; vector<ID3D10ShaderResourceView*> TextureResourceViews; Lets now go down to our new function, the LoadMesh() function, where we will be loading the 3d model from our file to an object created from the ID3DX10Mesh interface. The first line in this function creates an HRESULT called hr which we can use to test if things worked the way we wanted. After that, we initialize a temporary mesh to load the 3d model stuff into before we put it into our meshes vector. The next line is creating a wide input file stream to the filename we want to load our 3d model from. The next line we are creating a wide string used to skip words we do not need, called skipString. After that we initialize three variables to hold the number of vertices, triangles in our model, and temporarily hold the subset count for the mesh. bool LoadMesh(wstring filename) { HRESULT hr = 0; ID3DX10Mesh* tempMesh; wifstream fileIn (filename.c_str()); wstring skipString; UINT meshVertices = 0; UINT meshTriangles = 0; UINT tempMeshSubsets = 0; Here we check to make sure we were able to open our file. If we were, we start reading. We skip the first string in the file "#Subsets" and read the next number, which will be the number of subsets in our model. A subset is a group of triangles with the same attributes, such as textures or render states, like blending or wireframe. We groupe the triangles with the same attributes because when it comes time to render them, we need to set the texture or render state, then draw the triangles, then set the render state or textures for the next group. Our sphere really only needs one groupe, but i separated it into two just for the sake of showing you. After we store the number of subsets, we skipe the next string "#Vertices", then read the next number, which is the number of vertices in our model. Then we do the same thing for the number of triangles. Next we add the tempMeshSubsets number we just got to our meshSubsets vector. if (fileIn) { fileIn >> skipString; // #Subsets fileIn >> tempMeshSubsets; fileIn >> skipString; // #Vertices fileIn >> meshVertices; fileIn >> skipString; // #Faces (Triangles) fileIn >> meshTriangles; meshSubsets.push_back(tempMeshSubsets); After we have the necessary information, we are able to create our mesh, and store it into our tempMesh. We can use the HRESULT hr here to make sure the mesh was created, if not, give error and return false out of the function. To create a mesh, we use the D3DX10CreateMesh() function, which has 8 parameters, here is the function: HRESULT D3DX10CreateMesh( __in ID3D10Device *pDevice, __in const D3D10_INPUT_ELEMENT_DESC *pDeclaration, __in UINT DeclCount, __in LPCSTR pPositionSemantic, __in UINT VertexCount, __in UINT FaceCount, __in UINT Options, __out ID3DX10Mesh **ppMesh ); **pDevice** - Pointer to the D3D device which we will create the texture with (d3dDevice). **pDeclaration** - This is a pointer to the first element in our vertex layout (D3D10_INPUT_ELEMENT_DESC array) we created. **DeclCount** - Number of elements in our vertex layout array. **pPositionSemantic** - This is the "POSITION" or element describing our vertex position in our vertex layout. **VertexCount** - numVertices, or number of vertices in the 3d model. **FaceCount** - numTriangles, or number of triangles (a.k.a. faces) in the 3d model. **Options** - This can be zero, one or both of the D3DX10_MESH_32_BIT or D3DX10_MESH_GS_ADJACENCY flags. The 32 bit flag tells the mesh to use 32 bits in the index, otherwise it uses 16 bits. The other flag says the mesh has adjacency information, which we will then have to use D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ to render our triangles, otherwise we use D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST to render our triangles. **ppMesh** - Returns our created mesh. We will use this image in this application hr = D3DX10CreateMesh(d3dDevice, layout, 3, layout[0].SemanticName, meshVertices, meshTriangles, D3DX10_MESH_32_BIT, &tempMesh); if(FAILED(hr)) { MessageBox(0, L"Mesh Creation - Failed", L"Error", MB_OK); return false; } Now we go back to reading info from our file. Next we will read the vertex information which in this case includes position, normals, and texture coordinates. We start by skipping the "#Subset_info" string, and then enter a loop. This loop will repeat meshSubsets number of times, or two times if your using the model i have provided, once for each subset. First this loop creates a wide string called diffuseMapFilename to store our texture filename into. then it reads the texture filename and stores it into our wide string. after that it creates a shader resource view called DiffuseMapResourceView, which we will store our texture into. Next, we do just that, we store our texture from the filename into the DiffuseMapResourceView shader resource view. We then insert this shader resource view into our vector of Texture Resource Views. fileIn >> skipString; //#Subset_info for(UINT i = 0; i < tempMeshSubsets; ++i) { std::wstring diffuseMapFilename; fileIn >> diffuseMapFilename; ID3D10ShaderResourceView* DiffuseMapResourceView; D3DX10CreateShaderResourceViewFromFile(d3dDevice, diffuseMapFilename.c_str(), 0, 0, &DiffuseMapResourceView, 0 ); TextureResourceViews.push_back(DiffuseMapResourceView); meshTextures++; } After we have read the information about our subsets, we need to get our actual vertex information. First we create an array of vertex objects of size meshVertices (or the number of vertices in the 3d model), called verts. After that we skip the string called "#Vertex_info", and jump into a loop, which will loop meshVertices number of times, or as many vertices as there are in the 3d model we are storing. First we will read the position of our vertex. Then the Normals and then the texture coordinates. I'm sure you can figure out whats going on here. After we have read all our vertices from the file, we send the array to our mesh by using the function "HRESULT ID3DX10Mesh::SetVertexData(UINT iBuffer, CONST void *pData);". The first parameter is the index of the vertex buffer we will be setting. The second is the array of vertices we will be sending to the buffer. Then after we set our meshes vertex buffer, we delete the verts array. Vertex* verts = new Vertex[meshVertices]; fileIn >> skipString; //#Vertex_info for(UINT i = 0; i < meshVertices; ++i) { fileIn >> skipString; //Vertex Position fileIn >> verts[i].pos.x; fileIn >> verts[i].pos.y; fileIn >> verts[i].pos.z; fileIn >> skipString; //Vertex Normal fileIn >> verts[i].normal.x; fileIn >> verts[i].normal.y; fileIn >> verts[i].normal.z; fileIn >> skipString; //Vertex Texture Coordinates fileIn >> verts[i].texCoord.x; fileIn >> verts[i].texCoord.y; } tempMesh->SetVertexData(0, verts); delete[] verts; We have read our subsets information, and our vertex information, now all thats left is to read our index information, which describes our faces. First thing we do is create an array of DWORDs to store our indices into, of size meshTriangles * 3. We do this because each triangle has 3 indices, which describe which vertices to use and in which order. Then we also create a UINT array to hold our attribute Index into, or more simply, subsets. Now we skip the string "#Face_Index" and jump into our loop which will repeat meshTriangle number of times, or the number of triangles in our 3d model. You can probably guess what its doing in the loop, so we can move on. After the loop, we call the function "HRESULT ID3DX10Mesh::SetIndexData(CONST void *pData, UINT cIndices);". This function will create our index buffer. The first parameter is the array of indices we want to set, the second is the number of indices. After we create our index buffer, we need to create our attribute buffer by calling "HRESULT ID3DX10Mesh::SetAttributeData(CONST UINT *pData);", which the only parameter is for the UINT array of attributeID's for each triangle. Now that we are done with the attributeIndex and indices array's, we can delete them. DWORD* indices = new DWORD[meshTriangles*3]; UINT* attributeIndex = new UINT[meshTriangles]; fileIn >> skipString; //#Face_Index for(UINT i = 0; i < meshTriangles; ++i) { fileIn >> indices[i*3+0]; fileIn >> indices[i*3+1]; fileIn >> indices[i*3+2]; fileIn >> attributeIndex[i]; //Current Subset } tempMesh->SetIndexData(indices, meshTriangles*3); tempMesh->SetAttributeData(attributeIndex); delete[] indices; delete[] attributeIndex; To optimize our mesh, taking out extra vertices, we need to find which vertices are in the same position. In the 3d model i have provided, all the triangles use their own 3 vertices, which means pretty much every vertice is overlapped with another one. To find out with vertices overlap, we call the function "HRESULT ID3DX10Mesh::GenerateAdjacencyAndPointReps(FLOAT Epsilon);". The Epsilon value is used to find two points that may not be exactly equal, but are close enough to be considered equal. we have used the epsilon value of 0.001f. If two vertices are within this distance of each other, they are considered equal. After we have done this, we can optimize our mesh using the function: HRESULT ID3DX10Mesh::Optimize( UINT Flags, UINT *pFaceRemap, LPD3D10BLOB *ppVertexRemap); **Flags** - One or more flags from the D3DX10_MESHOPT enumerated type. We will use the two flags D3DX10_MESHOPT_ATTR_SORT and D3DX10_MESHOPT_VERTEX_CACHE. ATTR_SORT sorts the geometry by attribute and creates an attribute table, making DrawSubste more efficient. The other one, VERTEX_CACHE, creates a hardware buffer to store vertices. If a vertice is used again that is already in the buffer, it does not need to be processed again. **pFaceRemap** - This is a pointer to a UINT array to store the face remap information. We don't have one so set it to zero. **ppVertexRemap** - This is a pointer to ID3D10Blob that will be filled with the vertex remap information. We can set this to zero if we will not use it. When we create a mesh, it stores it into system memory, so the cpu can easily access it. When we are done with it, we need to place it into the graphics memory, so it can be efficiently rendered. we do this by calling "HRESULT D3DX10Mesh::CommitToDevice();". After all that, we add one to our meshCount variable, and put the tempMesh we have just created into our meshes vector. tempMesh->GenerateAdjacencyAndPointReps(0.001f); tempMesh->Optimize(D3DX10_MESHOPT_ATTR_SORT|D3DX10_MESHOPT_VERTEX_CACHE,0,0); tempMesh->CommitToDevice(); meshCount++; meshes.push_back(tempMesh); } If the file was not opened, we display an error and return false. Otherwise, if all went well, we return true from the function. else { MessageBox(0, L"Load Mesh File - Failed", L"Error", MB_OK); return false; } return true; } In our init scene, we call our new function, with the name of our filename. This will create our mesh and put it into our meshes vector. LoadMesh(L"sphere.dat"); Now we go to our cleanup function, and release the vector of meshes we created. for(int i = 0; i < meshCount; i++) if( meshes[i] ) meshes[i]->Release(); Finally, we render our mesh. When rendering meshes, we render each subset separately. First we enter the loop for each of our shader passes. Then enter the loop for each of our subsets. The next thing we do is set our texture to the current subsets texture in our TextureResourceViews array. then we apply our techniques pass, and finally render our current subset, using the DrawSubset function of the ID3DX10Mesh object. There are lots of different ways to do things, but if we were loading a second model, when we set our texture to "subsetID", we would need to add all the previous subsets to it, for example, if we had 3 meshes, and we were going to draw the third mesh, this is how the line would look: fxDiffuseMapVar->SetResource(TextureResourceViews[subsetID + meshSubsets[0] + meshSubsets[1]]); Of course, creating another vector would be easier if there are hundreds of models to load. If you can't figure it out, let me know and i'll show you how to create a vector to hold the textures offset for each model. for( UINT p = 0; p < techDesc.Passes; ++p ) { for(UINT subsetID = 0; subsetID < meshSubsets[0]; ++subsetID) { fxDiffuseMapVar->SetResource(TextureResourceViews[subsetID]); Technique->GetPassByIndex( p )->Apply( 0 ); meshes[0]->DrawSubset(subsetID); } } I really hope someone finds this lesson usefull, as I could NEVER find any easy way of loading a 3d model into directx when i started out. If you find this lesson helpful, let me know! Here's the final code: main.cpp #include <Windows.h> #include <d3d10.h> #include <d3dx10.h> #include <string> #include <dinput.h> /////////////////////////new///////////////////////////////////////////////// #include <fstream> #include <istream> #include <vector> /////////////////////////new///////////////////////////////////////////////// #pragma comment (lib, "dinput8.lib") #pragma comment (lib, "dxguid.lib") #pragma comment(lib, "D3D10.lib") #pragma comment(lib, "d3dx10d.lib") using namespace std; LPCTSTR WndClassName = L"firstwindow"; HWND hwnd = NULL; const int Width = 800; const int Height = 600; bool InitializeWindow(HINSTANCE hInstance, int ShowWnd, int width, int height, bool windowed); HRESULT hr; ID3D10Device* d3dDevice; IDXGISwapChain* SwapChain; ID3D10RenderTargetView* RenderTargetView; ID3D10Effect* FX; ID3D10InputLayout* VertexLayout; ID3D10Buffer* VertexBuffer; ID3D10Buffer* IndexBuffer; ID3D10EffectTechnique* Technique; ID3D10DepthStencilView* DepthStencilView; ID3D10Texture2D* DepthStencilBuffer; ID3D10EffectShaderResourceVariable* fxDiffuseMapVar; ID3D10EffectMatrixVariable* fxWVPVar; D3DXMATRIX WVP; D3DXMATRIX World; D3DXMATRIX View; D3DXMATRIX Projection; D3DXVECTOR3 Position; D3DXVECTOR3 Target; D3DXVECTOR3 Up; ID3D10EffectVariable* fxLightVar; IDirectInputDevice8* DIKeyboard; IDirectInputDevice8* DIMouse; DIMOUSESTATE mouseLastState; LPDIRECTINPUT8 DirectInput; /////////////////////////new///////////////////////////////////////////////// vector<ID3DX10Mesh*> meshes; int meshCount; bool LoadMesh(wstring filename); vector<UINT> meshSubsets; int meshTextures = 0; vector<ID3D10ShaderResourceView*> TextureResourceViews; /////////////////////////new///////////////////////////////////////////////// float rotx = 0; float rotz = 0; float moveUD = 0; float moveLR = 0; float moveIO = 0; D3DXMATRIX Rotationx; D3DXMATRIX Rotationz; D3DXMATRIX Rotation; D3DXMATRIX Scale; D3DXMATRIX Translation; D3DXMATRIX Transformations; float rot = 0.01f; bool InitializeDirect3dApp(HINSTANCE hInstance); bool InitDirectInput(HINSTANCE hInstance); void DetectInput(); bool InitScene(); void DrawScene(); bool ReleaseObjects(); int messageloop(); LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); struct Vertex { Vertex(){} Vertex(float x, float y, float z, float u, float v, float nx, float ny, float nz) : pos(x,y,z), texCoord(u,v), normal(nx,ny,nz){} D3DXVECTOR3 pos; D3DXVECTOR2 texCoord; D3DXVECTOR3 normal; }; D3D10_INPUT_ELEMENT_DESC layout[] = { {"POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D10_INPUT_PER_VERTEX_DATA, 0 }, {"TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 12, D3D10_INPUT_PER_VERTEX_DATA, 0}, {"NORMAL", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 20, D3D10_INPUT_PER_VERTEX_DATA, 0} }; struct Light { Light() { ZeroMemory(this, sizeof(Light)); } D3DXVECTOR3 dir; float pad; D3DXCOLOR ambient; D3DXCOLOR diffuse; }; Light light; int WINAPI WinMain(HINSTANCE hInstance, //Main windows function HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) { if(!InitializeWindow(hInstance, nShowCmd, Width, Height, true)) { MessageBox(0, L"Window Initialization - Failed", L"Error", MB_OK); return 0; } if(!InitializeDirect3dApp(hInstance)) { MessageBox(0, L"Direct3D Initialization - Failed", L"Error", MB_OK); return 0; } if(!InitDirectInput(hInstance)) { MessageBox(0, L"Direct Input Initialization - Failed", L"Error", MB_OK); return 0; } if(!InitScene()) { MessageBox(0, L"Scene Initialization - Failed", L"Error", MB_OK); return 0; } messageloop(); if(!ReleaseObjects()) { MessageBox(0, L"Object Releasing - Failed", L"Error", MB_OK); return 0; } return 0; } bool InitializeWindow(HINSTANCE hInstance, int ShowWnd, int width, int height, bool windowed) { typedef struct _WNDCLASS { UINT cbSize; UINT style; WNDPROC lpfnWndProc; int cbClsExtra; int cbWndExtra; HANDLE hInstance; HICON hIcon; HCURSOR hCursor; HBRUSH hbrBackground; LPCTSTR lpszMenuName; LPCTSTR lpszClassName; } WNDCLASS; WNDCLASSEX wc; wc.cbSize = sizeof(WNDCLASSEX); wc.style = CS_HREDRAW | CS_VREDRAW; wc.lpfnWndProc = WndProc; wc.cbClsExtra = NULL; wc.cbWndExtra = NULL; wc.hInstance = hInstance; wc.hIcon = LoadIcon(NULL, IDI_APPLICATION); wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 2); wc.lpszMenuName = NULL; wc.lpszClassName = WndClassName; wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION); if (!RegisterClassEx(&wc)) { MessageBox(NULL, L"Error registering class", L"Error", MB_OK | MB_ICONERROR); return 1; } hwnd = CreateWindowEx( NULL, WndClassName, L"Window Title", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, width, height, NULL, NULL, hInstance, NULL ); if (!hwnd) { MessageBox(NULL, L"Error creating window", L"Error", MB_OK | MB_ICONERROR); return 1; } ShowWindow(hwnd, ShowWnd); UpdateWindow(hwnd); return true; } bool InitializeDirect3dApp(HINSTANCE hInstance) { UINT createDeviceFlags = 0; D3D10_DRIVER_TYPE driverTypes[] = { D3D10_DRIVER_TYPE_HARDWARE, D3D10_DRIVER_TYPE_REFERENCE, }; UINT numDriverTypes = sizeof( driverTypes ) / sizeof( driverTypes[0] ); DXGI_SWAP_CHAIN_DESC scd; scd.BufferDesc.Width = Width; scd.BufferDesc.Height = Height; scd.BufferDesc.RefreshRate.Numerator = 60; scd.BufferDesc.RefreshRate.Denominator = 1; scd.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; scd.BufferDesc.ScanlineOrdering = DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED; scd.BufferDesc.Scaling = DXGI_MODE_SCALING_UNSPECIFIED; //no multisampling scd.SampleDesc.Count = 1; scd.SampleDesc.Quality = 0; scd.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT; scd.BufferCount = 1; scd.OutputWindow = hwnd; scd.Windowed = true; scd.SwapEffect = DXGI_SWAP_EFFECT_DISCARD; scd.Flags = 0; D3D10CreateDeviceAndSwapChain(0, D3D10_DRIVER_TYPE_HARDWARE, 0, 0, D3D10_SDK_VERSION, &scd, &SwapChain, &d3dDevice); ID3D10Texture2D* backBuffer; SwapChain->GetBuffer(0, _uuidof(ID3D10Texture2D), reinterpret_cast<void**>(&backBuffer)); d3dDevice->CreateRenderTargetView(backBuffer, 0, &RenderTargetView); backBuffer->Release(); D3D10_TEXTURE2D_DESC depthStencilDesc; depthStencilDesc.Width = Width; depthStencilDesc.Height = Height; depthStencilDesc.MipLevels = 1; depthStencilDesc.ArraySize = 1; depthStencilDesc.Format = DXGI_FORMAT_D24_UNORM_S8_UINT; depthStencilDesc.SampleDesc.Count = 1; depthStencilDesc.SampleDesc.Quality = 0; depthStencilDesc.Usage = D3D10_USAGE_DEFAULT; depthStencilDesc.BindFlags = D3D10_BIND_DEPTH_STENCIL; depthStencilDesc.CPUAccessFlags = 0; depthStencilDesc.MiscFlags = 0; d3dDevice->CreateTexture2D(&depthStencilDesc, NULL, &DepthStencilBuffer); d3dDevice->CreateDepthStencilView(DepthStencilBuffer, NULL, &DepthStencilView); d3dDevice->OMSetRenderTargets(1, &RenderTargetView, DepthStencilView); // Setup the viewport D3D10_VIEWPORT vp; vp.Width = Width; vp.Height = Height; vp.MinDepth = 0.0f; vp.MaxDepth = 1.0f; vp.TopLeftX = 0; vp.TopLeftY = 0; d3dDevice->RSSetViewports( 1, &vp ); D3DXMatrixIdentity( &World ); Position = D3DXVECTOR3( 0.0f, 4.0f, -10.0f ); Target = D3DXVECTOR3( 0.0f, 0.0f, 0.0f ); Up = D3DXVECTOR3( 0.0f, 1.0f, 0.0f ); D3DXMatrixLookAtLH( &View, &Position, &Target, &Up ); return true; } bool InitDirectInput(HINSTANCE hInstance) { DirectInput8Create(hInstance, DIRECTINPUT_VERSION, IID_IDirectInput8, (void**)&DirectInput, NULL); DirectInput->CreateDevice(GUID_SysKeyboard, &DIKeyboard, NULL); DirectInput->CreateDevice(GUID_SysMouse, &DIMouse, NULL); DIKeyboard->SetDataFormat(&c_dfDIKeyboard); DIKeyboard->SetCooperativeLevel(hwnd, DISCL_FOREGROUND | DISCL_NONEXCLUSIVE); DIMouse->SetDataFormat(&c_dfDIMouse); DIMouse->SetCooperativeLevel(hwnd, DISCL_NONEXCLUSIVE | DISCL_NOWINKEY | DISCL_FOREGROUND); return true; } void DetectInput() { DIMOUSESTATE mouseCurrState; BYTE keyboardState[256]; DIKeyboard->Acquire(); DIMouse->Acquire(); DIMouse->GetDeviceState(sizeof(DIMOUSESTATE), &mouseCurrState); DIKeyboard->GetDeviceState(sizeof(keyboardState),(LPVOID)&keyboardState); if(keyboardState[DIK_ESCAPE] & 0x80) PostMessage(hwnd, WM_DESTROY, 0, 0); if(keyboardState[DIK_LEFT] & 0x80) { rotz -= 0.0005f; } if(keyboardState[DIK_RIGHT] & 0x80) { rotz += 0.0005f; } if(keyboardState[DIK_UP] & 0x80) { rotx += 0.0005f; } if(keyboardState[DIK_DOWN] & 0x80) { rotx -= 0.0005f; } if(mouseCurrState.lX != mouseLastState.lX) { moveLR += (mouseCurrState.lX * 0.01f); } if(mouseCurrState.lY != mouseLastState.lY) { moveUD -= (mouseCurrState.lY * 0.01f); } if(mouseCurrState.lZ != mouseLastState.lZ) { moveIO -= (mouseCurrState.lZ * 0.01f); } if ( rotx > (float) 6.283185 ) rotx -= (float)6.283185; else if ( rotx < 0 ) rotx = (float)6.283185 + rotx; if ( rotz > (float)6.283185 ) rotz -= (float)6.283185; else if ( rotz < 0 ) rotz = (float)6.283185 + rotz; mouseLastState = mouseCurrState; return; } /////////////////////////new///////////////////////////////////////////////// bool LoadMesh(wstring filename) { HRESULT hr = 0; ID3DX10Mesh* tempMesh; wifstream fileIn (filename.c_str()); wstring skipString; UINT meshVertices = 0; UINT meshTriangles = 0; UINT tempMeshSubsets = 0; if (fileIn) { fileIn >> skipString; // #Subsets fileIn >> tempMeshSubsets; fileIn >> skipString; // #Vertices fileIn >> meshVertices; fileIn >> skipString; // #Faces (Triangles) fileIn >> meshTriangles; meshSubsets.push_back(tempMeshSubsets); hr = D3DX10CreateMesh(d3dDevice, layout, 3, layout[0].SemanticName, meshVertices, meshTriangles, D3DX10_MESH_32_BIT, &tempMesh); if(FAILED(hr)) { MessageBox(0, L"Mesh Creation - Failed", L"Error", MB_OK); return false; } fileIn >> skipString; //#Subset_info for(UINT i = 0; i < tempMeshSubsets; ++i) { std::wstring diffuseMapFilename; fileIn >> diffuseMapFilename; ID3D10ShaderResourceView* DiffuseMapResourceView; D3DX10CreateShaderResourceViewFromFile(d3dDevice, diffuseMapFilename.c_str(), 0, 0, &DiffuseMapResourceView, 0 ); TextureResourceViews.push_back(DiffuseMapResourceView); meshTextures++; } Vertex* verts = new Vertex[meshVertices]; fileIn >> skipString; //#Vertex_info for(UINT i = 0; i < meshVertices; ++i) { fileIn >> skipString; //Vertex Position fileIn >> verts[i].pos.x; fileIn >> verts[i].pos.y; fileIn >> verts[i].pos.z; fileIn >> skipString; //Vertex Normal fileIn >> verts[i].normal.x; fileIn >> verts[i].normal.y; fileIn >> verts[i].normal.z; fileIn >> skipString; //Vertex Texture Coordinates fileIn >> verts[i].texCoord.x; fileIn >> verts[i].texCoord.y; } tempMesh->SetVertexData(0, verts); delete[] verts; DWORD* indices = new DWORD[meshTriangles*3]; UINT* attributeIndex = new UINT[meshTriangles]; fileIn >> skipString; //#Face_Index for(UINT i = 0; i < meshTriangles; ++i) { fileIn >> indices[i*3+0]; fileIn >> indices[i*3+1]; fileIn >> indices[i*3+2]; fileIn >> attributeIndex[i]; //Current Subset } tempMesh->SetIndexData(indices, meshTriangles*3); tempMesh->SetAttributeData(attributeIndex); delete[] indices; delete[] attributeIndex; tempMesh->GenerateAdjacencyAndPointReps(0.001f); tempMesh->Optimize(D3DX10_MESHOPT_ATTR_SORT|D3DX10_MESHOPT_VERTEX_CACHE,0,0); tempMesh->CommitToDevice(); meshCount++; meshes.push_back(tempMesh); } else { MessageBox(0, L"Load Mesh File - Failed", L"Error", MB_OK); return false; } return true; } /////////////////////////new///////////////////////////////////////////////// bool InitScene() { LoadMesh(L"sphere.dat"); //meshes[0] light.dir = D3DXVECTOR3(0.25f, 0.5f, -1.0f); light.ambient = D3DXCOLOR(0.2f, 0.2f, 0.2f, 1.0f); light.diffuse = D3DXCOLOR(1.0f, 1.0f, 1.0f, 1.0f); ID3D10Blob* compilationErrors = 0; HRESULT hr = 0; hr = D3DX10CreateEffectFromFile( L"vertex.fx", NULL, NULL, "fx_4_0", D3D10_SHADER_ENABLE_STRICTNESS, 0, d3dDevice, NULL, NULL, &FX, &compilationErrors, NULL ); if(FAILED(hr)) { MessageBoxA(0, (char*)compilationErrors->GetBufferPointer(), 0, 0); compilationErrors->Release(); return false; } Technique = FX->GetTechniqueByName( "Tech" ); fxWVPVar = FX->GetVariableByName("WVP")->AsMatrix(); fxDiffuseMapVar = FX->GetVariableByName("DiffuseMap")->AsShaderResource(); fxLightVar = FX->GetVariableByName("light"); D3D10_PASS_DESC PassDesc; Technique->GetPassByIndex( 0 )->GetDesc( &PassDesc ); d3dDevice->CreateInputLayout( layout, 3, PassDesc.pIAInputSignature, PassDesc.IAInputSignatureSize, &VertexLayout ); d3dDevice->IASetInputLayout( VertexLayout ); d3dDevice->IASetPrimitiveTopology( D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST ); return true; } bool ReleaseObjects() { if( d3dDevice ) d3dDevice->ClearState(); if( VertexBuffer ) VertexBuffer->Release(); if( IndexBuffer ) IndexBuffer->Release(); if( VertexLayout ) VertexLayout->Release(); if( FX ) FX->Release(); if( RenderTargetView ) RenderTargetView->Release(); if( SwapChain ) SwapChain->Release(); if( d3dDevice ) d3dDevice->Release(); DIKeyboard->Unacquire(); DIMouse->Unacquire(); if( DirectInput ) DirectInput->Release(); /////////////////////////new///////////////////////////////////////////////// for(int i = 0; i < meshCount; i++) if( meshes[i] ) meshes[i]->Release(); /////////////////////////new///////////////////////////////////////////////// return true; } void DrawScene() { //Draw Scene Here D3DXCOLOR bgColor( 0.0f, 0.0f, 0.0f, 1.0f); d3dDevice->ClearRenderTargetView( RenderTargetView, bgColor ); d3dDevice->ClearDepthStencilView(DepthStencilView, D3D10_CLEAR_DEPTH|D3D10_CLEAR_STENCIL, 1.0f, 0); D3DXMatrixPerspectiveFovLH(&Projection, 0.4f*3.14f, Width/Height, 1.0f, 1000.0f); rot += .0002f; if ( rot > (float)6.283185 ) rot -= (float)6.283185; else if ( rot < 0 ) rot = (float)6.283185 + rot; fxLightVar->SetRawValue(&light, 0, sizeof(Light)); D3D10_TECHNIQUE_DESC techDesc; Technique->GetDesc( &techDesc ); D3DXVECTOR3 rotyaxis(0.0f, 1.0f, 0.0f); D3DXVECTOR3 rotzaxis(0.0f, 0.0f, 1.0f); D3DXVECTOR3 rotxaxis(1.0f, 0.0f, 0.0f); D3DXMatrixRotationAxis(&Rotation, &rotyaxis, rot); D3DXMatrixRotationAxis(&Rotationx, &rotxaxis, rotx); D3DXMatrixRotationAxis(&Rotationz, &rotzaxis, rotz); D3DXMatrixScaling( &Scale, 1.3f, 1.3f, 1.3f ); D3DXMatrixTranslation( &Translation, moveLR, moveUD, moveIO ); Transformations = Rotation * Rotationx * Rotationz * Scale * Translation; WVP = World * Transformations * View * Projection; fxWVPVar->SetMatrix((float*)&WVP); /////////////////////////new///////////////////////////////////////////////// //draw mesh for( UINT p = 0; p < techDesc.Passes; ++p ) { for(UINT subsetID = 0; subsetID < meshSubsets[0]; ++subsetID) { fxDiffuseMapVar->SetResource(TextureResourceViews[subsetID]); //if we draw meshes[1], we will need to add meshSubsets[0] to subsetID here Technique->GetPassByIndex( p )->Apply( 0 ); meshes[0]->DrawSubset(subsetID); } } /////////////////////////new///////////////////////////////////////////////// SwapChain->Present( 0, 0 ); } int messageloop(){ MSG msg; ZeroMemory(&msg, sizeof(MSG)); while(true) { BOOL PeekMessageL( LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg ); if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { if (msg.message == WM_QUIT) break; TranslateMessage(&msg); DispatchMessage(&msg); } else{ // run game code DetectInput(); DrawScene(); } } return msg.wParam; } LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch( msg ) { case WM_DESTROY: PostQuitMessage(0); return 0; } return DefWindowProc(hwnd, msg, wParam, lParam); } vertex.fx struct Light { float3 dir; float4 ambient; float4 diffuse; }; cbuffer cbPerFrame { Light light; }; cbuffer cbPerObject { float4x4 WVP; }; Texture2D DiffuseMap; SamplerState TriLinearSample { Filter = MIN_MAG_MIP_LINEAR; }; struct VS_OUTPUT //output structure for vertex shader { float4 Pos : SV_POSITION; float2 texCoord : TEXCOORD; float3 normal : NORMAL; }; // Vertex Shader VS_OUTPUT VS(float4 inPos : POSITION, float2 inTexCoord : TEXCOORD, float3 normal : NORMAL) { VS_OUTPUT output = (VS_OUTPUT)0; output.Pos = mul(inPos, WVP); output.normal = mul(normal, WVP); output.texCoord = inTexCoord; return output; //send color and position to pixel shader } // Pixel Shader float4 PS(VS_OUTPUT input) : SV_Target { input.normal = normalize(input.normal); float4 diffuse = DiffuseMap.Sample( TriLinearSample, input.texCoord ); float3 finalColor; finalColor = diffuse * light.ambient; finalColor += saturate(dot(light.dir, input.normal) * light.diffuse * diffuse); return float4(finalColor, diffuse.a); } technique10 Tech { pass P0 { SetVertexShader( CompileShader( vs_4_0, VS() ) ); SetPixelShader( CompileShader( ps_4_0, PS() ) ); } } braynzar.jpg +[http://www.braynzarsoft.net/image/100153][braynzar.jpg] sphere.dat #Subsets 2 #Vertices 360 #Faces 120 #Subset_info braynzar.jpg braynzar.jpg #Vertex_info Pos: -0.250000 0.433013 -0.866025 Norm: -0.250000 0.433013 -0.866025 tc: 0.083333 0.833333 Pos: 0.000000 0.500000 -0.866025 Norm: 0.000000 0.500000 -0.866025 tc: 0.000000 0.833333 Pos: 0.000000 0.000000 -1.000000 Norm: 0.000000 0.000000 -1.000000 tc: 0.000000 1.000000 Pos: -0.433013 0.250000 -0.866025 Norm: -0.433013 0.250000 -0.866025 tc: 0.166667 0.833333 Pos: -0.250000 0.433013 -0.866025 Norm: -0.250000 0.433013 -0.866025 tc: 0.083333 0.833333 Pos: 0.000000 0.000000 -1.000000 Norm: 0.000000 0.000000 -1.000000 tc: 0.083333 1.000000 Pos: -0.500000 0.000000 -0.866025 Norm: -0.500000 0.000000 -0.866025 tc: 0.250000 0.833333 Pos: -0.433013 0.250000 -0.866025 Norm: -0.433013 0.250000 -0.866025 tc: 0.166667 0.833333 Pos: 0.000000 0.000000 -1.000000 Norm: 0.000000 0.000000 -1.000000 tc: 0.166667 1.000000 Pos: -0.433013 -0.250000 -0.866025 Norm: -0.433013 -0.250000 -0.866025 tc: 0.333333 0.833333 Pos: -0.500000 0.000000 -0.866025 Norm: -0.500000 0.000000 -0.866025 tc: 0.250000 0.833333 Pos: 0.000000 0.000000 -1.000000 Norm: 0.000000 0.000000 -1.000000 tc: 0.250000 1.000000 Pos: -0.250000 -0.433013 -0.866025 Norm: -0.250000 -0.433013 -0.866025 tc: 0.416667 0.833333 Pos: -0.433013 -0.250000 -0.866025 Norm: -0.433013 -0.250000 -0.866025 tc: 0.333333 0.833333 Pos: 0.000000 0.000000 -1.000000 Norm: 0.000000 0.000000 -1.000000 tc: 0.333333 1.000000 Pos: -0.000000 -0.500000 -0.866025 Norm: -0.000000 -0.500000 -0.866025 tc: 0.500000 0.833333 Pos: -0.250000 -0.433013 -0.866025 Norm: -0.250000 -0.433013 -0.866025 tc: 0.416667 0.833333 Pos: 0.000000 0.000000 -1.000000 Norm: 0.000000 0.000000 -1.000000 tc: 0.416667 1.000000 Pos: 0.250000 -0.433013 -0.866025 Norm: 0.250000 -0.433013 -0.866025 tc: 0.583333 0.833333 Pos: -0.000000 -0.500000 -0.866025 Norm: -0.000000 -0.500000 -0.866025 tc: 0.500000 0.833333 Pos: 0.000000 0.000000 -1.000000 Norm: 0.000000 0.000000 -1.000000 tc: 0.500000 1.000000 Pos: 0.433013 -0.250000 -0.866025 Norm: 0.433013 -0.250000 -0.866025 tc: 0.666667 0.833333 Pos: 0.250000 -0.433013 -0.866025 Norm: 0.250000 -0.433013 -0.866025 tc: 0.583333 0.833333 Pos: 0.000000 0.000000 -1.000000 Norm: 0.000000 0.000000 -1.000000 tc: 0.583333 1.000000 Pos: 0.500000 -0.000000 -0.866025 Norm: 0.500000 -0.000000 -0.866025 tc: 0.750000 0.833333 Pos: 0.433013 -0.250000 -0.866025 Norm: 0.433013 -0.250000 -0.866025 tc: 0.666667 0.833333 Pos: 0.000000 0.000000 -1.000000 Norm: 0.000000 0.000000 -1.000000 tc: 0.666667 1.000000 Pos: 0.433013 0.250000 -0.866025 Norm: 0.433013 0.250000 -0.866025 tc: 0.833333 0.833333 Pos: 0.500000 -0.000000 -0.866025 Norm: 0.500000 -0.000000 -0.866025 tc: 0.750000 0.833333 Pos: 0.000000 0.000000 -1.000000 Norm: 0.000000 0.000000 -1.000000 tc: 0.750000 1.000000 Pos: 0.250000 0.433012 -0.866025 Norm: 0.250000 0.433012 -0.866025 tc: 0.916667 0.833333 Pos: 0.433013 0.250000 -0.866025 Norm: 0.433013 0.250000 -0.866025 tc: 0.833333 0.833333 Pos: 0.000000 0.000000 -1.000000 Norm: 0.000000 0.000000 -1.000000 tc: 0.833333 1.000000 Pos: 0.000000 0.500000 -0.866025 Norm: 0.000000 0.500000 -0.866025 tc: 1.000000 0.833333 Pos: 0.250000 0.433012 -0.866025 Norm: 0.250000 0.433012 -0.866025 tc: 0.916667 0.833333 Pos: 0.000000 0.000000 -1.000000 Norm: 0.000000 0.000000 -1.000000 tc: 0.916667 1.000000 Pos: -0.433013 0.750000 -0.500000 Norm: -0.433013 0.750000 -0.500000 tc: 0.083333 0.666667 Pos: 0.000000 0.866025 -0.500000 Norm: 0.000000 0.866025 -0.500000 tc: 0.000000 0.666667 Pos: 0.000000 0.500000 -0.866025 Norm: 0.000000 0.500000 -0.866025 tc: 0.000000 0.833333 Pos: -0.250000 0.433013 -0.866025 Norm: -0.250000 0.433013 -0.866025 tc: 0.083333 0.833333 Pos: -0.433013 0.750000 -0.500000 Norm: -0.433013 0.750000 -0.500000 tc: 0.083333 0.666667 Pos: 0.000000 0.500000 -0.866025 Norm: 0.000000 0.500000 -0.866025 tc: 0.000000 0.833333 Pos: -0.750000 0.433013 -0.500000 Norm: -0.750000 0.433013 -0.500000 tc: 0.166667 0.666667 Pos: -0.433013 0.750000 -0.500000 Norm: -0.433013 0.750000 -0.500000 tc: 0.083333 0.666667 Pos: -0.250000 0.433013 -0.866025 Norm: -0.250000 0.433013 -0.866025 tc: 0.083333 0.833333 Pos: -0.433013 0.250000 -0.866025 Norm: -0.433013 0.250000 -0.866025 tc: 0.166667 0.833333 Pos: -0.750000 0.433013 -0.500000 Norm: -0.750000 0.433013 -0.500000 tc: 0.166667 0.666667 Pos: -0.250000 0.433013 -0.866025 Norm: -0.250000 0.433013 -0.866025 tc: 0.083333 0.833333 Pos: -0.866025 0.000000 -0.500000 Norm: -0.866025 0.000000 -0.500000 tc: 0.250000 0.666667 Pos: -0.750000 0.433013 -0.500000 Norm: -0.750000 0.433013 -0.500000 tc: 0.166667 0.666667 Pos: -0.433013 0.250000 -0.866025 Norm: -0.433013 0.250000 -0.866025 tc: 0.166667 0.833333 Pos: -0.500000 0.000000 -0.866025 Norm: -0.500000 0.000000 -0.866025 tc: 0.250000 0.833333 Pos: -0.866025 0.000000 -0.500000 Norm: -0.866025 0.000000 -0.500000 tc: 0.250000 0.666667 Pos: -0.433013 0.250000 -0.866025 Norm: -0.433013 0.250000 -0.866025 tc: 0.166667 0.833333 Pos: -0.750000 -0.433013 -0.500000 Norm: -0.750000 -0.433013 -0.500000 tc: 0.333333 0.666667 Pos: -0.866025 0.000000 -0.500000 Norm: -0.866025 0.000000 -0.500000 tc: 0.250000 0.666667 Pos: -0.500000 0.000000 -0.866025 Norm: -0.500000 0.000000 -0.866025 tc: 0.250000 0.833333 Pos: -0.433013 -0.250000 -0.866025 Norm: -0.433013 -0.250000 -0.866025 tc: 0.333333 0.833333 Pos: -0.750000 -0.433013 -0.500000 Norm: -0.750000 -0.433013 -0.500000 tc: 0.333333 0.666667 Pos: -0.500000 0.000000 -0.866025 Norm: -0.500000 0.000000 -0.866025 tc: 0.250000 0.833333 Pos: -0.433013 -0.750000 -0.500000 Norm: -0.433013 -0.750000 -0.500000 tc: 0.416667 0.666667 Pos: -0.750000 -0.433013 -0.500000 Norm: -0.750000 -0.433013 -0.500000 tc: 0.333333 0.666667 Pos: -0.433013 -0.250000 -0.866025 Norm: -0.433013 -0.250000 -0.866025 tc: 0.333333 0.833333 Pos: -0.250000 -0.433013 -0.866025 Norm: -0.250000 -0.433013 -0.866025 tc: 0.416667 0.833333 Pos: -0.433013 -0.750000 -0.500000 Norm: -0.433013 -0.750000 -0.500000 tc: 0.416667 0.666667 Pos: -0.433013 -0.250000 -0.866025 Norm: -0.433013 -0.250000 -0.866025 tc: 0.333333 0.833333 Pos: -0.000000 -0.866025 -0.500000 Norm: -0.000000 -0.866025 -0.500000 tc: 0.500000 0.666667 Pos: -0.433013 -0.750000 -0.500000 Norm: -0.433013 -0.750000 -0.500000 tc: 0.416667 0.666667 Pos: -0.250000 -0.433013 -0.866025 Norm: -0.250000 -0.433013 -0.866025 tc: 0.416667 0.833333 Pos: -0.000000 -0.500000 -0.866025 Norm: -0.000000 -0.500000 -0.866025 tc: 0.500000 0.833333 Pos: -0.000000 -0.866025 -0.500000 Norm: -0.000000 -0.866025 -0.500000 tc: 0.500000 0.666667 Pos: -0.250000 -0.433013 -0.866025 Norm: -0.250000 -0.433013 -0.866025 tc: 0.416667 0.833333 Pos: 0.433012 -0.750000 -0.500000 Norm: 0.433012 -0.750000 -0.500000 tc: 0.583333 0.666667 Pos: -0.000000 -0.866025 -0.500000 Norm: -0.000000 -0.866025 -0.500000 tc: 0.500000 0.666667 Pos: -0.000000 -0.500000 -0.866025 Norm: -0.000000 -0.500000 -0.866025 tc: 0.500000 0.833333 Pos: 0.250000 -0.433013 -0.866025 Norm: 0.250000 -0.433013 -0.866025 tc: 0.583333 0.833333 Pos: 0.433012 -0.750000 -0.500000 Norm: 0.433012 -0.750000 -0.500000 tc: 0.583333 0.666667 Pos: -0.000000 -0.500000 -0.866025 Norm: -0.000000 -0.500000 -0.866025 tc: 0.500000 0.833333 Pos: 0.750000 -0.433013 -0.500000 Norm: 0.750000 -0.433013 -0.500000 tc: 0.666667 0.666667 Pos: 0.433012 -0.750000 -0.500000 Norm: 0.433012 -0.750000 -0.500000 tc: 0.583333 0.666667 Pos: 0.250000 -0.433013 -0.866025 Norm: 0.250000 -0.433013 -0.866025 tc: 0.583333 0.833333 Pos: 0.433013 -0.250000 -0.866025 Norm: 0.433013 -0.250000 -0.866025 tc: 0.666667 0.833333 Pos: 0.750000 -0.433013 -0.500000 Norm: 0.750000 -0.433013 -0.500000 tc: 0.666667 0.666667 Pos: 0.250000 -0.433013 -0.866025 Norm: 0.250000 -0.433013 -0.866025 tc: 0.583333 0.833333 Pos: 0.866025 -0.000001 -0.500000 Norm: 0.866025 -0.000001 -0.500000 tc: 0.750000 0.666667 Pos: 0.750000 -0.433013 -0.500000 Norm: 0.750000 -0.433013 -0.500000 tc: 0.666667 0.666667 Pos: 0.433013 -0.250000 -0.866025 Norm: 0.433013 -0.250000 -0.866025 tc: 0.666667 0.833333 Pos: 0.500000 -0.000000 -0.866025 Norm: 0.500000 -0.000000 -0.866025 tc: 0.750000 0.833333 Pos: 0.866025 -0.000001 -0.500000 Norm: 0.866025 -0.000001 -0.500000 tc: 0.750000 0.666667 Pos: 0.433013 -0.250000 -0.866025 Norm: 0.433013 -0.250000 -0.866025 tc: 0.666667 0.833333 Pos: 0.750000 0.433012 -0.500000 Norm: 0.750000 0.433012 -0.500000 tc: 0.833333 0.666667 Pos: 0.866025 -0.000001 -0.500000 Norm: 0.866025 -0.000001 -0.500000 tc: 0.750000 0.666667 Pos: 0.500000 -0.000000 -0.866025 Norm: 0.500000 -0.000000 -0.866025 tc: 0.750000 0.833333 Pos: 0.433013 0.250000 -0.866025 Norm: 0.433013 0.250000 -0.866025 tc: 0.833333 0.833333 Pos: 0.750000 0.433012 -0.500000 Norm: 0.750000 0.433012 -0.500000 tc: 0.833333 0.666667 Pos: 0.500000 -0.000000 -0.866025 Norm: 0.500000 -0.000000 -0.866025 tc: 0.750000 0.833333 Pos: 0.433013 0.750000 -0.500000 Norm: 0.433013 0.750000 -0.500000 tc: 0.916667 0.666667 Pos: 0.750000 0.433012 -0.500000 Norm: 0.750000 0.433012 -0.500000 tc: 0.833333 0.666667 Pos: 0.433013 0.250000 -0.866025 Norm: 0.433013 0.250000 -0.866025 tc: 0.833333 0.833333 Pos: 0.250000 0.433012 -0.866025 Norm: 0.250000 0.433012 -0.866025 tc: 0.916667 0.833333 Pos: 0.433013 0.750000 -0.500000 Norm: 0.433013 0.750000 -0.500000 tc: 0.916667 0.666667 Pos: 0.433013 0.250000 -0.866025 Norm: 0.433013 0.250000 -0.866025 tc: 0.833333 0.833333 Pos: 0.000000 0.866025 -0.500000 Norm: 0.000000 0.866025 -0.500000 tc: 1.000000 0.666667 Pos: 0.433013 0.750000 -0.500000 Norm: 0.433013 0.750000 -0.500000 tc: 0.916667 0.666667 Pos: 0.250000 0.433012 -0.866025 Norm: 0.250000 0.433012 -0.866025 tc: 0.916667 0.833333 Pos: 0.000000 0.500000 -0.866025 Norm: 0.000000 0.500000 -0.866025 tc: 1.000000 0.833333 Pos: 0.000000 0.866025 -0.500000 Norm: 0.000000 0.866025 -0.500000 tc: 1.000000 0.666667 Pos: 0.250000 0.433012 -0.866025 Norm: 0.250000 0.433012 -0.866025 tc: 0.916667 0.833333 Pos: -0.500000 0.866025 0.000000 Norm: -0.500000 0.866025 0.000000 tc: 0.083333 0.500000 Pos: 0.000000 1.000000 0.000000 Norm: 0.000000 1.000000 0.000000 tc: 0.000000 0.500000 Pos: 0.000000 0.866025 -0.500000 Norm: 0.000000 0.866025 -0.500000 tc: 0.000000 0.666667 Pos: -0.433013 0.750000 -0.500000 Norm: -0.433013 0.750000 -0.500000 tc: 0.083333 0.666667 Pos: -0.500000 0.866025 0.000000 Norm: -0.500000 0.866025 0.000000 tc: 0.083333 0.500000 Pos: 0.000000 0.866025 -0.500000 Norm: 0.000000 0.866025 -0.500000 tc: 0.000000 0.666667 Pos: -0.866025 0.500000 0.000000 Norm: -0.866025 0.500000 0.000000 tc: 0.166667 0.500000 Pos: -0.500000 0.866025 0.000000 Norm: -0.500000 0.866025 0.000000 tc: 0.083333 0.500000 Pos: -0.433013 0.750000 -0.500000 Norm: -0.433013 0.750000 -0.500000 tc: 0.083333 0.666667 Pos: -0.750000 0.433013 -0.500000 Norm: -0.750000 0.433013 -0.500000 tc: 0.166667 0.666667 Pos: -0.866025 0.500000 0.000000 Norm: -0.866025 0.500000 0.000000 tc: 0.166667 0.500000 Pos: -0.433013 0.750000 -0.500000 Norm: -0.433013 0.750000 -0.500000 tc: 0.083333 0.666667 Pos: -1.000000 0.000000 0.000000 Norm: -1.000000 0.000000 0.000000 tc: 0.250000 0.500000 Pos: -0.866025 0.500000 0.000000 Norm: -0.866025 0.500000 0.000000 tc: 0.166667 0.500000 Pos: -0.750000 0.433013 -0.500000 Norm: -0.750000 0.433013 -0.500000 tc: 0.166667 0.666667 Pos: -0.866025 0.000000 -0.500000 Norm: -0.866025 0.000000 -0.500000 tc: 0.250000 0.666667 Pos: -1.000000 0.000000 0.000000 Norm: -1.000000 0.000000 0.000000 tc: 0.250000 0.500000 Pos: -0.750000 0.433013 -0.500000 Norm: -0.750000 0.433013 -0.500000 tc: 0.166667 0.666667 Pos: -0.866026 -0.500000 0.000000 Norm: -0.866026 -0.500000 0.000000 tc: 0.333333 0.500000 Pos: -1.000000 0.000000 0.000000 Norm: -1.000000 0.000000 0.000000 tc: 0.250000 0.500000 Pos: -0.866025 0.000000 -0.500000 Norm: -0.866025 0.000000 -0.500000 tc: 0.250000 0.666667 Pos: -0.750000 -0.433013 -0.500000 Norm: -0.750000 -0.433013 -0.500000 tc: 0.333333 0.666667 Pos: -0.866026 -0.500000 0.000000 Norm: -0.866026 -0.500000 0.000000 tc: 0.333333 0.500000 Pos: -0.866025 0.000000 -0.500000 Norm: -0.866025 0.000000 -0.500000 tc: 0.250000 0.666667 Pos: -0.500000 -0.866025 0.000000 Norm: -0.500000 -0.866025 0.000000 tc: 0.416667 0.500000 Pos: -0.866026 -0.500000 0.000000 Norm: -0.866026 -0.500000 0.000000 tc: 0.333333 0.500000 Pos: -0.750000 -0.433013 -0.500000 Norm: -0.750000 -0.433013 -0.500000 tc: 0.333333 0.666667 Pos: -0.433013 -0.750000 -0.500000 Norm: -0.433013 -0.750000 -0.500000 tc: 0.416667 0.666667 Pos: -0.500000 -0.866025 0.000000 Norm: -0.500000 -0.866025 0.000000 tc: 0.416667 0.500000 Pos: -0.750000 -0.433013 -0.500000 Norm: -0.750000 -0.433013 -0.500000 tc: 0.333333 0.666667 Pos: -0.000000 -1.000000 0.000000 Norm: -0.000000 -1.000000 0.000000 tc: 0.500000 0.500000 Pos: -0.500000 -0.866025 0.000000 Norm: -0.500000 -0.866025 0.000000 tc: 0.416667 0.500000 Pos: -0.433013 -0.750000 -0.500000 Norm: -0.433013 -0.750000 -0.500000 tc: 0.416667 0.666667 Pos: -0.000000 -0.866025 -0.500000 Norm: -0.000000 -0.866025 -0.500000 tc: 0.500000 0.666667 Pos: -0.000000 -1.000000 0.000000 Norm: -0.000000 -1.000000 0.000000 tc: 0.500000 0.500000 Pos: -0.433013 -0.750000 -0.500000 Norm: -0.433013 -0.750000 -0.500000 tc: 0.416667 0.666667 Pos: 0.499999 -0.866026 0.000000 Norm: 0.499999 -0.866026 0.000000 tc: 0.583333 0.500000 Pos: -0.000000 -1.000000 0.000000 Norm: -0.000000 -1.000000 0.000000 tc: 0.500000 0.500000 Pos: -0.000000 -0.866025 -0.500000 Norm: -0.000000 -0.866025 -0.500000 tc: 0.500000 0.666667 Pos: 0.433012 -0.750000 -0.500000 Norm: 0.433012 -0.750000 -0.500000 tc: 0.583333 0.666667 Pos: 0.499999 -0.866026 0.000000 Norm: 0.499999 -0.866026 0.000000 tc: 0.583333 0.500000 Pos: -0.000000 -0.866025 -0.500000 Norm: -0.000000 -0.866025 -0.500000 tc: 0.500000 0.666667 Pos: 0.866025 -0.500001 0.000000 Norm: 0.866025 -0.500001 0.000000 tc: 0.666667 0.500000 Pos: 0.499999 -0.866026 0.000000 Norm: 0.499999 -0.866026 0.000000 tc: 0.583333 0.500000 Pos: 0.433012 -0.750000 -0.500000 Norm: 0.433012 -0.750000 -0.500000 tc: 0.583333 0.666667 Pos: 0.750000 -0.433013 -0.500000 Norm: 0.750000 -0.433013 -0.500000 tc: 0.666667 0.666667 Pos: 0.866025 -0.500001 0.000000 Norm: 0.866025 -0.500001 0.000000 tc: 0.666667 0.500000 Pos: 0.433012 -0.750000 -0.500000 Norm: 0.433012 -0.750000 -0.500000 tc: 0.583333 0.666667 Pos: 1.000000 -0.000001 0.000000 Norm: 1.000000 -0.000001 0.000000 tc: 0.750000 0.500000 Pos: 0.866025 -0.500001 0.000000 Norm: 0.866025 -0.500001 0.000000 tc: 0.666667 0.500000 Pos: 0.750000 -0.433013 -0.500000 Norm: 0.750000 -0.433013 -0.500000 tc: 0.666667 0.666667 Pos: 0.866025 -0.000001 -0.500000 Norm: 0.866025 -0.000001 -0.500000 tc: 0.750000 0.666667 Pos: 1.000000 -0.000001 0.000000 Norm: 1.000000 -0.000001 0.000000 tc: 0.750000 0.500000 Pos: 0.750000 -0.433013 -0.500000 Norm: 0.750000 -0.433013 -0.500000 tc: 0.666667 0.666667 Pos: 0.866026 0.499999 0.000000 Norm: 0.866026 0.499999 0.000000 tc: 0.833333 0.500000 Pos: 1.000000 -0.000001 0.000000 Norm: 1.000000 -0.000001 0.000000 tc: 0.750000 0.500000 Pos: 0.866025 -0.000001 -0.500000 Norm: 0.866025 -0.000001 -0.500000 tc: 0.750000 0.666667 Pos: 0.750000 0.433012 -0.500000 Norm: 0.750000 0.433012 -0.500000 tc: 0.833333 0.666667 Pos: 0.866026 0.499999 0.000000 Norm: 0.866026 0.499999 0.000000 tc: 0.833333 0.500000 Pos: 0.866025 -0.000001 -0.500000 Norm: 0.866025 -0.000001 -0.500000 tc: 0.750000 0.666667 Pos: 0.500001 0.866025 0.000000 Norm: 0.500001 0.866025 0.000000 tc: 0.916667 0.500000 Pos: 0.866026 0.499999 0.000000 Norm: 0.866026 0.499999 0.000000 tc: 0.833333 0.500000 Pos: 0.750000 0.433012 -0.500000 Norm: 0.750000 0.433012 -0.500000 tc: 0.833333 0.666667 Pos: 0.433013 0.750000 -0.500000 Norm: 0.433013 0.750000 -0.500000 tc: 0.916667 0.666667 Pos: 0.500001 0.866025 0.000000 Norm: 0.500001 0.866025 0.000000 tc: 0.916667 0.500000 Pos: 0.750000 0.433012 -0.500000 Norm: 0.750000 0.433012 -0.500000 tc: 0.833333 0.666667 Pos: 0.000000 1.000000 0.000000 Norm: 0.000000 1.000000 0.000000 tc: 1.000000 0.500000 Pos: 0.500001 0.866025 0.000000 Norm: 0.500001 0.866025 0.000000 tc: 0.916667 0.500000 Pos: 0.433013 0.750000 -0.500000 Norm: 0.433013 0.750000 -0.500000 tc: 0.916667 0.666667 Pos: 0.000000 0.866025 -0.500000 Norm: 0.000000 0.866025 -0.500000 tc: 1.000000 0.666667 Pos: 0.000000 1.000000 0.000000 Norm: 0.000000 1.000000 0.000000 tc: 1.000000 0.500000 Pos: 0.433013 0.750000 -0.500000 Norm: 0.433013 0.750000 -0.500000 tc: 0.916667 0.666667 Pos: -0.433013 0.750000 0.500000 Norm: -0.433013 0.750000 0.500000 tc: 0.083333 0.333333 Pos: 0.000000 0.866025 0.500000 Norm: 0.000000 0.866025 0.500000 tc: 0.000000 0.333333 Pos: 0.000000 1.000000 0.000000 Norm: 0.000000 1.000000 0.000000 tc: 0.000000 0.500000 Pos: -0.500000 0.866025 0.000000 Norm: -0.500000 0.866025 0.000000 tc: 0.083333 0.500000 Pos: -0.433013 0.750000 0.500000 Norm: -0.433013 0.750000 0.500000 tc: 0.083333 0.333333 Pos: 0.000000 1.000000 0.000000 Norm: 0.000000 1.000000 0.000000 tc: 0.000000 0.500000 Pos: -0.750000 0.433013 0.500000 Norm: -0.750000 0.433013 0.500000 tc: 0.166667 0.333333 Pos: -0.433013 0.750000 0.500000 Norm: -0.433013 0.750000 0.500000 tc: 0.083333 0.333333 Pos: -0.500000 0.866025 0.000000 Norm: -0.500000 0.866025 0.000000 tc: 0.083333 0.500000 Pos: -0.866025 0.500000 0.000000 Norm: -0.866025 0.500000 0.000000 tc: 0.166667 0.500000 Pos: -0.750000 0.433013 0.500000 Norm: -0.750000 0.433013 0.500000 tc: 0.166667 0.333333 Pos: -0.500000 0.866025 0.000000 Norm: -0.500000 0.866025 0.000000 tc: 0.083333 0.500000 Pos: -0.866025 0.000000 0.500000 Norm: -0.866025 0.000000 0.500000 tc: 0.250000 0.333333 Pos: -0.750000 0.433013 0.500000 Norm: -0.750000 0.433013 0.500000 tc: 0.166667 0.333333 Pos: -0.866025 0.500000 0.000000 Norm: -0.866025 0.500000 0.000000 tc: 0.166667 0.500000 Pos: -1.000000 0.000000 0.000000 Norm: -1.000000 0.000000 0.000000 tc: 0.250000 0.500000 Pos: -0.866025 0.000000 0.500000 Norm: -0.866025 0.000000 0.500000 tc: 0.250000 0.333333 Pos: -0.866025 0.500000 0.000000 Norm: -0.866025 0.500000 0.000000 tc: 0.166667 0.500000 Pos: -0.750000 -0.433012 0.500000 Norm: -0.750000 -0.433012 0.500000 tc: 0.333333 0.333333 Pos: -0.866025 0.000000 0.500000 Norm: -0.866025 0.000000 0.500000 tc: 0.250000 0.333333 Pos: -1.000000 0.000000 0.000000 Norm: -1.000000 0.000000 0.000000 tc: 0.250000 0.500000 Pos: -0.866026 -0.500000 0.000000 Norm: -0.866026 -0.500000 0.000000 tc: 0.333333 0.500000 Pos: -0.750000 -0.433012 0.500000 Norm: -0.750000 -0.433012 0.500000 tc: 0.333333 0.333333 Pos: -1.000000 0.000000 0.000000 Norm: -1.000000 0.000000 0.000000 tc: 0.250000 0.500000 Pos: -0.433013 -0.750000 0.500000 Norm: -0.433013 -0.750000 0.500000 tc: 0.416667 0.333333 Pos: -0.750000 -0.433012 0.500000 Norm: -0.750000 -0.433012 0.500000 tc: 0.333333 0.333333 Pos: -0.866026 -0.500000 0.000000 Norm: -0.866026 -0.500000 0.000000 tc: 0.333333 0.500000 Pos: -0.500000 -0.866025 0.000000 Norm: -0.500000 -0.866025 0.000000 tc: 0.416667 0.500000 Pos: -0.433013 -0.750000 0.500000 Norm: -0.433013 -0.750000 0.500000 tc: 0.416667 0.333333 Pos: -0.866026 -0.500000 0.000000 Norm: -0.866026 -0.500000 0.000000 tc: 0.333333 0.500000 Pos: -0.000000 -0.866025 0.500000 Norm: -0.000000 -0.866025 0.500000 tc: 0.500000 0.333333 Pos: -0.433013 -0.750000 0.500000 Norm: -0.433013 -0.750000 0.500000 tc: 0.416667 0.333333 Pos: -0.500000 -0.866025 0.000000 Norm: -0.500000 -0.866025 0.000000 tc: 0.416667 0.500000 Pos: -0.000000 -1.000000 0.000000 Norm: -0.000000 -1.000000 0.000000 tc: 0.500000 0.500000 Pos: -0.000000 -0.866025 0.500000 Norm: -0.000000 -0.866025 0.500000 tc: 0.500000 0.333333 Pos: -0.500000 -0.866025 0.000000 Norm: -0.500000 -0.866025 0.000000 tc: 0.416667 0.500000 Pos: 0.433012 -0.750000 0.500000 Norm: 0.433012 -0.750000 0.500000 tc: 0.583333 0.333333 Pos: -0.000000 -0.866025 0.500000 Norm: -0.000000 -0.866025 0.500000 tc: 0.500000 0.333333 Pos: -0.000000 -1.000000 0.000000 Norm: -0.000000 -1.000000 0.000000 tc: 0.500000 0.500000 Pos: 0.499999 -0.866026 0.000000 Norm: 0.499999 -0.866026 0.000000 tc: 0.583333 0.500000 Pos: 0.433012 -0.750000 0.500000 Norm: 0.433012 -0.750000 0.500000 tc: 0.583333 0.333333 Pos: -0.000000 -1.000000 0.000000 Norm: -0.000000 -1.000000 0.000000 tc: 0.500000 0.500000 Pos: 0.750000 -0.433013 0.500000 Norm: 0.750000 -0.433013 0.500000 tc: 0.666667 0.333333 Pos: 0.433012 -0.750000 0.500000 Norm: 0.433012 -0.750000 0.500000 tc: 0.583333 0.333333 Pos: 0.499999 -0.866026 0.000000 Norm: 0.499999 -0.866026 0.000000 tc: 0.583333 0.500000 Pos: 0.866025 -0.500001 0.000000 Norm: 0.866025 -0.500001 0.000000 tc: 0.666667 0.500000 Pos: 0.750000 -0.433013 0.500000 Norm: 0.750000 -0.433013 0.500000 tc: 0.666667 0.333333 Pos: 0.499999 -0.866026 0.000000 Norm: 0.499999 -0.866026 0.000000 tc: 0.583333 0.500000 Pos: 0.866025 -0.000001 0.500000 Norm: 0.866025 -0.000001 0.500000 tc: 0.750000 0.333333 Pos: 0.750000 -0.433013 0.500000 Norm: 0.750000 -0.433013 0.500000 tc: 0.666667 0.333333 Pos: 0.866025 -0.500001 0.000000 Norm: 0.866025 -0.500001 0.000000 tc: 0.666667 0.500000 Pos: 1.000000 -0.000001 0.000000 Norm: 1.000000 -0.000001 0.000000 tc: 0.750000 0.500000 Pos: 0.866025 -0.000001 0.500000 Norm: 0.866025 -0.000001 0.500000 tc: 0.750000 0.333333 Pos: 0.866025 -0.500001 0.000000 Norm: 0.866025 -0.500001 0.000000 tc: 0.666667 0.500000 Pos: 0.750000 0.433012 0.500000 Norm: 0.750000 0.433012 0.500000 tc: 0.833333 0.333333 Pos: 0.866025 -0.000001 0.500000 Norm: 0.866025 -0.000001 0.500000 tc: 0.750000 0.333333 Pos: 1.000000 -0.000001 0.000000 Norm: 1.000000 -0.000001 0.000000 tc: 0.750000 0.500000 Pos: 0.866026 0.499999 0.000000 Norm: 0.866026 0.499999 0.000000 tc: 0.833333 0.500000 Pos: 0.750000 0.433012 0.500000 Norm: 0.750000 0.433012 0.500000 tc: 0.833333 0.333333 Pos: 1.000000 -0.000001 0.000000 Norm: 1.000000 -0.000001 0.000000 tc: 0.750000 0.500000 Pos: 0.433013 0.750000 0.500000 Norm: 0.433013 0.750000 0.500000 tc: 0.916667 0.333333 Pos: 0.750000 0.433012 0.500000 Norm: 0.750000 0.433012 0.500000 tc: 0.833333 0.333333 Pos: 0.866026 0.499999 0.000000 Norm: 0.866026 0.499999 0.000000 tc: 0.833333 0.500000 Pos: 0.500001 0.866025 0.000000 Norm: 0.500001 0.866025 0.000000 tc: 0.916667 0.500000 Pos: 0.433013 0.750000 0.500000 Norm: 0.433013 0.750000 0.500000 tc: 0.916667 0.333333 Pos: 0.866026 0.499999 0.000000 Norm: 0.866026 0.499999 0.000000 tc: 0.833333 0.500000 Pos: 0.000000 0.866025 0.500000 Norm: 0.000000 0.866025 0.500000 tc: 1.000000 0.333333 Pos: 0.433013 0.750000 0.500000 Norm: 0.433013 0.750000 0.500000 tc: 0.916667 0.333333 Pos: 0.500001 0.866025 0.000000 Norm: 0.500001 0.866025 0.000000 tc: 0.916667 0.500000 Pos: 0.000000 1.000000 0.000000 Norm: 0.000000 1.000000 0.000000 tc: 1.000000 0.500000 Pos: 0.000000 0.866025 0.500000 Norm: 0.000000 0.866025 0.500000 tc: 1.000000 0.333333 Pos: 0.500001 0.866025 0.000000 Norm: 0.500001 0.866025 0.000000 tc: 0.916667 0.500000 Pos: -0.250000 0.433013 0.866025 Norm: -0.250000 0.433013 0.866025 tc: 0.083333 0.166667 Pos: 0.000000 0.500000 0.866025 Norm: 0.000000 0.500000 0.866025 tc: 0.000000 0.166667 Pos: 0.000000 0.866025 0.500000 Norm: 0.000000 0.866025 0.500000 tc: 0.000000 0.333333 Pos: -0.433013 0.750000 0.500000 Norm: -0.433013 0.750000 0.500000 tc: 0.083333 0.333333 Pos: -0.250000 0.433013 0.866025 Norm: -0.250000 0.433013 0.866025 tc: 0.083333 0.166667 Pos: 0.000000 0.866025 0.500000 Norm: 0.000000 0.866025 0.500000 tc: 0.000000 0.333333 Pos: -0.433013 0.250000 0.866025 Norm: -0.433013 0.250000 0.866025 tc: 0.166667 0.166667 Pos: -0.250000 0.433013 0.866025 Norm: -0.250000 0.433013 0.866025 tc: 0.083333 0.166667 Pos: -0.433013 0.750000 0.500000 Norm: -0.433013 0.750000 0.500000 tc: 0.083333 0.333333 Pos: -0.750000 0.433013 0.500000 Norm: -0.750000 0.433013 0.500000 tc: 0.166667 0.333333 Pos: -0.433013 0.250000 0.866025 Norm: -0.433013 0.250000 0.866025 tc: 0.166667 0.166667 Pos: -0.433013 0.750000 0.500000 Norm: -0.433013 0.750000 0.500000 tc: 0.083333 0.333333 Pos: -0.500000 0.000000 0.866025 Norm: -0.500000 0.000000 0.866025 tc: 0.250000 0.166667 Pos: -0.433013 0.250000 0.866025 Norm: -0.433013 0.250000 0.866025 tc: 0.166667 0.166667 Pos: -0.750000 0.433013 0.500000 Norm: -0.750000 0.433013 0.500000 tc: 0.166667 0.333333 Pos: -0.866025 0.000000 0.500000 Norm: -0.866025 0.000000 0.500000 tc: 0.250000 0.333333 Pos: -0.500000 0.000000 0.866025 Norm: -0.500000 0.000000 0.866025 tc: 0.250000 0.166667 Pos: -0.750000 0.433013 0.500000 Norm: -0.750000 0.433013 0.500000 tc: 0.166667 0.333333 Pos: -0.433013 -0.250000 0.866025 Norm: -0.433013 -0.250000 0.866025 tc: 0.333333 0.166667 Pos: -0.500000 0.000000 0.866025 Norm: -0.500000 0.000000 0.866025 tc: 0.250000 0.166667 Pos: -0.866025 0.000000 0.500000 Norm: -0.866025 0.000000 0.500000 tc: 0.250000 0.333333 Pos: -0.750000 -0.433012 0.500000 Norm: -0.750000 -0.433012 0.500000 tc: 0.333333 0.333333 Pos: -0.433013 -0.250000 0.866025 Norm: -0.433013 -0.250000 0.866025 tc: 0.333333 0.166667 Pos: -0.866025 0.000000 0.500000 Norm: -0.866025 0.000000 0.500000 tc: 0.250000 0.333333 Pos: -0.250000 -0.433013 0.866025 Norm: -0.250000 -0.433013 0.866025 tc: 0.416667 0.166667 Pos: -0.433013 -0.250000 0.866025 Norm: -0.433013 -0.250000 0.866025 tc: 0.333333 0.166667 Pos: -0.750000 -0.433012 0.500000 Norm: -0.750000 -0.433012 0.500000 tc: 0.333333 0.333333 Pos: -0.433013 -0.750000 0.500000 Norm: -0.433013 -0.750000 0.500000 tc: 0.416667 0.333333 Pos: -0.250000 -0.433013 0.866025 Norm: -0.250000 -0.433013 0.866025 tc: 0.416667 0.166667 Pos: -0.750000 -0.433012 0.500000 Norm: -0.750000 -0.433012 0.500000 tc: 0.333333 0.333333 Pos: -0.000000 -0.500000 0.866025 Norm: -0.000000 -0.500000 0.866025 tc: 0.500000 0.166667 Pos: -0.250000 -0.433013 0.866025 Norm: -0.250000 -0.433013 0.866025 tc: 0.416667 0.166667 Pos: -0.433013 -0.750000 0.500000 Norm: -0.433013 -0.750000 0.500000 tc: 0.416667 0.333333 Pos: -0.000000 -0.866025 0.500000 Norm: -0.000000 -0.866025 0.500000 tc: 0.500000 0.333333 Pos: -0.000000 -0.500000 0.866025 Norm: -0.000000 -0.500000 0.866025 tc: 0.500000 0.166667 Pos: -0.433013 -0.750000 0.500000 Norm: -0.433013 -0.750000 0.500000 tc: 0.416667 0.333333 Pos: 0.250000 -0.433013 0.866025 Norm: 0.250000 -0.433013 0.866025 tc: 0.583333 0.166667 Pos: -0.000000 -0.500000 0.866025 Norm: -0.000000 -0.500000 0.866025 tc: 0.500000 0.166667 Pos: -0.000000 -0.866025 0.500000 Norm: -0.000000 -0.866025 0.500000 tc: 0.500000 0.333333 Pos: 0.433012 -0.750000 0.500000 Norm: 0.433012 -0.750000 0.500000 tc: 0.583333 0.333333 Pos: 0.250000 -0.433013 0.866025 Norm: 0.250000 -0.433013 0.866025 tc: 0.583333 0.166667 Pos: -0.000000 -0.866025 0.500000 Norm: -0.000000 -0.866025 0.500000 tc: 0.500000 0.333333 Pos: 0.433013 -0.250000 0.866025 Norm: 0.433013 -0.250000 0.866025 tc: 0.666667 0.166667 Pos: 0.250000 -0.433013 0.866025 Norm: 0.250000 -0.433013 0.866025 tc: 0.583333 0.166667 Pos: 0.433012 -0.750000 0.500000 Norm: 0.433012 -0.750000 0.500000 tc: 0.583333 0.333333 Pos: 0.750000 -0.433013 0.500000 Norm: 0.750000 -0.433013 0.500000 tc: 0.666667 0.333333 Pos: 0.433013 -0.250000 0.866025 Norm: 0.433013 -0.250000 0.866025 tc: 0.666667 0.166667 Pos: 0.433012 -0.750000 0.500000 Norm: 0.433012 -0.750000 0.500000 tc: 0.583333 0.333333 Pos: 0.500000 -0.000000 0.866025 Norm: 0.500000 -0.000000 0.866025 tc: 0.750000 0.166667 Pos: 0.433013 -0.250000 0.866025 Norm: 0.433013 -0.250000 0.866025 tc: 0.666667 0.166667 Pos: 0.750000 -0.433013 0.500000 Norm: 0.750000 -0.433013 0.500000 tc: 0.666667 0.333333 Pos: 0.866025 -0.000001 0.500000 Norm: 0.866025 -0.000001 0.500000 tc: 0.750000 0.333333 Pos: 0.500000 -0.000000 0.866025 Norm: 0.500000 -0.000000 0.866025 tc: 0.750000 0.166667 Pos: 0.750000 -0.433013 0.500000 Norm: 0.750000 -0.433013 0.500000 tc: 0.666667 0.333333 Pos: 0.433013 0.250000 0.866025 Norm: 0.433013 0.250000 0.866025 tc: 0.833333 0.166667 Pos: 0.500000 -0.000000 0.866025 Norm: 0.500000 -0.000000 0.866025 tc: 0.750000 0.166667 Pos: 0.866025 -0.000001 0.500000 Norm: 0.866025 -0.000001 0.500000 tc: 0.750000 0.333333 Pos: 0.750000 0.433012 0.500000 Norm: 0.750000 0.433012 0.500000 tc: 0.833333 0.333333 Pos: 0.433013 0.250000 0.866025 Norm: 0.433013 0.250000 0.866025 tc: 0.833333 0.166667 Pos: 0.866025 -0.000001 0.500000 Norm: 0.866025 -0.000001 0.500000 tc: 0.750000 0.333333 Pos: 0.250000 0.433013 0.866025 Norm: 0.250000 0.433013 0.866025 tc: 0.916667 0.166667 Pos: 0.433013 0.250000 0.866025 Norm: 0.433013 0.250000 0.866025 tc: 0.833333 0.166667 Pos: 0.750000 0.433012 0.500000 Norm: 0.750000 0.433012 0.500000 tc: 0.833333 0.333333 Pos: 0.433013 0.750000 0.500000 Norm: 0.433013 0.750000 0.500000 tc: 0.916667 0.333333 Pos: 0.250000 0.433013 0.866025 Norm: 0.250000 0.433013 0.866025 tc: 0.916667 0.166667 Pos: 0.750000 0.433012 0.500000 Norm: 0.750000 0.433012 0.500000 tc: 0.833333 0.333333 Pos: 0.000000 0.500000 0.866025 Norm: 0.000000 0.500000 0.866025 tc: 1.000000 0.166667 Pos: 0.250000 0.433013 0.866025 Norm: 0.250000 0.433013 0.866025 tc: 0.916667 0.166667 Pos: 0.433013 0.750000 0.500000 Norm: 0.433013 0.750000 0.500000 tc: 0.916667 0.333333 Pos: 0.000000 0.866025 0.500000 Norm: 0.000000 0.866025 0.500000 tc: 1.000000 0.333333 Pos: 0.000000 0.500000 0.866025 Norm: 0.000000 0.500000 0.866025 tc: 1.000000 0.166667 Pos: 0.433013 0.750000 0.500000 Norm: 0.433013 0.750000 0.500000 tc: 0.916667 0.333333 Pos: 0.000000 0.500000 0.866025 Norm: 0.000000 0.500000 0.866025 tc: 0.000000 0.166667 Pos: -0.250000 0.433013 0.866025 Norm: -0.250000 0.433013 0.866025 tc: 0.083333 0.166667 Pos: 0.000000 0.000000 1.000000 Norm: 0.000000 0.000000 1.000000 tc: 0.000000 0.000000 Pos: -0.250000 0.433013 0.866025 Norm: -0.250000 0.433013 0.866025 tc: 0.083333 0.166667 Pos: -0.433013 0.250000 0.866025 Norm: -0.433013 0.250000 0.866025 tc: 0.166667 0.166667 Pos: 0.000000 0.000000 1.000000 Norm: 0.000000 0.000000 1.000000 tc: 0.083333 0.000000 Pos: -0.433013 0.250000 0.866025 Norm: -0.433013 0.250000 0.866025 tc: 0.166667 0.166667 Pos: -0.500000 0.000000 0.866025 Norm: -0.500000 0.000000 0.866025 tc: 0.250000 0.166667 Pos: 0.000000 0.000000 1.000000 Norm: 0.000000 0.000000 1.000000 tc: 0.166667 0.000000 Pos: -0.500000 0.000000 0.866025 Norm: -0.500000 0.000000 0.866025 tc: 0.250000 0.166667 Pos: -0.433013 -0.250000 0.866025 Norm: -0.433013 -0.250000 0.866025 tc: 0.333333 0.166667 Pos: 0.000000 0.000000 1.000000 Norm: 0.000000 0.000000 1.000000 tc: 0.250000 0.000000 Pos: -0.433013 -0.250000 0.866025 Norm: -0.433013 -0.250000 0.866025 tc: 0.333333 0.166667 Pos: -0.250000 -0.433013 0.866025 Norm: -0.250000 -0.433013 0.866025 tc: 0.416667 0.166667 Pos: 0.000000 0.000000 1.000000 Norm: 0.000000 0.000000 1.000000 tc: 0.333333 0.000000 Pos: -0.250000 -0.433013 0.866025 Norm: -0.250000 -0.433013 0.866025 tc: 0.416667 0.166667 Pos: -0.000000 -0.500000 0.866025 Norm: -0.000000 -0.500000 0.866025 tc: 0.500000 0.166667 Pos: 0.000000 0.000000 1.000000 Norm: 0.000000 0.000000 1.000000 tc: 0.416667 0.000000 Pos: -0.000000 -0.500000 0.866025 Norm: -0.000000 -0.500000 0.866025 tc: 0.500000 0.166667 Pos: 0.250000 -0.433013 0.866025 Norm: 0.250000 -0.433013 0.866025 tc: 0.583333 0.166667 Pos: 0.000000 0.000000 1.000000 Norm: 0.000000 0.000000 1.000000 tc: 0.500000 0.000000 Pos: 0.250000 -0.433013 0.866025 Norm: 0.250000 -0.433013 0.866025 tc: 0.583333 0.166667 Pos: 0.433013 -0.250000 0.866025 Norm: 0.433013 -0.250000 0.866025 tc: 0.666667 0.166667 Pos: 0.000000 0.000000 1.000000 Norm: 0.000000 0.000000 1.000000 tc: 0.583333 0.000000 Pos: 0.433013 -0.250000 0.866025 Norm: 0.433013 -0.250000 0.866025 tc: 0.666667 0.166667 Pos: 0.500000 -0.000000 0.866025 Norm: 0.500000 -0.000000 0.866025 tc: 0.750000 0.166667 Pos: 0.000000 0.000000 1.000000 Norm: 0.000000 0.000000 1.000000 tc: 0.666667 0.000000 Pos: 0.500000 -0.000000 0.866025 Norm: 0.500000 -0.000000 0.866025 tc: 0.750000 0.166667 Pos: 0.433013 0.250000 0.866025 Norm: 0.433013 0.250000 0.866025 tc: 0.833333 0.166667 Pos: 0.000000 0.000000 1.000000 Norm: 0.000000 0.000000 1.000000 tc: 0.750000 0.000000 Pos: 0.433013 0.250000 0.866025 Norm: 0.433013 0.250000 0.866025 tc: 0.833333 0.166667 Pos: 0.250000 0.433013 0.866025 Norm: 0.250000 0.433013 0.866025 tc: 0.916667 0.166667 Pos: 0.000000 0.000000 1.000000 Norm: 0.000000 0.000000 1.000000 tc: 0.833333 0.000000 Pos: 0.250000 0.433013 0.866025 Norm: 0.250000 0.433013 0.866025 tc: 0.916667 0.166667 Pos: 0.000000 0.500000 0.866025 Norm: 0.000000 0.500000 0.866025 tc: 1.000000 0.166667 Pos: 0.000000 0.000000 1.000000 Norm: 0.000000 0.000000 1.000000 tc: 0.916667 0.000000 #Face_Index 0 1 2 0 3 4 5 0 6 7 8 0 9 10 11 0 12 13 14 0 15 16 17 0 18 19 20 0 21 22 23 0 24 25 26 0 27 28 29 0 30 31 32 0 33 34 35 0 36 37 38 0 39 40 41 0 42 43 44 0 45 46 47 0 48 49 50 0 51 52 53 0 54 55 56 0 57 58 59 0 60 61 62 0 63 64 65 0 66 67 68 0 69 70 71 0 72 73 74 0 75 76 77 0 78 79 80 0 81 82 83 0 84 85 86 0 87 88 89 0 90 91 92 0 93 94 95 0 96 97 98 0 99 100 101 0 102 103 104 0 105 106 107 0 108 109 110 0 111 112 113 0 114 115 116 0 117 118 119 0 120 121 122 0 123 124 125 0 126 127 128 0 129 130 131 0 132 133 134 0 135 136 137 0 138 139 140 0 141 142 143 0 144 145 146 0 147 148 149 0 150 151 152 0 153 154 155 0 156 157 158 0 159 160 161 0 162 163 164 0 165 166 167 0 168 169 170 0 171 172 173 0 174 175 176 0 177 178 179 1 180 181 182 1 183 184 185 1 186 187 188 1 189 190 191 1 192 193 194 1 195 196 197 1 198 199 200 1 201 202 203 1 204 205 206 1 207 208 209 1 210 211 212 1 213 214 215 1 216 217 218 1 219 220 221 1 222 223 224 1 225 226 227 1 228 229 230 1 231 232 233 1 234 235 236 1 237 238 239 1 240 241 242 1 243 244 245 1 246 247 248 1 249 250 251 1 252 253 254 1 255 256 257 1 258 259 260 1 261 262 263 1 264 265 266 1 267 268 269 1 270 271 272 1 273 274 275 1 276 277 278 1 279 280 281 1 282 283 284 1 285 286 287 1 288 289 290 1 291 292 293 1 294 295 296 1 297 298 299 1 300 301 302 1 303 304 305 1 306 307 308 1 309 310 311 1 312 313 314 1 315 316 317 1 318 319 320 1 321 322 323 1 324 325 326 1 327 328 329 1 330 331 332 1 333 334 335 1 336 337 338 1 339 340 341 1 342 343 344 1 345 346 347 1 348 349 350 1 351 352 353 1 354 355 356 1 357 358 359 1