Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SMeshConstructorProcedural BuildPlaneData(float sZ, float sX)
- {
- //Init model data
- SBinaryModelData modelData;
- //Positions
- std::vector<float> pos = {
- 0,0,0,1,0,0,1,0,1,0,0,1,
- 1,0,0,2,0,0,2,0,1,1,0,1,
- 0,0,1,1,0,1,1,0,2,0,0,2,
- 1,0,1,2,0,1,2,0,2,1,0,2
- };
- std::vector<float> nrm = {
- 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0,
- 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0,
- 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0,
- 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0
- };
- std::vector<float> uv = {
- 0, 0, 1, 0, 1, 1, 0, 1,
- 0, 0, 1, 0, 1, 1, 0, 1,
- 0, 0, 1, 0, 1, 1, 0, 1,
- 0, 0, 1, 0, 1, 1, 0, 1
- };
- modelData.vertices = pos;
- modelData.vertices.insert(modelData.vertices.end(), uv.begin(), uv.end());
- modelData.vertices.insert(modelData.vertices.end(), nrm.begin(), nrm.end());
- modelData.vertexSize = 48;
- modelData.normalSize = 48;
- modelData.UVSize = 32;
- modelData.indices = {
- 2, 1, 0, 3, 2, 0,
- 2, 1, 0, 3, 2, 0,
- 2, 1, 0, 3, 2, 0,
- 2, 1, 0, 3, 2, 0
- };
- modelData.indicesSize = 24;
- //Build the mesh constructor
- SMeshConstructorProcedural dataToReturn(kLines, modelData);
- return dataToReturn;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement