# Alessandro Pozzer

Member

19

174 Neutral

• Rank
Member

• Interests
Programming

## Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

1. ## Color interpolation between orange and blue

Thank you for your answer. Can you, please, help me with the colours you think it should be better to use? Currently I am using: NOON : horizon = blue, upper = blue. SUNSET: horizon = orange, upper = blue NIGHT: horizon = dark blue, upper = black DAWN: horizon = light orange, upper = light blue Do you think it could work? and What colorus would you suggest me to use for interpolate better between them? Thank you so much for your help.
2. ## Color interpolation between orange and blue

Hi guys, I dont know if this is the right section, but I did not know where to post this. I am implementing a day night cycle on my game engine and I was wondering if there was a nice way to interpolate properly between warm colors, such as orange (sunset) and dark blue (night) color. I am using HSL format. Thank you.
3. ## Set Lighting according to Time of the day

Thank you for your reply! and how could I calculate longitude and latitude?
4. ## DX11 Set Lighting according to Time of the day

I am creating a simple Graphics Engine and I want to let the user set the time of the day for the scene, but I have problems translating it into the lighting direction. The light direction is now given by a vector of three float. i.e. The user set time = 12 (noon). I want the light direction to be right on the top of the scene. Is there a way to achieve that? Thank you
5. ## Fractals trees [DirectX 12]

I am sorry for my late reply. I am looking for a tutorial or any other suggestions on how to use a fractal algorithm to render a tree from a 3d model of a trunk or a simple stick
6. ## DX12 Fractals trees [DirectX 12]

Hi, looking into the Internet I could not find anything about the generation of objects using fractal generation for c++/DirectX 12. Does any of you have any idea of how this can be done? thank you
7. ## Best technique to generate procedural terrain

Thank you so much for your help! And what would you personally suggest?
8. ## Best technique to generate procedural terrain

So I do not need to create a height map? and how can this method work if the perlin noise would return only a scalar value? Thanks
9. ## Best technique to generate procedural terrain

Hi guys, looking around I saw that the most common technique to generate procedural terrain is by using height maps stored in PNG files. Is it the best technique though? Wouldn't it better to just generate a grid and then transform the y coordinates according to a chosen function? Could the perlin noise algorith be used to modify the y axis only? Thank you for your help.

11. ## Assimp does not load data

Yep, that worked :P thank you for your time dude.
12. ## Assimp does not load data

Do you suggest me to pass in the pointer to the positions vector into LoadMesh then? Is it a good option?
13. ## Assimp does not load data

