- Timestamp:
- 11/21/08 17:43:49 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling/VboFormatConverter
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/VboFormatConverter/VboFormatConverter.cpp
r3152 r3153 82 82 // convert the triangles to geometry 83 83 geom->mVertexCount = numElements; 84 geom->mTexcoordCount = numElements; 85 84 86 geom->mVertices = new SimpleVec[numElements]; 85 87 geom->mNormals = new SimpleVec[numElements]; … … 94 96 { 95 97 sscanf(str, "%f %f %f %f %f %f %f %f %f %f %f", 96 &vtx.x, &vtx. z, &vtx.y,97 &normal.x, &normal. z, &normal.y,98 &vtx.x, &vtx.y, &vtx.z, 99 &normal.x, &normal.y, &normal.z, 98 100 &tex.first, &tex.second, 99 101 &tangent.x, &tangent.y, &tangent.z); 100 102 101 103 const float scale = 0.05f; 102 vtx.x *= scale; 103 vtx.y *= scale; 104 vtx.z *= scale; 105 106 geom->mVertices[line] = vtx; 107 geom->mNormals[line] = normal; 104 105 geom->mVertices[line].x = vtx.x * scale; 106 geom->mVertices[line].y = vtx.z * scale; 107 geom->mVertices[line].z = vtx.y * scale; 108 109 geom->mNormals[line].x = normal.x; 110 geom->mNormals[line].y = normal.z; 111 geom->mNormals[line].z = normal.y; 112 113 geom->mTangents[line].x = tangent.x; 114 geom->mTangents[line].y = tangent.z; 115 geom->mTangents[line].z = tangent.y; 116 108 117 geom->mTexcoords[line] = tex; 109 geom->mTangents[line] = tangent; 110 118 119 static int dummy = 0; 120 121 if (dummy ++ < 5) cout << "tangent: " << geom->mTangents[line] << endl; 111 122 ++ line; 112 123 } … … 134 145 135 146 if (texCoordCount) 147 { 136 148 str.write(reinterpret_cast<char *>(geom->mTexcoords), sizeof(float) * texCoordCount * 2); 137 149 } 150 138 151 139 152 /////// … … 163 176 164 177 ambient.x = ambient.y = ambient.z = 0.2f; 165 diffuse.x = diffuse.y = diffuse.z = 1.0f;178 diffuse.x = 0.7f; diffuse.y = 0.4f; diffuse.z = 0.2f; 166 179 spec.x = spec.y = spec.z = .0f; 167 180 emm = spec; -
GTP/trunk/App/Demos/Vis/FriendlyCulling/VboFormatConverter/main.cpp
r3107 r3153 22 22 exit(0); 23 23 } 24 24 25 std::cin.get(); 25 26 cout << "conversion successful" << endl; 26 27
Note: See TracChangeset
for help on using the changeset viewer.