Comments (7)
https://drive.google.com/file/d/10V5zb2WtRJb15RkIp7Xxs9Cu0tyEI-xR/view?usp=sharing
obj file is here.
this file is 79.6mb, so I used google drive.
from assimp.
Please attach offending .obj file to ticket for troubleshooting
from assimp.
Do you have a call stack?
from assimp.
Can be correctly loaded with assimp info
and converted to .fbx with assimp export
. No errors with Valgrind.
Error is most likely in your code.
from assimp.
Model loads and renders OK for me, agree problem likely in custom implementation code
(Also, it is expected that index numbers are all over the place, if they were perfectly linear the scene would render nonsense...the vertices, which might be at any location in the sequence, are referenced via index to create the faces)
Viewpoint | Screenshot |
---|---|
Exterior | |
Roof aperture | |
Upper level | |
Ground level |
from assimp.
for (int meshnum = 0; meshnum < scene->mNumMeshes; meshnum++)
{
auto scene_mesh = scene->mMeshes;
string fileoutputdata = "MeshNum[" + to_string(meshnum) + "]\n";
string temp = "";
//this code has problem
for (unsigned int facenum = 0; facenum < scene_mesh[meshnum]->mNumFaces; ++facenum)
{
auto face = scene_mesh[meshnum]->mFaces[facenum];
if (face.mNumIndices == 3) {
Triangle triangle;
triangle.v[0] = face.mIndices[0];
triangle.v[1] = face.mIndices[1];
triangle.v[2] = face.mIndices[2];
for (int i = 0; i < 3; i++)
{
temp += to_string(triangle.v[i]);
temp += "/";
}
Triangle_ArrayList_add(&mesh->triangles, &triangle);
temp += "\n";
}
}
temp += "\n";
ofstream file;
file.open("facedata.txt", ios::app);
if (file.is_open())
{
file.write(fileoutputdata.c_str(), fileoutputdata.size());
file.write(temp.c_str(), temp.size());
file.close();
}
}
I wrote the code like this, and the data for that code is like the attached file above. I checked that it comes out normally visually, but I don't think I can bring the data of face in order. What should I do?
from assimp.
I solved Triangle Order Problem.
But I saw new problem. I think this problem caused a previous problem.
When the assimp library imports the model, it also imports the vertex data that is not in the model.
Assimp_Vertexdata.txt
OBJ_origin_Vertexdata.txt
Export Assimp Data Func
for (int meshnum = 0; meshnum < scene->mNumMeshes; meshnum++)
{
auto scene_mesh = scene->mMeshes;
string output = "Mesh[" + to_string(meshnum) + "]\n";
string temp = "";
//Vertex Data
for (int vertexnum = 0; vertexnum < scene_mesh[meshnum]->mNumVertices; vertexnum++)
{
Vector3 vertex;
vertex.x = scene_mesh[meshnum]->mVertices[vertexnum].x;
vertex.y = scene_mesh[meshnum]->mVertices[vertexnum].y;
vertex.z = scene_mesh[meshnum]->mVertices[vertexnum].z;
temp += "x[" + to_string(vertex.x) + "] y[" + to_string(vertex.y) + "] z[" + to_string(vertex.z) + "]\n";
Vector3_ArrayList_add(&vertices, &vertex);
}
ofstream file;
file.open("importer_vertexdata.txt", ios::app);
if (file.is_open())
{
file.write(output.c_str(), output.size());
file.write(temp.c_str(), temp.size());
file.close();
}
}
Origin Data Export Func
while (fgets(current_line, 500, file))
{
current_token = strtok(current_line, " \t\n\r");
if (current_token == NULL)
{
continue;
}
else if (strequal(current_token, "v"))
{
Vector3 vertex;
vertex.x = atof(strtok(NULL, WHITESPACE));
vertex.y = atof(strtok(NULL, WHITESPACE));
vertex.z = atof(strtok(NULL, WHITESPACE));
string temp = "x[" + to_string(vertex.x) + "] y[" + to_string(vertex.y) + "] z[" + to_string(vertex.z) + "]\n";
ofstream file;
file.open("origin_vertexdata.txt", ios::app);
if (file.is_open())
{
file.write(temp.c_str(), temp.size());
file.close();
}
Vector3_ArrayList_add(&vertices, &vertex);
}
}
from assimp.
Related Issues (20)
- Bug: DXF conversion assigns incorrect colors HOT 2
- Bug: FBX Export requires writing each mesh to a separate node.
- Bug: broken fbx animation HOT 1
- Bug: loading a obj format model has crashed(mingw gcc) HOT 5
- Bug: Identity matrix check problem HOT 1
- Bug: FBX export Video does not export correct tags HOT 1
- Bug: FBX Export does not respect materials per face
- Help: Get dimensions of embedded texture. HOT 2
- FBX Imported animation applies action to all nodes HOT 5
- MacOS compilation error: error: unknown type name 'constexpr' constexpr ai_real ai_epsilon = (ai_real) 1e-6; HOT 1
- Bug: segmentation fault while removing redundant materials HOT 5
- License missing for pyassimp HOT 3
- Bug: Issue 64108 in oss-fuzz: assimp:assimp_fuzzer: Stack-overflow in Assimp::LWS::Element::Parse
- Bug: Cant rendering on DX11 HOT 4
- FBX Feature Flag for ignore start and stop time on import
- Bug: Issue 64586 in oss-fuzz: assimp:assimp_fuzzer: Integer-overflow in Assimp::FBXExporter::WriteObjects
- Bug: assimpd export GoldSrc MDL -> OBJ possibly changes model origin? HOT 2
- Bug: FBX Exporter axes do not respect metadata HOT 1
- PostProcessing | Add post-processing step to generate texture atlasses from materials
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from assimp.