I am trying to import vertices from assimp but it does not load the data. I initialize std::vector<XMFLOAT3> positions; and after the loadModel method the positions vector is still empty. Here's my code: main.cpp:   ModelMesh* model = new ModelMesh(); int numVertices = 0; int numIndices = 0; std::vector<XMFLOAT3> positions; std::vector<XMFLOAT3> normals; std::vector<XMFLOAT2> texCoords; std::vector<unsigned int> indices; model->LoadMesh("file.x", positions, normals, texCoords, indices, numVertices, numIndices); // Create vertex buffer if (positions.size() == 0) { MessageBox(0, L"Vertices vector is empty.", L"Error", MB_OK); } Vertex* vList = new Vertex[positions.size()]; for (size_t i = 0; i < positions.size(); i++) { Vertex vert; XMFLOAT3 pos = positions[i]; vert.position = XMFLOAT3(pos.x, pos.y, pos.z); vList[i] = vert; }   ModelMesh.cpp: bool ModelMesh::LoadMesh(const std::string& filename, std::vector<XMFLOAT3> positions, std::vector<XMFLOAT3> normals, std::vector<XMFLOAT2> texCoords, std::vector<unsigned int> indices, int numVertices, int numIndices) { bool ret = false; m_pScene = m_Importer.ReadFile(filename.c_str(), aiProcess_Triangulate | aiProcess_GenSmoothNormals | aiProcess_FlipUVs | aiProcess_JoinIdenticalVertices | aiPostProcessSteps::aiProcess_FlipWindingOrder //| aiPostProcessSteps::aiProcess_GenNormals ); if (m_pScene) { ret = InitFromScene(m_pScene, filename, positions, normals, texCoords, indices, numVertices, numIndices); } else { MessageBox(0, L"Error loading the model.", L"Error", MB_OK); assert(m_Importer.GetErrorString()); } return ret; } bool ModelMesh::InitFromScene(const aiScene* pScene, const std::string& filename, std::vector<XMFLOAT3> positions, std::vector<XMFLOAT3> normals, std::vector<XMFLOAT2> texCoords, std::vector<unsigned int> indices, int numVertices, int numIndices) { m_entries.resize(pScene->mNumMeshes); numVertices = 0; numIndices = 0; // Count the number of vertices and indices for (size_t i = 0; i < m_entries.size(); i++) { m_entries[i].MaterialIndex = pScene->mMeshes[i]->mMaterialIndex; m_entries[i].NumIndices = pScene->mMeshes[i]->mNumFaces * 3; m_entries[i].BaseVertex = numVertices; m_entries[i].BaseIndex = numIndices; numVertices += pScene->mMeshes[i]->mNumVertices; numIndices += m_entries[i].NumIndices; } // Reserve space in the vectors for the vertex attributes and indices positions.reserve(numVertices); normals.reserve(numVertices); texCoords.reserve(numVertices); indices.reserve(numIndices); // Initialize the meshes in the scene one by one for (size_t i = 0; i < m_entries.size(); i++) { const aiMesh* paiMesh = pScene->mMeshes[i]; InitMesh(i, paiMesh, positions, normals, texCoords, indices, numVertices, numIndices); } return true; } void ModelMesh::InitMesh(int meshIndex, const aiMesh* paiMesh, std::vector<XMFLOAT3>& positions, std::vector<XMFLOAT3>& normals, std::vector<XMFLOAT2>& texCoords, std::vector<unsigned int>& indices, int numVertices, int numIndices) { const aiVector3D Zero3D(0.0f, 0.0f, 0.0f); // Populate the vertex attribute vectors for (unsigned int i = 0; i < paiMesh->mNumVertices; i++) { const aiVector3D* pPos = &(paiMesh->mVertices[i]); const aiVector3D* pNormal = &(paiMesh->mNormals[i]); const aiVector3D* pTexCoord = paiMesh->HasTextureCoords(0) ? &(paiMesh->mTextureCoords[0][i]) : &Zero3D; positions.push_back(XMFLOAT3(pPos->x, pPos->y, pPos->z)); normals.push_back(XMFLOAT3(pNormal->x, pNormal->y, pNormal->z)); texCoords.push_back(XMFLOAT2(pTexCoord->x, pTexCoord->y)); } // Populate the index buffer for (unsigned int i = 0; i < paiMesh->mNumFaces; i++) { const aiFace& face = paiMesh->mFaces[i]; assert(face.mNumIndices == 3); indices.push_back(face.mIndices[0]); indices.push_back(face.mIndices[1]); indices.push_back(face.mIndices[2]); } }   I don't understand why it returns me the positions variable still empty. Any idea why?
14. ## Cannot Load 3d model using Assimp [Directx12]

Hi guys, Im so sorry to post this but I am struggling with the implementation of a 3d model loader using Assimp and DirectX12 and I was wondering if you could give me an help doing it. I started from a project that - given vertices and indices - displays two cubes. From there I simply changed the InputLayout, the shaders and I used vertices, normals, texcoords and indices from assimp.  Not the project failes and does not show anything.  I upload here my main and modelLoader classes, and shaders. I really hope that you can give me some help. thank you.    ps. Here you could find the whole project: https://github.com/alezz94/ModelLoader
15. ## Use Assimp in Universal Windows App

Yeah, but still, it does not work..