Compare commits
22 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
06f6139d1f | ||
|
|
0c8db8ee23 | ||
|
|
5113cd65cf | ||
|
|
65df7c4794 | ||
|
|
eaf8623e61 | ||
|
|
dcad3e6c50 | ||
|
|
2dfc37a475 | ||
|
|
9a6390cdee | ||
|
|
78c7c9011a | ||
|
|
1754669b07 | ||
|
|
1f7b4a49c0 | ||
|
|
15f47e2e35 | ||
|
|
12bf4165be | ||
|
|
f206a56362 | ||
|
|
13951d6459 | ||
|
|
5383e3400a | ||
|
|
ac3c36ffda | ||
|
|
3b681805aa | ||
|
|
ca49183639 | ||
|
|
b29d34f2e1 | ||
|
|
cb085d1fb6 | ||
|
|
b38e97b7ec |
36
README.md
36
README.md
@@ -26,20 +26,11 @@ Old version is available `v0.9.x` branch https://github.com/syoyo/tinyobjloader/
|
|||||||
|
|
||||||
## What's new
|
## What's new
|
||||||
|
|
||||||
### Version 2.x
|
|
||||||
|
|
||||||
* Refactor API
|
|
||||||
* Support triangulation for concave polygons(#151)
|
|
||||||
|
|
||||||
### Version 1.x
|
|
||||||
|
|
||||||
Avaiable in `v1.x.y` branch.
|
|
||||||
|
|
||||||
* 20 Aug, 2016 : Bump version v1.0.0. New data structure and API!
|
* 20 Aug, 2016 : Bump version v1.0.0. New data structure and API!
|
||||||
|
|
||||||
### Older version
|
### Old version
|
||||||
|
|
||||||
Older version is avaiable in `v0.9.x` branch.
|
Previous old version is avaiable in `v0.9.x` branch.
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
@@ -58,11 +49,7 @@ http://casual-effects.com/data/index.html
|
|||||||
|
|
||||||
TinyObjLoader is successfully used in ...
|
TinyObjLoader is successfully used in ...
|
||||||
|
|
||||||
### New version(v2.x)
|
### New version(v1.0.x)
|
||||||
|
|
||||||
* Your project here! (Letting us know via github issue is welcome!)
|
|
||||||
|
|
||||||
### Old version(v1.x)
|
|
||||||
|
|
||||||
* Double precision support through `TINYOBJLOADER_USE_DOUBLE` thanks to noma
|
* Double precision support through `TINYOBJLOADER_USE_DOUBLE` thanks to noma
|
||||||
* Loading models in Vulkan Tutorial https://vulkan-tutorial.com/Loading_models
|
* Loading models in Vulkan Tutorial https://vulkan-tutorial.com/Loading_models
|
||||||
@@ -73,7 +60,7 @@ TinyObjLoader is successfully used in ...
|
|||||||
* VFPR - a Vulkan Forward Plus Renderer : https://github.com/WindyDarian/Vulkan-Forward-Plus-Renderer
|
* VFPR - a Vulkan Forward Plus Renderer : https://github.com/WindyDarian/Vulkan-Forward-Plus-Renderer
|
||||||
* Your project here! (Letting us know via github issue is welcome!)
|
* Your project here! (Letting us know via github issue is welcome!)
|
||||||
|
|
||||||
### Older version(v0.9.x)
|
### Old version(v0.9.x)
|
||||||
|
|
||||||
* bullet3 https://github.com/erwincoumans/bullet3
|
* bullet3 https://github.com/erwincoumans/bullet3
|
||||||
* pbrt-v2 https://github.com/mmp/pbrt-v2
|
* pbrt-v2 https://github.com/mmp/pbrt-v2
|
||||||
@@ -111,6 +98,7 @@ TinyObjLoader is successfully used in ...
|
|||||||
* PBR material extension for .MTL. Its proposed here: http://exocortex.com/blog/extending_wavefront_mtl_to_support_pbr
|
* PBR material extension for .MTL. Its proposed here: http://exocortex.com/blog/extending_wavefront_mtl_to_support_pbr
|
||||||
* Callback API for custom loading.
|
* Callback API for custom loading.
|
||||||
* Double precision support(for HPC application).
|
* Double precision support(for HPC application).
|
||||||
|
* Smoothing group
|
||||||
|
|
||||||
|
|
||||||
## TODO
|
## TODO
|
||||||
@@ -118,8 +106,6 @@ TinyObjLoader is successfully used in ...
|
|||||||
* [ ] Fix obj_sticker example.
|
* [ ] Fix obj_sticker example.
|
||||||
* [ ] More unit test codes.
|
* [ ] More unit test codes.
|
||||||
* [x] Texture options
|
* [x] Texture options
|
||||||
* [ ] Normal vector generation
|
|
||||||
* [ ] Support smoothing groups
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
@@ -241,12 +227,12 @@ for (size_t s = 0; s < shapes.size(); s++) {
|
|||||||
for (size_t v = 0; v < fv; v++) {
|
for (size_t v = 0; v < fv; v++) {
|
||||||
// access to vertex
|
// access to vertex
|
||||||
tinyobj::index_t idx = shapes[s].mesh.indices[index_offset + v];
|
tinyobj::index_t idx = shapes[s].mesh.indices[index_offset + v];
|
||||||
tinyobj::real_t vx = attrib.vertices[idx.vertex_index].x;
|
tinyobj::real_t vx = attrib.vertices[3*idx.vertex_index+0];
|
||||||
tinyobj::real_t vy = attrib.vertices[idx.vertex_index].y;
|
tinyobj::real_t vy = attrib.vertices[3*idx.vertex_index+1];
|
||||||
tinyobj::real_t vz = attrib.vertices[idx.vertex_index].z;
|
tinyobj::real_t vz = attrib.vertices[3*idx.vertex_index+2];
|
||||||
tinyobj::real_t nx = attrib.normals[idx.normal_index].x;
|
tinyobj::real_t nx = attrib.normals[3*idx.normal_index+0];
|
||||||
tinyobj::real_t ny = attrib.normals[idx.normal_index].y;
|
tinyobj::real_t ny = attrib.normals[3*idx.normal_index+1];
|
||||||
tinyobj::real_t nz = attrib.normals[idx.normal_index].z;
|
tinyobj::real_t nz = attrib.normals[3*idx.normal_index+2];
|
||||||
tinyobj::real_t tx = attrib.texcoords[2*idx.texcoord_index+0];
|
tinyobj::real_t tx = attrib.texcoords[2*idx.texcoord_index+0];
|
||||||
tinyobj::real_t ty = attrib.texcoords[2*idx.texcoord_index+1];
|
tinyobj::real_t ty = attrib.texcoords[2*idx.texcoord_index+1];
|
||||||
// Optional: vertex colors
|
// Optional: vertex colors
|
||||||
|
|||||||
@@ -172,5 +172,3 @@ bool WriteObj(const std::string& filename, const std::vector<tinyobj::shape_t>&
|
|||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -37,11 +37,11 @@ extern "C" {
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
#ifdef max
|
#ifdef max
|
||||||
#undef max
|
#undef max
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef min
|
#ifdef min
|
||||||
#undef min
|
#undef min
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <mmsystem.h>
|
#include <mmsystem.h>
|
||||||
@@ -143,15 +143,15 @@ float eye[3], lookat[3], up[3];
|
|||||||
|
|
||||||
GLFWwindow* window;
|
GLFWwindow* window;
|
||||||
|
|
||||||
static std::string GetBaseDir(const std::string &filepath) {
|
static std::string GetBaseDir(const std::string& filepath) {
|
||||||
if (filepath.find_last_of("/\\") != std::string::npos)
|
if (filepath.find_last_of("/\\") != std::string::npos)
|
||||||
return filepath.substr(0, filepath.find_last_of("/\\"));
|
return filepath.substr(0, filepath.find_last_of("/\\"));
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool FileExists(const std::string &abs_filename) {
|
static bool FileExists(const std::string& abs_filename) {
|
||||||
bool ret;
|
bool ret;
|
||||||
FILE *fp = fopen(abs_filename.c_str(), "rb");
|
FILE* fp = fopen(abs_filename.c_str(), "rb");
|
||||||
if (fp) {
|
if (fp) {
|
||||||
ret = true;
|
ret = true;
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
@@ -191,14 +191,106 @@ static void CalcNormal(float N[3], float v0[3], float v1[3], float v2[3]) {
|
|||||||
|
|
||||||
N[0] /= len;
|
N[0] /= len;
|
||||||
N[1] /= len;
|
N[1] /= len;
|
||||||
|
N[2] /= len;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace // Local utility functions
|
||||||
|
{
|
||||||
|
struct vec3 {
|
||||||
|
float v[3];
|
||||||
|
vec3() {
|
||||||
|
v[0] = 0.0f;
|
||||||
|
v[1] = 0.0f;
|
||||||
|
v[2] = 0.0f;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
void normalizeVector(vec3 &v) {
|
||||||
|
float len2 = v.v[0] * v.v[0] + v.v[1] * v.v[1] + v.v[2] * v.v[2];
|
||||||
|
if (len2 > 0.0f) {
|
||||||
|
float len = sqrtf(len2);
|
||||||
|
|
||||||
|
v.v[0] /= len;
|
||||||
|
v.v[1] /= len;
|
||||||
|
v.v[2] /= len;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if `mesh_t` contains smoothing group id.
|
||||||
|
bool hasSmoothingGroup(const tinyobj::shape_t& shape)
|
||||||
|
{
|
||||||
|
for (size_t i = 0; i < shape.mesh.smoothing_group_ids.size(); i++) {
|
||||||
|
if (shape.mesh.smoothing_group_ids[i] > 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void computeSmoothingNormals(const tinyobj::attrib_t& attrib, const tinyobj::shape_t& shape,
|
||||||
|
std::map<int, vec3>& smoothVertexNormals) {
|
||||||
|
smoothVertexNormals.clear();
|
||||||
|
std::map<int, vec3>::iterator iter;
|
||||||
|
|
||||||
|
for (size_t f = 0; f < shape.mesh.indices.size() / 3; f++) {
|
||||||
|
// Get the three indexes of the face (all faces are triangular)
|
||||||
|
tinyobj::index_t idx0 = shape.mesh.indices[3 * f + 0];
|
||||||
|
tinyobj::index_t idx1 = shape.mesh.indices[3 * f + 1];
|
||||||
|
tinyobj::index_t idx2 = shape.mesh.indices[3 * f + 2];
|
||||||
|
|
||||||
|
// Get the three vertex indexes and coordinates
|
||||||
|
int vi[3]; // indexes
|
||||||
|
float v[3][3]; // coordinates
|
||||||
|
|
||||||
|
for (int k = 0; k < 3; k++) {
|
||||||
|
vi[0] = idx0.vertex_index;
|
||||||
|
vi[1] = idx1.vertex_index;
|
||||||
|
vi[2] = idx2.vertex_index;
|
||||||
|
assert(vi[0] >= 0);
|
||||||
|
assert(vi[1] >= 0);
|
||||||
|
assert(vi[2] >= 0);
|
||||||
|
|
||||||
|
v[0][k] = attrib.vertices[3 * vi[0] + k];
|
||||||
|
v[1][k] = attrib.vertices[3 * vi[1] + k];
|
||||||
|
v[2][k] = attrib.vertices[3 * vi[2] + k];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Compute the normal of the face
|
||||||
|
float normal[3];
|
||||||
|
CalcNormal(normal, v[0], v[1], v[2]);
|
||||||
|
|
||||||
|
// Add the normal to the three vertexes
|
||||||
|
for (size_t i = 0; i < 3; ++i) {
|
||||||
|
iter = smoothVertexNormals.find(vi[i]);
|
||||||
|
if (iter != smoothVertexNormals.end()) {
|
||||||
|
// add
|
||||||
|
iter->second.v[0] += normal[0];
|
||||||
|
iter->second.v[1] += normal[1];
|
||||||
|
iter->second.v[2] += normal[2];
|
||||||
|
} else {
|
||||||
|
smoothVertexNormals[vi[i]].v[0] = normal[0];
|
||||||
|
smoothVertexNormals[vi[i]].v[1] = normal[1];
|
||||||
|
smoothVertexNormals[vi[i]].v[2] = normal[2];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} // f
|
||||||
|
|
||||||
|
// Normalize the normals, that is, make them unit vectors
|
||||||
|
for (iter = smoothVertexNormals.begin(); iter != smoothVertexNormals.end();
|
||||||
|
iter++) {
|
||||||
|
normalizeVector(iter->second);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // computeSmoothingNormals
|
||||||
|
} // namespace
|
||||||
|
|
||||||
static bool LoadObjAndConvert(float bmin[3], float bmax[3],
|
static bool LoadObjAndConvert(float bmin[3], float bmax[3],
|
||||||
std::vector<DrawObject>* drawObjects,
|
std::vector<DrawObject>* drawObjects,
|
||||||
std::vector<tinyobj::material_t>& materials,
|
std::vector<tinyobj::material_t>& materials,
|
||||||
std::map<std::string, GLuint>& textures,
|
std::map<std::string, GLuint>& textures,
|
||||||
const char* filename) {
|
const char* filename) {
|
||||||
tinyobj::attrib_t attrib;
|
tinyobj::attrib_t attrib;
|
||||||
std::vector<tinyobj::shape_t> shapes;
|
std::vector<tinyobj::shape_t> shapes;
|
||||||
|
|
||||||
@@ -217,8 +309,8 @@ static bool LoadObjAndConvert(float bmin[3], float bmax[3],
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
std::string err;
|
std::string err;
|
||||||
bool ret =
|
bool ret = tinyobj::LoadObj(&attrib, &shapes, &materials, &err, filename,
|
||||||
tinyobj::LoadObj(&attrib, &shapes, &materials, &err, filename, base_dir.c_str());
|
base_dir.c_str());
|
||||||
if (!err.empty()) {
|
if (!err.empty()) {
|
||||||
std::cerr << err << std::endl;
|
std::cerr << err << std::endl;
|
||||||
}
|
}
|
||||||
@@ -242,56 +334,62 @@ static bool LoadObjAndConvert(float bmin[3], float bmax[3],
|
|||||||
materials.push_back(tinyobj::material_t());
|
materials.push_back(tinyobj::material_t());
|
||||||
|
|
||||||
for (size_t i = 0; i < materials.size(); i++) {
|
for (size_t i = 0; i < materials.size(); i++) {
|
||||||
printf("material[%d].diffuse_texname = %s\n", int(i), materials[i].diffuse_texname.c_str());
|
printf("material[%d].diffuse_texname = %s\n", int(i),
|
||||||
|
materials[i].diffuse_texname.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load diffuse textures
|
// Load diffuse textures
|
||||||
{
|
{
|
||||||
for (size_t m = 0; m < materials.size(); m++) {
|
for (size_t m = 0; m < materials.size(); m++) {
|
||||||
tinyobj::material_t* mp = &materials[m];
|
tinyobj::material_t* mp = &materials[m];
|
||||||
|
|
||||||
if (mp->diffuse_texname.length() > 0) {
|
if (mp->diffuse_texname.length() > 0) {
|
||||||
// Only load the texture if it is not already loaded
|
// Only load the texture if it is not already loaded
|
||||||
if (textures.find(mp->diffuse_texname) == textures.end()) {
|
if (textures.find(mp->diffuse_texname) == textures.end()) {
|
||||||
GLuint texture_id;
|
GLuint texture_id;
|
||||||
int w, h;
|
int w, h;
|
||||||
int comp;
|
int comp;
|
||||||
|
|
||||||
std::string texture_filename = mp->diffuse_texname;
|
std::string texture_filename = mp->diffuse_texname;
|
||||||
if (!FileExists(texture_filename)) {
|
if (!FileExists(texture_filename)) {
|
||||||
// Append base dir.
|
// Append base dir.
|
||||||
texture_filename = base_dir + mp->diffuse_texname;
|
texture_filename = base_dir + mp->diffuse_texname;
|
||||||
if (!FileExists(texture_filename)) {
|
if (!FileExists(texture_filename)) {
|
||||||
std::cerr << "Unable to find file: " << mp->diffuse_texname << std::endl;
|
std::cerr << "Unable to find file: " << mp->diffuse_texname
|
||||||
exit(1);
|
<< std::endl;
|
||||||
}
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned char* image = stbi_load(texture_filename.c_str(), &w, &h, &comp, STBI_default);
|
|
||||||
if (!image) {
|
|
||||||
std::cerr << "Unable to load texture: " << texture_filename << std::endl;
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
std::cout << "Loaded texture: " << texture_filename << ", w = " << w << ", h = " << h << ", comp = " << comp << std::endl;
|
|
||||||
|
|
||||||
glGenTextures(1, &texture_id);
|
|
||||||
glBindTexture(GL_TEXTURE_2D, texture_id);
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
|
||||||
if (comp == 3) {
|
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, w, h, 0, GL_RGB, GL_UNSIGNED_BYTE, image);
|
|
||||||
}
|
|
||||||
else if (comp == 4) {
|
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, image);
|
|
||||||
} else {
|
|
||||||
assert(0); // TODO
|
|
||||||
}
|
|
||||||
glBindTexture(GL_TEXTURE_2D, 0);
|
|
||||||
stbi_image_free(image);
|
|
||||||
textures.insert(std::make_pair(mp->diffuse_texname, texture_id));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned char* image =
|
||||||
|
stbi_load(texture_filename.c_str(), &w, &h, &comp, STBI_default);
|
||||||
|
if (!image) {
|
||||||
|
std::cerr << "Unable to load texture: " << texture_filename
|
||||||
|
<< std::endl;
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
std::cout << "Loaded texture: " << texture_filename << ", w = " << w
|
||||||
|
<< ", h = " << h << ", comp = " << comp << std::endl;
|
||||||
|
|
||||||
|
glGenTextures(1, &texture_id);
|
||||||
|
glBindTexture(GL_TEXTURE_2D, texture_id);
|
||||||
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||||
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||||
|
if (comp == 3) {
|
||||||
|
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, w, h, 0, GL_RGB,
|
||||||
|
GL_UNSIGNED_BYTE, image);
|
||||||
|
} else if (comp == 4) {
|
||||||
|
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_RGBA,
|
||||||
|
GL_UNSIGNED_BYTE, image);
|
||||||
|
} else {
|
||||||
|
assert(0); // TODO
|
||||||
|
}
|
||||||
|
glBindTexture(GL_TEXTURE_2D, 0);
|
||||||
|
stbi_image_free(image);
|
||||||
|
textures.insert(std::make_pair(mp->diffuse_texname, texture_id));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bmin[0] = bmin[1] = bmin[2] = std::numeric_limits<float>::max();
|
bmin[0] = bmin[1] = bmin[2] = std::numeric_limits<float>::max();
|
||||||
@@ -301,6 +399,14 @@ static bool LoadObjAndConvert(float bmin[3], float bmax[3],
|
|||||||
for (size_t s = 0; s < shapes.size(); s++) {
|
for (size_t s = 0; s < shapes.size(); s++) {
|
||||||
DrawObject o;
|
DrawObject o;
|
||||||
std::vector<float> buffer; // pos(3float), normal(3float), color(3float)
|
std::vector<float> buffer; // pos(3float), normal(3float), color(3float)
|
||||||
|
|
||||||
|
// Check for smoothing group and compute smoothing normals
|
||||||
|
std::map<int, vec3> smoothVertexNormals;
|
||||||
|
if (hasSmoothingGroup(shapes[s]) > 0) {
|
||||||
|
std::cout << "Compute smoothingNormal for shape [" << s << "]" << std::endl;
|
||||||
|
computeSmoothingNormals(attrib, shapes[s], smoothVertexNormals);
|
||||||
|
}
|
||||||
|
|
||||||
for (size_t f = 0; f < shapes[s].mesh.indices.size() / 3; f++) {
|
for (size_t f = 0; f < shapes[s].mesh.indices.size() / 3; f++) {
|
||||||
tinyobj::index_t idx0 = shapes[s].mesh.indices[3 * f + 0];
|
tinyobj::index_t idx0 = shapes[s].mesh.indices[3 * f + 0];
|
||||||
tinyobj::index_t idx1 = shapes[s].mesh.indices[3 * f + 1];
|
tinyobj::index_t idx1 = shapes[s].mesh.indices[3 * f + 1];
|
||||||
@@ -308,23 +414,40 @@ static bool LoadObjAndConvert(float bmin[3], float bmax[3],
|
|||||||
|
|
||||||
int current_material_id = shapes[s].mesh.material_ids[f];
|
int current_material_id = shapes[s].mesh.material_ids[f];
|
||||||
|
|
||||||
if ((current_material_id < 0) || (current_material_id >= static_cast<int>(materials.size()))) {
|
if ((current_material_id < 0) ||
|
||||||
|
(current_material_id >= static_cast<int>(materials.size()))) {
|
||||||
// Invaid material ID. Use default material.
|
// Invaid material ID. Use default material.
|
||||||
current_material_id = materials.size() - 1; // Default material is added to the last item in `materials`.
|
current_material_id =
|
||||||
|
materials.size() -
|
||||||
|
1; // Default material is added to the last item in `materials`.
|
||||||
}
|
}
|
||||||
//if (current_material_id >= materials.size()) {
|
// if (current_material_id >= materials.size()) {
|
||||||
// std::cerr << "Invalid material index: " << current_material_id << std::endl;
|
// std::cerr << "Invalid material index: " << current_material_id <<
|
||||||
|
// std::endl;
|
||||||
//}
|
//}
|
||||||
//
|
//
|
||||||
float diffuse[3];
|
float diffuse[3];
|
||||||
for (size_t i = 0; i < 3; i++) {
|
for (size_t i = 0; i < 3; i++) {
|
||||||
diffuse[i] = materials[current_material_id].diffuse[i];
|
diffuse[i] = materials[current_material_id].diffuse[i];
|
||||||
}
|
}
|
||||||
float tc[3][2];
|
float tc[3][2];
|
||||||
if (attrib.texcoords.size() > 0) {
|
if (attrib.texcoords.size() > 0) {
|
||||||
assert(attrib.texcoords.size() > 2 * idx0.texcoord_index + 1);
|
if ((idx0.texcoord_index < 0) || (idx1.texcoord_index < 0) ||
|
||||||
assert(attrib.texcoords.size() > 2 * idx1.texcoord_index + 1);
|
(idx2.texcoord_index < 0)) {
|
||||||
assert(attrib.texcoords.size() > 2 * idx2.texcoord_index + 1);
|
// face does not contain valid uv index.
|
||||||
|
tc[0][0] = 0.0f;
|
||||||
|
tc[0][1] = 0.0f;
|
||||||
|
tc[1][0] = 0.0f;
|
||||||
|
tc[1][1] = 0.0f;
|
||||||
|
tc[2][0] = 0.0f;
|
||||||
|
tc[2][1] = 0.0f;
|
||||||
|
} else {
|
||||||
|
assert(attrib.texcoords.size() >
|
||||||
|
size_t(2 * idx0.texcoord_index + 1));
|
||||||
|
assert(attrib.texcoords.size() >
|
||||||
|
size_t(2 * idx1.texcoord_index + 1));
|
||||||
|
assert(attrib.texcoords.size() >
|
||||||
|
size_t(2 * idx2.texcoord_index + 1));
|
||||||
|
|
||||||
// Flip Y coord.
|
// Flip Y coord.
|
||||||
tc[0][0] = attrib.texcoords[2 * idx0.texcoord_index];
|
tc[0][0] = attrib.texcoords[2 * idx0.texcoord_index];
|
||||||
@@ -333,13 +456,14 @@ static bool LoadObjAndConvert(float bmin[3], float bmax[3],
|
|||||||
tc[1][1] = 1.0f - attrib.texcoords[2 * idx1.texcoord_index + 1];
|
tc[1][1] = 1.0f - attrib.texcoords[2 * idx1.texcoord_index + 1];
|
||||||
tc[2][0] = attrib.texcoords[2 * idx2.texcoord_index];
|
tc[2][0] = attrib.texcoords[2 * idx2.texcoord_index];
|
||||||
tc[2][1] = 1.0f - attrib.texcoords[2 * idx2.texcoord_index + 1];
|
tc[2][1] = 1.0f - attrib.texcoords[2 * idx2.texcoord_index + 1];
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
tc[0][0] = 0.0f;
|
tc[0][0] = 0.0f;
|
||||||
tc[0][1] = 0.0f;
|
tc[0][1] = 0.0f;
|
||||||
tc[1][0] = 0.0f;
|
tc[1][0] = 0.0f;
|
||||||
tc[1][1] = 0.0f;
|
tc[1][1] = 0.0f;
|
||||||
tc[2][0] = 0.0f;
|
tc[2][0] = 0.0f;
|
||||||
tc[2][1] = 0.0f;
|
tc[2][1] = 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
float v[3][3];
|
float v[3][3];
|
||||||
@@ -363,27 +487,63 @@ static bool LoadObjAndConvert(float bmin[3], float bmax[3],
|
|||||||
}
|
}
|
||||||
|
|
||||||
float n[3][3];
|
float n[3][3];
|
||||||
if (attrib.normals.size() > 0) {
|
{
|
||||||
int f0 = idx0.normal_index;
|
bool invalid_normal_index = false;
|
||||||
int f1 = idx1.normal_index;
|
if (attrib.normals.size() > 0) {
|
||||||
int f2 = idx2.normal_index;
|
int nf0 = idx0.normal_index;
|
||||||
assert(f0 >= 0);
|
int nf1 = idx1.normal_index;
|
||||||
assert(f1 >= 0);
|
int nf2 = idx2.normal_index;
|
||||||
assert(f2 >= 0);
|
|
||||||
for (int k = 0; k < 3; k++) {
|
if ((nf0 < 0) || (nf1 < 0) || (nf2 < 0)) {
|
||||||
n[0][k] = attrib.normals[3 * f0 + k];
|
// normal index is missing from this face.
|
||||||
n[1][k] = attrib.normals[3 * f1 + k];
|
invalid_normal_index = true;
|
||||||
n[2][k] = attrib.normals[3 * f2 + k];
|
} else {
|
||||||
|
for (int k = 0; k < 3; k++) {
|
||||||
|
assert(size_t(3 * nf0 + k) < attrib.normals.size());
|
||||||
|
assert(size_t(3 * nf1 + k) < attrib.normals.size());
|
||||||
|
assert(size_t(3 * nf2 + k) < attrib.normals.size());
|
||||||
|
n[0][k] = attrib.normals[3 * nf0 + k];
|
||||||
|
n[1][k] = attrib.normals[3 * nf1 + k];
|
||||||
|
n[2][k] = attrib.normals[3 * nf2 + k];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
invalid_normal_index = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (invalid_normal_index && !smoothVertexNormals.empty()) {
|
||||||
|
// Use smoothing normals
|
||||||
|
int f0 = idx0.vertex_index;
|
||||||
|
int f1 = idx1.vertex_index;
|
||||||
|
int f2 = idx2.vertex_index;
|
||||||
|
|
||||||
|
if (f0 >= 0 && f1 >= 0 && f2 >= 0) {
|
||||||
|
n[0][0] = smoothVertexNormals[f0].v[0];
|
||||||
|
n[0][1] = smoothVertexNormals[f0].v[1];
|
||||||
|
n[0][2] = smoothVertexNormals[f0].v[2];
|
||||||
|
|
||||||
|
n[1][0] = smoothVertexNormals[f1].v[0];
|
||||||
|
n[1][1] = smoothVertexNormals[f1].v[1];
|
||||||
|
n[1][2] = smoothVertexNormals[f1].v[2];
|
||||||
|
|
||||||
|
n[2][0] = smoothVertexNormals[f2].v[0];
|
||||||
|
n[2][1] = smoothVertexNormals[f2].v[1];
|
||||||
|
n[2][2] = smoothVertexNormals[f2].v[2];
|
||||||
|
|
||||||
|
invalid_normal_index = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (invalid_normal_index) {
|
||||||
|
// compute geometric normal
|
||||||
|
CalcNormal(n[0], v[0], v[1], v[2]);
|
||||||
|
n[1][0] = n[0][0];
|
||||||
|
n[1][1] = n[0][1];
|
||||||
|
n[1][2] = n[0][2];
|
||||||
|
n[2][0] = n[0][0];
|
||||||
|
n[2][1] = n[0][1];
|
||||||
|
n[2][2] = n[0][2];
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
// compute geometric normal
|
|
||||||
CalcNormal(n[0], v[0], v[1], v[2]);
|
|
||||||
n[1][0] = n[0][0];
|
|
||||||
n[1][1] = n[0][1];
|
|
||||||
n[1][2] = n[0][2];
|
|
||||||
n[2][0] = n[0][0];
|
|
||||||
n[2][1] = n[0][1];
|
|
||||||
n[2][2] = n[0][2];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int k = 0; k < 3; k++) {
|
for (int k = 0; k < 3; k++) {
|
||||||
@@ -396,11 +556,9 @@ static bool LoadObjAndConvert(float bmin[3], float bmax[3],
|
|||||||
// Combine normal and diffuse to get color.
|
// Combine normal and diffuse to get color.
|
||||||
float normal_factor = 0.2;
|
float normal_factor = 0.2;
|
||||||
float diffuse_factor = 1 - normal_factor;
|
float diffuse_factor = 1 - normal_factor;
|
||||||
float c[3] = {
|
float c[3] = {n[k][0] * normal_factor + diffuse[0] * diffuse_factor,
|
||||||
n[k][0] * normal_factor + diffuse[0] * diffuse_factor,
|
n[k][1] * normal_factor + diffuse[1] * diffuse_factor,
|
||||||
n[k][1] * normal_factor + diffuse[1] * diffuse_factor,
|
n[k][2] * normal_factor + diffuse[2] * diffuse_factor};
|
||||||
n[k][2] * normal_factor + diffuse[2] * diffuse_factor
|
|
||||||
};
|
|
||||||
float len2 = c[0] * c[0] + c[1] * c[1] + c[2] * c[2];
|
float len2 = c[0] * c[0] + c[1] * c[1] + c[2] * c[2];
|
||||||
if (len2 > 0.0f) {
|
if (len2 > 0.0f) {
|
||||||
float len = sqrtf(len2);
|
float len = sqrtf(len2);
|
||||||
@@ -422,19 +580,22 @@ static bool LoadObjAndConvert(float bmin[3], float bmax[3],
|
|||||||
o.numTriangles = 0;
|
o.numTriangles = 0;
|
||||||
|
|
||||||
// OpenGL viewer does not support texturing with per-face material.
|
// OpenGL viewer does not support texturing with per-face material.
|
||||||
if (shapes[s].mesh.material_ids.size() > 0 && shapes[s].mesh.material_ids.size() > s) {
|
if (shapes[s].mesh.material_ids.size() > 0 &&
|
||||||
o.material_id = shapes[s].mesh.material_ids[0]; // use the material ID of the first face.
|
shapes[s].mesh.material_ids.size() > s) {
|
||||||
|
o.material_id = shapes[s].mesh.material_ids[0]; // use the material ID
|
||||||
|
// of the first face.
|
||||||
} else {
|
} else {
|
||||||
o.material_id = materials.size() - 1; // = ID for default material.
|
o.material_id = materials.size() - 1; // = ID for default material.
|
||||||
}
|
}
|
||||||
printf("shape[%d] material_id %d\n", int(s), int(o.material_id));
|
printf("shape[%d] material_id %d\n", int(s), int(o.material_id));
|
||||||
|
|
||||||
if (buffer.size() > 0) {
|
if (buffer.size() > 0) {
|
||||||
glGenBuffers(1, &o.vb_id);
|
glGenBuffers(1, &o.vb_id);
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, o.vb_id);
|
glBindBuffer(GL_ARRAY_BUFFER, o.vb_id);
|
||||||
glBufferData(GL_ARRAY_BUFFER, buffer.size() * sizeof(float), &buffer.at(0),
|
glBufferData(GL_ARRAY_BUFFER, buffer.size() * sizeof(float),
|
||||||
GL_STATIC_DRAW);
|
&buffer.at(0), GL_STATIC_DRAW);
|
||||||
o.numTriangles = buffer.size() / (3 + 3 + 3 + 2) / 3; // 3:vtx, 3:normal, 3:col, 2:texcoord
|
o.numTriangles = buffer.size() / (3 + 3 + 3 + 2) /
|
||||||
|
3; // 3:vtx, 3:normal, 3:col, 2:texcoord
|
||||||
|
|
||||||
printf("shape[%d] # of triangles = %d\n", static_cast<int>(s),
|
printf("shape[%d] # of triangles = %d\n", static_cast<int>(s),
|
||||||
o.numTriangles);
|
o.numTriangles);
|
||||||
@@ -467,7 +628,7 @@ static void reshapeFunc(GLFWwindow* window, int w, int h) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void keyboardFunc(GLFWwindow* window, int key, int scancode, int action,
|
static void keyboardFunc(GLFWwindow* window, int key, int scancode, int action,
|
||||||
int mods) {
|
int mods) {
|
||||||
(void)window;
|
(void)window;
|
||||||
(void)scancode;
|
(void)scancode;
|
||||||
(void)mods;
|
(void)mods;
|
||||||
@@ -549,7 +710,9 @@ static void motionFunc(GLFWwindow* window, double mouse_x, double mouse_y) {
|
|||||||
prevMouseY = mouse_y;
|
prevMouseY = mouse_y;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Draw(const std::vector<DrawObject>& drawObjects, std::vector<tinyobj::material_t>& materials, std::map<std::string, GLuint>& textures) {
|
static void Draw(const std::vector<DrawObject>& drawObjects,
|
||||||
|
std::vector<tinyobj::material_t>& materials,
|
||||||
|
std::map<std::string, GLuint>& textures) {
|
||||||
glPolygonMode(GL_FRONT, GL_FILL);
|
glPolygonMode(GL_FRONT, GL_FILL);
|
||||||
glPolygonMode(GL_BACK, GL_FILL);
|
glPolygonMode(GL_BACK, GL_FILL);
|
||||||
|
|
||||||
@@ -572,7 +735,7 @@ static void Draw(const std::vector<DrawObject>& drawObjects, std::vector<tinyobj
|
|||||||
if ((o.material_id < materials.size())) {
|
if ((o.material_id < materials.size())) {
|
||||||
std::string diffuse_texname = materials[o.material_id].diffuse_texname;
|
std::string diffuse_texname = materials[o.material_id].diffuse_texname;
|
||||||
if (textures.find(diffuse_texname) != textures.end()) {
|
if (textures.find(diffuse_texname) != textures.end()) {
|
||||||
glBindTexture(GL_TEXTURE_2D, textures[diffuse_texname]);
|
glBindTexture(GL_TEXTURE_2D, textures[diffuse_texname]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
glVertexPointer(3, GL_FLOAT, stride, (const void*)0);
|
glVertexPointer(3, GL_FLOAT, stride, (const void*)0);
|
||||||
@@ -668,7 +831,8 @@ int main(int argc, char** argv) {
|
|||||||
float bmin[3], bmax[3];
|
float bmin[3], bmax[3];
|
||||||
std::vector<tinyobj::material_t> materials;
|
std::vector<tinyobj::material_t> materials;
|
||||||
std::map<std::string, GLuint> textures;
|
std::map<std::string, GLuint> textures;
|
||||||
if (false == LoadObjAndConvert(bmin, bmax, &gDrawObjects, materials, textures, argv[1])) {
|
if (false == LoadObjAndConvert(bmin, bmax, &gDrawObjects, materials, textures,
|
||||||
|
argv[1])) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1440,7 +1440,9 @@ bool parseObj(attrib_t *attrib, std::vector<shape_t> *shapes,
|
|||||||
// std::cout << "mtllib :" << material_filename << std::endl;
|
// std::cout << "mtllib :" << material_filename << std::endl;
|
||||||
|
|
||||||
auto t1 = std::chrono::high_resolution_clock::now();
|
auto t1 = std::chrono::high_resolution_clock::now();
|
||||||
|
if (material_filename.back() == '\r') {
|
||||||
|
material_filename.pop_back();
|
||||||
|
}
|
||||||
std::ifstream ifs(material_filename);
|
std::ifstream ifs(material_filename);
|
||||||
if (ifs.good()) {
|
if (ifs.good()) {
|
||||||
LoadMtl(&material_map, materials, &ifs);
|
LoadMtl(&material_map, materials, &ifs);
|
||||||
@@ -1516,13 +1518,13 @@ bool parseObj(attrib_t *attrib, std::vector<shape_t> *shapes,
|
|||||||
StackVector<std::thread, 16> workers;
|
StackVector<std::thread, 16> workers;
|
||||||
|
|
||||||
for (size_t t = 0; t < num_threads; t++) {
|
for (size_t t = 0; t < num_threads; t++) {
|
||||||
int material_id = -1; // -1 = default unknown material.
|
|
||||||
workers->push_back(std::thread([&, t]() {
|
workers->push_back(std::thread([&, t]() {
|
||||||
size_t v_count = v_offsets[t];
|
size_t v_count = v_offsets[t];
|
||||||
size_t n_count = n_offsets[t];
|
size_t n_count = n_offsets[t];
|
||||||
size_t t_count = t_offsets[t];
|
size_t t_count = t_offsets[t];
|
||||||
size_t f_count = f_offsets[t];
|
size_t f_count = f_offsets[t];
|
||||||
size_t face_count = face_offsets[t];
|
size_t face_count = face_offsets[t];
|
||||||
|
int material_id = -1; // -1 = default unknown material.
|
||||||
|
|
||||||
for (size_t i = 0; i < commands[t].size(); i++) {
|
for (size_t i = 0; i < commands[t].size(); i++) {
|
||||||
if (commands[t][i].type == COMMAND_EMPTY) {
|
if (commands[t][i].type == COMMAND_EMPTY) {
|
||||||
@@ -1579,7 +1581,19 @@ bool parseObj(attrib_t *attrib, std::vector<shape_t> *shapes,
|
|||||||
for (size_t t = 0; t < workers->size(); t++) {
|
for (size_t t = 0; t < workers->size(); t++) {
|
||||||
workers[t].join();
|
workers[t].join();
|
||||||
}
|
}
|
||||||
|
if(material_map.size()>1&& num_threads>1) {
|
||||||
|
for (size_t t = 0; t < num_threads; t++) {
|
||||||
|
size_t face_count = face_offsets[t];
|
||||||
|
if (-1 == attrib->material_ids[face_count]) {
|
||||||
|
int prev_material_id = attrib->material_ids[face_count - 1];
|
||||||
|
size_t max_face_offset = (t == num_threads - 1) ? attrib->material_ids.size() : face_offsets[t + 1];
|
||||||
|
for (int i = face_count; i<max_face_offset; ++i) {
|
||||||
|
if (attrib->material_ids[i] != -1) break;
|
||||||
|
attrib->material_ids[i] = prev_material_id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
auto t_end = std::chrono::high_resolution_clock::now();
|
auto t_end = std::chrono::high_resolution_clock::now();
|
||||||
ms_merge = t_end - t_start;
|
ms_merge = t_end - t_start;
|
||||||
}
|
}
|
||||||
20
fuzzer/runner.py
Normal file
20
fuzzer/runner.py
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
import os, sys
|
||||||
|
import glob
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
def main():
|
||||||
|
for g in glob.glob("../tests/afl/id*"):
|
||||||
|
print(g)
|
||||||
|
|
||||||
|
cmd = ["../a.out", g]
|
||||||
|
|
||||||
|
proc = subprocess.Popen(cmd)
|
||||||
|
try:
|
||||||
|
outs, errs = proc.communicate(timeout=15)
|
||||||
|
print(outs)
|
||||||
|
except TimeoutExpired:
|
||||||
|
proc.kill()
|
||||||
|
outs, errs = proc.communicate()
|
||||||
|
|
||||||
|
|
||||||
|
main()
|
||||||
@@ -30,6 +30,7 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __clang__
|
#ifdef __clang__
|
||||||
|
#pragma clang diagnostic push
|
||||||
#if __has_warning("-Wzero-as-null-pointer-constant")
|
#if __has_warning("-Wzero-as-null-pointer-constant")
|
||||||
#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
|
#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
|
||||||
#endif
|
#endif
|
||||||
@@ -112,24 +113,24 @@ static void PrintInfo(const tinyobj::attrib_t& attrib,
|
|||||||
std::cout << "# of shapes : " << shapes.size() << std::endl;
|
std::cout << "# of shapes : " << shapes.size() << std::endl;
|
||||||
std::cout << "# of materials : " << materials.size() << std::endl;
|
std::cout << "# of materials : " << materials.size() << std::endl;
|
||||||
|
|
||||||
for (size_t v = 0; v < attrib.vertices.size(); v++) {
|
for (size_t v = 0; v < attrib.vertices.size() / 3; v++) {
|
||||||
printf(" v[%ld] = (%f, %f, %f)\n", static_cast<long>(v),
|
printf(" v[%ld] = (%f, %f, %f)\n", static_cast<long>(v),
|
||||||
static_cast<const double>(attrib.vertices[v].x),
|
static_cast<const double>(attrib.vertices[3 * v + 0]),
|
||||||
static_cast<const double>(attrib.vertices[v].y),
|
static_cast<const double>(attrib.vertices[3 * v + 1]),
|
||||||
static_cast<const double>(attrib.vertices[v].z));
|
static_cast<const double>(attrib.vertices[3 * v + 2]));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (size_t v = 0; v < attrib.normals.size(); v++) {
|
for (size_t v = 0; v < attrib.normals.size() / 3; v++) {
|
||||||
printf(" n[%ld] = (%f, %f, %f)\n", static_cast<long>(v),
|
printf(" n[%ld] = (%f, %f, %f)\n", static_cast<long>(v),
|
||||||
static_cast<const double>(attrib.normals[v].x),
|
static_cast<const double>(attrib.normals[3 * v + 0]),
|
||||||
static_cast<const double>(attrib.normals[v].y),
|
static_cast<const double>(attrib.normals[3 * v + 1]),
|
||||||
static_cast<const double>(attrib.normals[v].z));
|
static_cast<const double>(attrib.normals[3 * v + 2]));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (size_t v = 0; v < attrib.texcoords.size(); v++) {
|
for (size_t v = 0; v < attrib.texcoords.size() / 2; v++) {
|
||||||
printf(" uv[%ld] = (%f, %f)\n", static_cast<long>(v),
|
printf(" uv[%ld] = (%f, %f)\n", static_cast<long>(v),
|
||||||
static_cast<const double>(attrib.texcoords[v].x),
|
static_cast<const double>(attrib.texcoords[2 * v + 0]),
|
||||||
static_cast<const double>(attrib.texcoords[v].y));
|
static_cast<const double>(attrib.texcoords[2 * v + 1]));
|
||||||
}
|
}
|
||||||
|
|
||||||
// For each shape
|
// For each shape
|
||||||
@@ -144,6 +145,9 @@ static void PrintInfo(const tinyobj::attrib_t& attrib,
|
|||||||
assert(shapes[i].mesh.num_face_vertices.size() ==
|
assert(shapes[i].mesh.num_face_vertices.size() ==
|
||||||
shapes[i].mesh.material_ids.size());
|
shapes[i].mesh.material_ids.size());
|
||||||
|
|
||||||
|
assert(shapes[i].mesh.num_face_vertices.size() ==
|
||||||
|
shapes[i].mesh.smoothing_group_ids.size());
|
||||||
|
|
||||||
printf("shape[%ld].num_faces: %lu\n", static_cast<long>(i),
|
printf("shape[%ld].num_faces: %lu\n", static_cast<long>(i),
|
||||||
static_cast<unsigned long>(shapes[i].mesh.num_face_vertices.size()));
|
static_cast<unsigned long>(shapes[i].mesh.num_face_vertices.size()));
|
||||||
|
|
||||||
@@ -164,6 +168,8 @@ static void PrintInfo(const tinyobj::attrib_t& attrib,
|
|||||||
|
|
||||||
printf(" face[%ld].material_id = %d\n", static_cast<long>(f),
|
printf(" face[%ld].material_id = %d\n", static_cast<long>(f),
|
||||||
shapes[i].mesh.material_ids[f]);
|
shapes[i].mesh.material_ids[f]);
|
||||||
|
printf(" face[%ld].smoothing_group_id = %d\n", static_cast<long>(f),
|
||||||
|
shapes[i].mesh.smoothing_group_ids[f]);
|
||||||
|
|
||||||
index_offset += fnum;
|
index_offset += fnum;
|
||||||
}
|
}
|
||||||
@@ -367,7 +373,7 @@ static bool TestStreamLoadObj() {
|
|||||||
virtual ~MaterialStringStreamReader() {}
|
virtual ~MaterialStringStreamReader() {}
|
||||||
virtual bool operator()(const std::string& matId,
|
virtual bool operator()(const std::string& matId,
|
||||||
std::vector<material_t>* materials,
|
std::vector<material_t>* materials,
|
||||||
std::map<unsigned int, int>* matMap,
|
std::map<std::string, int>* matMap,
|
||||||
std::string* err) {
|
std::string* err) {
|
||||||
(void)matId;
|
(void)matId;
|
||||||
std::string warning;
|
std::string warning;
|
||||||
|
|||||||
37
models/issue-161-inconsistent-f.obj
Normal file
37
models/issue-161-inconsistent-f.obj
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
o cube
|
||||||
|
mtllib cube.mtl
|
||||||
|
|
||||||
|
v -0.500000 -0.500000 0.500000
|
||||||
|
v 0.500000 -0.500000 0.500000
|
||||||
|
v -0.500000 0.500000 0.500000
|
||||||
|
v 0.500000 0.500000 0.500000
|
||||||
|
v -0.500000 0.500000 -0.500000
|
||||||
|
v 0.500000 0.500000 -0.500000
|
||||||
|
v -0.500000 -0.500000 -0.500000
|
||||||
|
v 0.500000 -0.500000 -0.500000
|
||||||
|
|
||||||
|
vt 0.000000 0.000000
|
||||||
|
vt 1.000000 0.000000
|
||||||
|
vt 0.000000 1.000000
|
||||||
|
vt 1.000000 1.000000
|
||||||
|
|
||||||
|
g cube
|
||||||
|
usemtl cube
|
||||||
|
s 1
|
||||||
|
f 1/1 2/2 3/3
|
||||||
|
f 3/3 2/2 4/4
|
||||||
|
s 2
|
||||||
|
f 3/1 4/2 5/3
|
||||||
|
f 5/3 4/2 6/4
|
||||||
|
s 3
|
||||||
|
f 5/4 6/3 7/2
|
||||||
|
f 7/2 6/3 8/1
|
||||||
|
s 4
|
||||||
|
f 7/1 8/2 1/3
|
||||||
|
f 1/3 8/2 2/4
|
||||||
|
s 5
|
||||||
|
f 2/1 8/2 4/3
|
||||||
|
f 4/3 8/2 6/4
|
||||||
|
s 6
|
||||||
|
f 7/1 1/2 5/3
|
||||||
|
f 5 1 3
|
||||||
23
models/issue-162-smoothing-group.mtl
Normal file
23
models/issue-162-smoothing-group.mtl
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
newmtl test1
|
||||||
|
Ns 10.0000
|
||||||
|
Ni 1.5000
|
||||||
|
d 1.0000
|
||||||
|
Tr 0.0000
|
||||||
|
Tf 1.0000 1.0000 1.0000
|
||||||
|
illum 2
|
||||||
|
Ka 0.0000 0.0000 0.0000
|
||||||
|
Kd 0.5 0.2 0.2
|
||||||
|
Ks 0.0000 0.0000 0.0000
|
||||||
|
Ke 0.0000 0.0000 0.0000
|
||||||
|
|
||||||
|
newmtl test2
|
||||||
|
Ns 10.0000
|
||||||
|
Ni 1.5000
|
||||||
|
d 1.0000
|
||||||
|
Tr 0.0000
|
||||||
|
Tf 1.0000 1.0000 1.0000
|
||||||
|
illum 2
|
||||||
|
Ka 0.0000 0.0000 0.0000
|
||||||
|
Kd 0.2 0.5 0.2
|
||||||
|
Ks 0.0000 0.0000 0.0000
|
||||||
|
Ke 0.0000 0.0000 0.0000
|
||||||
51
models/issue-162-smoothing-group.obj
Normal file
51
models/issue-162-smoothing-group.obj
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
|
||||||
|
# cube.obj
|
||||||
|
#
|
||||||
|
|
||||||
|
mtllib issue-162-smoothing-group.mtl
|
||||||
|
|
||||||
|
v -0.500000 -0.500000 0.500000
|
||||||
|
v 0.500000 -0.500000 0.500000
|
||||||
|
v -0.500000 0.500000 0.500000
|
||||||
|
v 0.500000 0.500000 0.500000
|
||||||
|
v -0.500000 0.500000 -0.500000
|
||||||
|
v 0.500000 0.500000 -0.500000
|
||||||
|
v -0.500000 -0.500000 -0.500000
|
||||||
|
v 0.500000 -0.500000 -0.500000
|
||||||
|
|
||||||
|
vt 0.000000 0.000000
|
||||||
|
vt 1.000000 0.000000
|
||||||
|
vt 0.000000 1.000000
|
||||||
|
vt 1.000000 1.000000
|
||||||
|
|
||||||
|
vn 0.000000 0.000000 1.000000
|
||||||
|
vn 0.000000 1.000000 0.000000
|
||||||
|
vn 0.000000 0.000000 -1.000000
|
||||||
|
vn 0.000000 -1.000000 0.000000
|
||||||
|
vn 1.000000 0.000000 0.000000
|
||||||
|
vn -1.000000 0.000000 0.000000
|
||||||
|
|
||||||
|
usemtl test1
|
||||||
|
g test1
|
||||||
|
s 1
|
||||||
|
f 1/1/1 2/2/1 3/3/1
|
||||||
|
f 3/3/1 2/2/1 4/4/1
|
||||||
|
|
||||||
|
usemtl test2
|
||||||
|
g test2
|
||||||
|
|
||||||
|
s off
|
||||||
|
f 3/1/2 4/2/2 5/3/2
|
||||||
|
f 5/3/2 4/2/2 6/4/2
|
||||||
|
s 3
|
||||||
|
f 5/4/3 6/3/3 7/2/3
|
||||||
|
f 7/2/3 6/3/3 8/1/3
|
||||||
|
s 4
|
||||||
|
f 7/1/4 8/2/4 1/3/4
|
||||||
|
f 1/3/4 8/2/4 2/4/4
|
||||||
|
s 0
|
||||||
|
f 2/1/5 8/2/5 4/3/5
|
||||||
|
f 4/3/5 8/2/5 6/4/5
|
||||||
|
s 6
|
||||||
|
f 7/1/6 1/2/6 5/3/6
|
||||||
|
f 5/3/6 1/2/6 3/4/6
|
||||||
22
models/smoothing-group-two-squares.obj
Normal file
22
models/smoothing-group-two-squares.obj
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
# from tinyobjloader issue #29
|
||||||
|
|
||||||
|
v 0.000000 2.000000 0.000000
|
||||||
|
v 0.000000 0.000000 0.000000
|
||||||
|
v 2.000000 0.000000 0.000000
|
||||||
|
v 2.000000 2.000000 0.000000
|
||||||
|
v 4.000000 0.000000 -3.255298
|
||||||
|
v 4.000000 2.000000 -3.255298
|
||||||
|
#vn 0.000000 0.000000 1.000000
|
||||||
|
#vn 0.000000 0.000000 1.000000
|
||||||
|
#vn 0.276597 0.000000 0.960986
|
||||||
|
#vn 0.276597 0.000000 0.960986
|
||||||
|
#vn 0.531611 0.000000 0.846988
|
||||||
|
#vn 0.531611 0.000000 0.846988
|
||||||
|
# 6 vertices
|
||||||
|
|
||||||
|
# 6 normals
|
||||||
|
|
||||||
|
g all
|
||||||
|
s 1
|
||||||
|
f 1//1 2//2 3//3 4//4
|
||||||
|
f 4//4 3//3 5//5
|
||||||
24
models/smoothing-normal.mtl
Normal file
24
models/smoothing-normal.mtl
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
newmtl white
|
||||||
|
Ka 0 0 0
|
||||||
|
Kd 1 1 1
|
||||||
|
Ks 0 0 0
|
||||||
|
|
||||||
|
newmtl red
|
||||||
|
Ka 0 0 0
|
||||||
|
Kd 1 0 0
|
||||||
|
Ks 0 0 0
|
||||||
|
|
||||||
|
newmtl green
|
||||||
|
Ka 0 0 0
|
||||||
|
Kd 0 1 0
|
||||||
|
Ks 0 0 0
|
||||||
|
|
||||||
|
newmtl blue
|
||||||
|
Ka 0 0 0
|
||||||
|
Kd 0 0 1
|
||||||
|
Ks 0 0 0
|
||||||
|
|
||||||
|
newmtl light
|
||||||
|
Ka 20 20 20
|
||||||
|
Kd 1 1 1
|
||||||
|
Ks 0 0 0
|
||||||
35
models/smoothing-normal.obj
Normal file
35
models/smoothing-normal.obj
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
mtllib smoothing-normal.mtl
|
||||||
|
|
||||||
|
v 0.000000 2.000000 2.000000
|
||||||
|
v 0.000000 0.000000 2.000000
|
||||||
|
v 2.000000 0.000000 2.000000
|
||||||
|
v 2.000000 2.000000 2.000000
|
||||||
|
v 0.000000 2.000000 0.000000
|
||||||
|
v 0.000000 0.000000 0.000000
|
||||||
|
v 2.000000 0.000000 0.000000
|
||||||
|
v 2.000000 2.000000 0.000000
|
||||||
|
# 8 vertices
|
||||||
|
|
||||||
|
g front cube
|
||||||
|
usemtl white
|
||||||
|
s 1
|
||||||
|
f 1 2 3 4
|
||||||
|
#g bottom cube
|
||||||
|
#usemtl white
|
||||||
|
s 1
|
||||||
|
f 2 6 7 3
|
||||||
|
|
||||||
|
g back cube
|
||||||
|
# expects white material
|
||||||
|
s off
|
||||||
|
f 8 7 6 5
|
||||||
|
#g right cube
|
||||||
|
#usemtl red
|
||||||
|
#f 4 3 7 8
|
||||||
|
#g top cube
|
||||||
|
#usemtl white
|
||||||
|
#f 5 1 4 8
|
||||||
|
#g left cube
|
||||||
|
#usemtl green
|
||||||
|
#f 5 6 2 1
|
||||||
|
# 6 elements
|
||||||
17
tests/afl/README.txt
Normal file
17
tests/afl/README.txt
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
Command line used to find this crash:
|
||||||
|
|
||||||
|
afl-fuzz -i in -o out ./test_loader @@
|
||||||
|
|
||||||
|
If you can't reproduce a bug outside of afl-fuzz, be sure to set the same
|
||||||
|
memory limit. The limit used for this fuzzing session was 50.0 MB.
|
||||||
|
|
||||||
|
Need a tool to minimize test cases before investigating the crashes or sending
|
||||||
|
them to a vendor? Check out the afl-tmin that comes with the fuzzer!
|
||||||
|
|
||||||
|
Found any cool bugs in open-source tools using afl-fuzz? If yes, please drop
|
||||||
|
me a mail at <lcamtuf@coredump.cx> once the issues are fixed - I'd love to
|
||||||
|
add your finds to the gallery at:
|
||||||
|
|
||||||
|
http://lcamtuf.coredump.cx/afl/
|
||||||
|
|
||||||
|
Thanks :-)
|
||||||
BIN
tests/afl/id:000000,sig:11,src:000000,op:havoc,rep:128
Normal file
BIN
tests/afl/id:000000,sig:11,src:000000,op:havoc,rep:128
Normal file
Binary file not shown.
BIN
tests/afl/id:000001,sig:11,src:000000,op:havoc,rep:64
Normal file
BIN
tests/afl/id:000001,sig:11,src:000000,op:havoc,rep:64
Normal file
Binary file not shown.
33
tests/afl/id:000002,sig:11,src:000000,op:havoc,rep:4
Normal file
33
tests/afl/id:000002,sig:11,src:000000,op:havoc,rep:4
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
# cube.obj
|
||||||
|
#
|
||||||
|
|
||||||
|
} cube
|
||||||
|
|
||||||
|
v d.0 0.0 0.0
|
||||||
|
v 0.0 0.0 1.0
|
||||||
|
v 0.0 1.0 0.0
|
||||||
|
v 0.0 1.0 1.0
|
||||||
|
v 1.0 0.0 0.0
|
||||||
|
v 1.0 0.0 1.0
|
||||||
|
v 1.0 1.0 0.0
|
||||||
|
v 1.0 1.0 1.0
|
||||||
|
|
||||||
|
vn 0.0 0.0 1.0
|
||||||
|
vn 0.0 0.0 -1.0
|
||||||
|
vn 0.0 1.0 0.0
|
||||||
|
vn 0.0 -1.0 0.0
|
||||||
|
vn 1.0 0.0 0.0
|
||||||
|
vn -1.0 0.0 0.0
|
||||||
|
|
||||||
|
f 1//2 7//2 5//2
|
||||||
|
f 1//2 3//2 7//2
|
||||||
|
f 1/6 4//6 3//6
|
||||||
|
f 1//6 2//6 4//6
|
||||||
|
f 3//3 8//3 7//3
|
||||||
|
f 3//3 4//3 8//3
|
||||||
|
f 5//5 7//5 8//5
|
||||||
|
f 5//5 8//5 6//5
|
||||||
|
f 1//4 5//4 55555555555555 6//4
|
||||||
|
f 1//4 6//4 2//4
|
||||||
|
f 2//1 6//1 8//1
|
||||||
|
f 2//1 8//1 4//1
|
||||||
35
tests/afl/id:000003,sig:11,src:000000,op:havoc,rep:4
Normal file
35
tests/afl/id:000003,sig:11,src:000000,op:havoc,rep:4
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
# cube.obj
|
||||||
|
#
|
||||||
|
4
|
||||||
|
f 1//4 6//4 2//4
|
||||||
|
f
|
||||||
|
g cube
|
||||||
|
|
||||||
|
v 0.0 0.0
|
||||||
|
v 0.0 0.0 1.0
|
||||||
|
v 0.0 1.0 0.0
|
||||||
|
v 0.0 1.0 1.0
|
||||||
|
v 1.0 0.0 0.0
|
||||||
|
v 1.0 0.0 1.0
|
||||||
|
v 1.0 1.0 0.0
|
||||||
|
v 1.0 1.0 1.0
|
||||||
|
|
||||||
|
n 0.0 0.0 1.0
|
||||||
|
vn 0.0 0.0 -1.0
|
||||||
|
vn 0.0 1.0 0.0
|
||||||
|
vn 0.0 -1.0 0.0
|
||||||
|
vn 1.0 0.0 0.0
|
||||||
|
vn -1.0 0.0 0.0
|
||||||
|
|
||||||
|
f 1//2 7//2 5//2
|
||||||
|
f 1//2 3//2 7//2
|
||||||
|
f 1//6 4//6 3//6
|
||||||
|
f 1//6 2//6 4//6
|
||||||
|
f 3//3 8//3 7//3
|
||||||
|
f 3//3 4//3 8//3
|
||||||
|
f 5//5 7//5 //5
|
||||||
|
f 5//5 8//5 6//5
|
||||||
|
f 1//4 5//4 6//4
|
||||||
|
f 1//4 6//4 2//4
|
||||||
|
f 2//1 6//1 8//1
|
||||||
|
f 2//1 8//1 4//1
|
||||||
34
tests/afl/id:000004,sig:11,src:000000,op:havoc,rep:2
Normal file
34
tests/afl/id:000004,sig:11,src:000000,op:havoc,rep:2
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
# cube.ob7//3
|
||||||
|
f 3//3 4//3 8//3j
|
||||||
|
#
|
||||||
|
|
||||||
|
g cube
|
||||||
|
|
||||||
|
v 0.0 0.0 0.0
|
||||||
|
v 0.0 0.0 1.0
|
||||||
|
v 0.0 1˙0 0.0
|
||||||
|
v 0.0 1.0 1.0
|
||||||
|
v 1.0 0.0 0.0
|
||||||
|
v 1.0 0.0 1.0
|
||||||
|
v 1.0 1.0 0.0
|
||||||
|
v 1.0 1.0 1.0
|
||||||
|
|
||||||
|
vn 0.0 0.0 1.0
|
||||||
|
vn 0.0 0.0 -1.0
|
||||||
|
vn 0.0 1.0 0.0
|
||||||
|
vn 0.0 -1.0 0.0
|
||||||
|
vn 1.0 0.0 0.0
|
||||||
|
vn -1.0 0.0 0.0
|
||||||
|
|
||||||
|
f 1//2 7//2 5//2
|
||||||
|
f 1//2 3//2 7//2
|
||||||
|
f 1//6 4//6 3//6
|
||||||
|
f 1//6 2//6 4//6
|
||||||
|
f 3//3 8//3 7//3
|
||||||
|
f 3//3 4//3 8//3
|
||||||
|
f 5//5 7//5 8//5
|
||||||
|
f 5//5 8//5 6//5
|
||||||
|
f 1//4 5//4 6//4
|
||||||
|
f 1//4 6//4 2//4
|
||||||
|
f 2//1 6//1 8//1
|
||||||
|
f 2//1 8//1 4//1
|
||||||
BIN
tests/afl/id:000005,sig:11,src:000000,op:havoc,rep:4
Normal file
BIN
tests/afl/id:000005,sig:11,src:000000,op:havoc,rep:4
Normal file
Binary file not shown.
BIN
tests/afl/id:000006,sig:11,src:000000,op:havoc,rep:128
Normal file
BIN
tests/afl/id:000006,sig:11,src:000000,op:havoc,rep:128
Normal file
Binary file not shown.
BIN
tests/afl/id:000007,sig:11,src:000000,op:havoc,rep:32
Normal file
BIN
tests/afl/id:000007,sig:11,src:000000,op:havoc,rep:32
Normal file
Binary file not shown.
BIN
tests/afl/id:000008,sig:11,src:000000,op:havoc,rep:8
Normal file
BIN
tests/afl/id:000008,sig:11,src:000000,op:havoc,rep:8
Normal file
Binary file not shown.
BIN
tests/afl/id:000009,sig:11,src:000000,op:havoc,rep:128
Normal file
BIN
tests/afl/id:000009,sig:11,src:000000,op:havoc,rep:128
Normal file
Binary file not shown.
29
tests/afl/id:000010,sig:11,src:000000,op:havoc,rep:16
Normal file
29
tests/afl/id:000010,sig:11,src:000000,op:havoc,rep:16
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
# cube.obj
|
||||||
|
#
|
||||||
|
|
||||||
|
g
|
||||||
|
v 0.0 0.0 0.0
|
||||||
|
v 0.0 0.0 1,0
|
||||||
|
T 0.0 1.0 0.0
|
||||||
|
v 4.0 1c0 1.0
|
||||||
|
v 1.0 0.0 0.0
|
||||||
|
v 1.0 0.0 1.0
|
||||||
|
v 1.0 1.0 0.0
|
||||||
|
v 1.0 1.0 /////////////////////////////.0 0.0 -1.0
|
||||||
|
vn 0.0 1.0 0.0
|
||||||
|
v˙ 0.0 -1.0 0.0
|
||||||
|
vn 1.0 0.0 0.0
|
||||||
|
vn -1.0 0.0 0.0
|
||||||
|
|
||||||
|
f 1//2 7//2 5//2
|
||||||
|
f 1//2 3//2 7//2
|
||||||
|
f 1//6 4//6 3//6
|
||||||
|
f 1//6 2//6 4//6
|
||||||
|
f 3//3 8//3 7//3
|
||||||
|
f 3//3 4//3 8K/31
|
||||||
|
f/6 4//6 3//6
|
||||||
|
f 1//6 2 5//5 7//5 8//5
|
||||||
|
f 5//5 8//5 6//5"
|
||||||
|
f 1//4 5//4 2222222222224f 1//2 7//2 5 6//4 2//4
|
||||||
|
f 3//1 6//1 8//1
|
||||||
|
f 2//1 8//1 4//1
|
||||||
33
tests/afl/id:000011,sig:11,src:000000,op:havoc,rep:8
Normal file
33
tests/afl/id:000011,sig:11,src:000000,op:havoc,rep:8
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
# cube.obj
|
||||||
|
#
|
||||||
|
|
||||||
|
g cube
|
||||||
|
|
||||||
|
v 0.0 0.0 0.0
|
||||||
|
v 0.0 0.0 1.0
|
||||||
|
v 0.0 1.0 0.0
|
||||||
|
v 0.0 1.0 1.0
|
||||||
|
v 1.0 0.0 0.0
|
||||||
|
v 1.0 0.0 1.0
|
||||||
|
v 1.0 1.0 0.0
|
||||||
|
v 1.0 1.0 1.0
|
||||||
|
|
||||||
|
vn 0.0 0.0 1.0
|
||||||
|
vn 0<>0 0.0 -1.0
|
||||||
|
vn 0.0 1.0 00
|
||||||
|
vn 0.0 -Ę.0 0.0
|
||||||
|
vn 1. 0.0 0.0
|
||||||
|
vn -1.0 0.0 0.0
|
||||||
|
|
||||||
|
f 1//2 7//2 5//2
|
||||||
|
f 1//2 3//2 7//2
|
||||||
|
f 1//6 40000000000000000vvvvvvvvvvvvvvvv00000080000000//6 3//6
|
||||||
|
f 1//6 2//6 4//6
|
||||||
|
f 3//3 8//3 7//3
|
||||||
|
f 3//3 4//3 8//3
|
||||||
|
f 5//5 7//5 8//5
|
||||||
|
f 5//5 8//5 6//5
|
||||||
|
f 1//4 56//4
|
||||||
|
f 1//4 6//4 2//4
|
||||||
|
f 2//1 6//1 8//1
|
||||||
|
f 2//1 8//1 4//1
|
||||||
BIN
tests/afl/id:000012,sig:06,src:000000,op:havoc,rep:32
Normal file
BIN
tests/afl/id:000012,sig:06,src:000000,op:havoc,rep:32
Normal file
Binary file not shown.
32
tests/afl/id:000013,sig:11,src:000093,op:havoc,rep:4
Normal file
32
tests/afl/id:000013,sig:11,src:000093,op:havoc,rep:4
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
# cube.obj
|
||||||
|
#
|
||||||
|
|
||||||
|
g cube
|
||||||
|
|
||||||
|
v 0.0 0.0 0.0
|
||||||
|
v 0.0 0.0 1.0
|
||||||
|
v 0.0 1.0 0.0
|
||||||
|
v 0.0 1.0 1.0
|
||||||
|
v 1.0 0.0 0.0
|
||||||
|
v 1.0 0.0 1.0
|
||||||
|
v 1.0 1.0 0.0
|
||||||
|
v 1.0 1.0 1.0
|
||||||
|
|
||||||
|
vn 0.0 0.0 1.0
|
||||||
|
vn 0.0 0.0 -1.0
|
||||||
|
vn 0.0 1.0 0.0
|
||||||
|
vn 0.0 -1.0 0.0
|
||||||
|
vn 1.0 0.0 0.
|
||||||
|
vn -1.0 0.0 0.0
|
||||||
|
|
||||||
|
f 1//2 7//2 5//2
|
||||||
|
f 1//2 3//2 7//2
|
||||||
|
f 1//6 4//6 3//6
|
||||||
|
f 1//6 2//6 4//6
|
||||||
|
f 3//3 8//3 7//3
|
||||||
|
f 3//3 4//3 08//3
|
||||||
|
f 5//5 7//5 8//5!Šf 5//5 8//5 6//5
|
||||||
|
f 1//4 5//4 65555//4
|
||||||
|
f 1//4 6//4 2//4
|
||||||
|
f 2//1 6//1 8//1
|
||||||
|
f 2//1 8//1 4//1
|
||||||
BIN
tests/afl/id:000014,sig:11,src:000093,op:havoc,rep:64
Normal file
BIN
tests/afl/id:000014,sig:11,src:000093,op:havoc,rep:64
Normal file
Binary file not shown.
33
tests/afl/id:000015,sig:11,src:000093,op:havoc,rep:2
Normal file
33
tests/afl/id:000015,sig:11,src:000093,op:havoc,rep:2
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
# cube.7//3
|
||||||
|
f 3//3 4//3 8//3
|
||||||
|
obj
|
||||||
|
#
|
||||||
|
|
||||||
|
g cube
|
||||||
|
|
||||||
|
v 0.0 0.0 0.0
|
||||||
|
v 0.0 0.0 1.0
|
||||||
|
v .0 1.0
|
||||||
|
v 1.0 0.0 0.0
|
||||||
|
v 1.0 0.0 1.0
|
||||||
|
v 1.0 1.0 0.0
|
||||||
|
v 1.0 1.0 1.0
|
||||||
|
|
||||||
|
vn 0.0 0.0 1.0
|
||||||
|
vn 0.0 0.0 -1.0
|
||||||
|
vn 0.0 1.0 0.0
|
||||||
|
vn 0.0 -1.0 0.0
|
||||||
|
vn 1.0 0.0 0.0
|
||||||
|
vn -1.0 0.0 0.0
|
||||||
|
|
||||||
|
f 1//2 7//2 5//2
|
||||||
|
f 1//2 3//2 7//2
|
||||||
|
f 1//6 4//6 3//6
|
||||||
|
f 1//6 2//6 4//6
|
||||||
|
f 3//3 8//3 7//3
|
||||||
|
f 3//3 4//3 8//3
|
||||||
|
f 5//5 7//5 8//5!Šf 5//5 8//5 6//5
|
||||||
|
f 1//4 5//4 6//4
|
||||||
|
f 1//4 6//4 2//4
|
||||||
|
f 2//1 6//1 8//1
|
||||||
|
f 2//1 8//1 4//1
|
||||||
BIN
tests/afl/id:000016,sig:11,src:000093,op:havoc,rep:8
Normal file
BIN
tests/afl/id:000016,sig:11,src:000093,op:havoc,rep:8
Normal file
Binary file not shown.
30
tests/afl/id:000017,sig:11,src:000093,op:havoc,rep:4
Normal file
30
tests/afl/id:000017,sig:11,src:000093,op:havoc,rep:4
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
# cube.obj
|
||||||
|
#
|
||||||
|
|
||||||
|
g cuvP 0.0 0.0 .0
|
||||||
|
v 0.0 0.0 1.0
|
||||||
|
v 0.0 1.0 0.0
|
||||||
|
v 0.0 1.0 1.0
|
||||||
|
v 1.0 0.0 0.0
|
||||||
|
v 1.0 0.0 1.0
|
||||||
|
v 1.0 1.0 0.0
|
||||||
|
v 1.0 1.0 1.0
|
||||||
|
|
||||||
|
vn 0.0 0.0 1.0
|
||||||
|
vn 0.0 0.0 -1.0
|
||||||
|
vn 0.0 1.0 0.0
|
||||||
|
vn 0.0 -1.0 0.0
|
||||||
|
vn 1.0 0.0 0.0
|
||||||
|
vn -1.0 0.0 0.0
|
||||||
|
|
||||||
|
f 1//2 7//2 5//2
|
||||||
|
f 1//2 3//2 7//2
|
||||||
|
f 1//6 4//6 3//6
|
||||||
|
f 1//6 2//6 4//6
|
||||||
|
f 3//3 8//3 7//3
|
||||||
|
f 3//3 4//3 8//3
|
||||||
|
f 5//5 7//5 8//5!Šf 5//5 8//5 6//5
|
||||||
|
f 1//4 5//4 6//4
|
||||||
|
f 1//4 6666666666666666//4 2//4
|
||||||
|
f 2//1 6//1 8//1
|
||||||
|
f 2//1 8//1 4//1
|
||||||
33
tests/afl/id:000018,sig:06,src:000141,op:flip1,pos:449
Normal file
33
tests/afl/id:000018,sig:06,src:000141,op:flip1,pos:449
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
# cube.obj
|
||||||
|
#
|
||||||
|
|
||||||
|
g cube
|
||||||
|
|
||||||
|
v 0.0 0.0 0.0
|
||||||
|
v 0.0 0.0 1.0
|
||||||
|
v 0.0 1.0 0.0
|
||||||
|
v 0.0 1.0 1.0
|
||||||
|
v 1.0 0.0 0.0
|
||||||
|
v 1.0 0.0 1.0
|
||||||
|
v 1.0 1.0 0.0
|
||||||
|
v 1.0 1.0 1.0
|
||||||
|
|
||||||
|
vn 0.0 0.0 1.0
|
||||||
|
vn 0.0 0.0 -1.0
|
||||||
|
vn 0.0 1.0 0.0
|
||||||
|
vn 0.0 -1.0 0.0
|
||||||
|
vn 1.0 0.0 0.0
|
||||||
|
vn -1.0 0.0 0.0
|
||||||
|
|
||||||
|
f 1//2 7//2 5//2
|
||||||
|
f 1//2 3//2 7//2
|
||||||
|
f 1//6 4//6 3//6
|
||||||
|
f 1//6 2//6 4//6
|
||||||
|
f 3//3 8//3 7//3
|
||||||
|
f 3//3 4//3 8//3
|
||||||
|
f 5//5 7//5 8//5
|
||||||
|
f 5//5 8//5 6//5
|
||||||
|
t 1//4 5/-4 6//4
|
||||||
|
f 1//4 6//4 2//4
|
||||||
|
f 2//1 6//1 8//1
|
||||||
|
f 2//1 8//1 4//1
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
# cube.obj
|
||||||
|
#
|
||||||
|
|
||||||
|
g cube
|
||||||
|
|
||||||
|
v 0.0 0.0 0.0
|
||||||
|
v 0.0 0.0 1.0
|
||||||
|
v 0.0 1.0 0.0
|
||||||
|
v 0.0 1.0 1.0
|
||||||
|
v 1.0 0.0 0.0
|
||||||
|
v 1.0 0.0 1.0
|
||||||
|
v 1.0 1.0 0.0
|
||||||
|
v 1.0 1.0 1.0
|
||||||
|
|
||||||
|
vn 0.0 0.0 1.0
|
||||||
|
vn 0.0 0.0 -1.0
|
||||||
|
vn 0.0 1.0 0.0
|
||||||
|
vn 0.0 -1.0 0.0
|
||||||
|
vn 1.0 0.0 0.0
|
||||||
|
vn -1.0 0.0 0.0
|
||||||
|
|
||||||
|
f 1//2 7//2 5//2
|
||||||
|
f 1//2 3//2 7//2
|
||||||
|
f 1//6 4//6 3//6
|
||||||
|
f 1//6 2//6 4//6
|
||||||
|
f 3//3 8//3 7//3
|
||||||
|
f 3//3 4//3 8//3
|
||||||
|
f 5//5 7//5 8//5
|
||||||
|
f 5//5 8//5 6//5
|
||||||
|
t 1//4 -5//4 6//4
|
||||||
|
f 1//4 6//4 2//4
|
||||||
|
f 2//1 6//1 8//1
|
||||||
|
f 2//1 8//1 4//1
|
||||||
BIN
tests/afl/id:000020,sig:06,src:000141,op:havoc,rep:128
Normal file
BIN
tests/afl/id:000020,sig:06,src:000141,op:havoc,rep:128
Normal file
Binary file not shown.
35
tests/afl/id:000021,sig:06,src:000141,op:havoc,rep:4
Normal file
35
tests/afl/id:000021,sig:06,src:000141,op:havoc,rep:4
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
# cube.obj
|
||||||
|
#
|
||||||
|
|
||||||
|
g cube
|
||||||
|
|
||||||
|
v 0.0 0.0 0.0
|
||||||
|
v 0.0 0.0 1.0
|
||||||
|
v 0.0 1.0 0.0
|
||||||
|
v 0.0 1.0 1.0
|
||||||
|
v 1.0 0.0 0.0
|
||||||
|
v 1.0 0.0 1.0
|
||||||
|
v 1.0 1.0 0.0
|
||||||
|
v 1.0 1.0 1.0
|
||||||
|
|
||||||
|
vn 0.0 0.0 !.0
|
||||||
|
vn 0.0 0.0 -1.0
|
||||||
|
vn 0.0 1.0 0.0
|
||||||
|
vn 0.0 8//5 6//5
|
||||||
|
t 1//4 -1.0 0.0
|
||||||
|
vn 1.0 0.0 0.0
|
||||||
|
f 3//3 8//3 7//3
|
||||||
|
f 3//3
|
||||||
|
vn -1.0 0.0 0.0
|
||||||
|
|
||||||
|
f 1//2 7//2 5//2
|
||||||
|
f 1//2 3//2 7//2
|
||||||
|
f 1//6 4//6 3//6
|
||||||
|
f 1//6 2//6 4//6
|
||||||
|
f 3//3 8//3 7//3
|
||||||
|
f 3//3 4//3 8//3
|
||||||
|
f 5//5 7//5 8//5
|
||||||
|
f 5//5 8//5 6//5
|
||||||
|
t 1//4 5//4 6//4
|
||||||
|
f 1//4 6//4 2//4 f 2//1 6//1 8//1
|
||||||
|
f 2//1 8//1 4//1
|
||||||
BIN
tests/afl/id:000022,sig:11,src:000141,op:havoc,rep:128
Normal file
BIN
tests/afl/id:000022,sig:11,src:000141,op:havoc,rep:128
Normal file
Binary file not shown.
BIN
tests/afl/id:000023,sig:11,src:000141,op:havoc,rep:128
Normal file
BIN
tests/afl/id:000023,sig:11,src:000141,op:havoc,rep:128
Normal file
Binary file not shown.
BIN
tests/afl/id:000024,sig:11,src:000141,op:havoc,rep:128
Normal file
BIN
tests/afl/id:000024,sig:11,src:000141,op:havoc,rep:128
Normal file
Binary file not shown.
32
tests/afl/id:000025,sig:11,src:000141,op:havoc,rep:4
Normal file
32
tests/afl/id:000025,sig:11,src:000141,op:havoc,rep:4
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
# cube.obj
|
||||||
|
#
|
||||||
|
|
||||||
|
g cube
|
||||||
|
|
||||||
|
v 0.0 0.0 0.0
|
||||||
|
v 0.0 0.0 1.0
|
||||||
|
v 0.0 1.0 0.0
|
||||||
|
v 0.0 1.0 1.0
|
||||||
|
v Ď1.0 0.0 0.0
|
||||||
|
v 1.0 0.0 1.0
|
||||||
|
v 1.0 1.0 0.0
|
||||||
|
v 1.0 1.0 1.0
|
||||||
|
|
||||||
|
vn 0.0 0.0 1.0
|
||||||
|
vn 0.0 0.0 -1.0
|
||||||
|
vn 0.0 1.0
|
||||||
|
vn 1.0 0.0 0.0
|
||||||
|
vn -1.0 0.0 0.0
|
||||||
|
|
||||||
|
f 1//2 7//2 5//2
|
||||||
|
f 1//2 3//2 7//2
|
||||||
|
f 1//6 4//6 3//6
|
||||||
|
f 1//6 2//6 4//6
|
||||||
|
f 3//3 8//3 7//3
|
||||||
|
f 3//3 4//3 811111//3
|
||||||
|
f 5//5 7//5 8//5
|
||||||
|
f 5//5 8//5 6//5
|
||||||
|
t 1//4 5//4 6//4
|
||||||
|
f 1//4 6//4 2//4
|
||||||
|
f 2B/1 6//1 8//1
|
||||||
|
f 2//1 8//1 4//1
|
||||||
BIN
tests/afl/id:000026,sig:11,src:000141,op:havoc,rep:128
Normal file
BIN
tests/afl/id:000026,sig:11,src:000141,op:havoc,rep:128
Normal file
Binary file not shown.
BIN
tests/afl/id:000027,sig:11,src:000141,op:havoc,rep:128
Normal file
BIN
tests/afl/id:000027,sig:11,src:000141,op:havoc,rep:128
Normal file
Binary file not shown.
BIN
tests/afl/id:000028,sig:06,src:000253,op:havoc,rep:32
Normal file
BIN
tests/afl/id:000028,sig:06,src:000253,op:havoc,rep:32
Normal file
Binary file not shown.
BIN
tests/afl/id:000029,sig:11,src:000263,op:havoc,rep:64
Normal file
BIN
tests/afl/id:000029,sig:11,src:000263,op:havoc,rep:64
Normal file
Binary file not shown.
BIN
tests/afl/id:000030,sig:11,src:000263,op:havoc,rep:64
Normal file
BIN
tests/afl/id:000030,sig:11,src:000263,op:havoc,rep:64
Normal file
Binary file not shown.
BIN
tests/afl/id:000031,sig:11,src:000263,op:havoc,rep:32
Normal file
BIN
tests/afl/id:000031,sig:11,src:000263,op:havoc,rep:32
Normal file
Binary file not shown.
BIN
tests/afl/id:000032,sig:11,src:000263,op:havoc,rep:32
Normal file
BIN
tests/afl/id:000032,sig:11,src:000263,op:havoc,rep:32
Normal file
Binary file not shown.
BIN
tests/afl/id:000033,sig:06,src:000266,op:havoc,rep:32
Normal file
BIN
tests/afl/id:000033,sig:06,src:000266,op:havoc,rep:32
Normal file
Binary file not shown.
BIN
tests/afl/id:000034,sig:06,src:000266,op:havoc,rep:32
Normal file
BIN
tests/afl/id:000034,sig:06,src:000266,op:havoc,rep:32
Normal file
Binary file not shown.
BIN
tests/afl/id:000035,sig:11,src:000271,op:havoc,rep:16
Normal file
BIN
tests/afl/id:000035,sig:11,src:000271,op:havoc,rep:16
Normal file
Binary file not shown.
BIN
tests/afl/id:000036,sig:11,src:000271,op:havoc,rep:32
Normal file
BIN
tests/afl/id:000036,sig:11,src:000271,op:havoc,rep:32
Normal file
Binary file not shown.
BIN
tests/afl/id:000037,sig:11,src:000271,op:havoc,rep:8
Normal file
BIN
tests/afl/id:000037,sig:11,src:000271,op:havoc,rep:8
Normal file
Binary file not shown.
BIN
tests/afl/id:000038,sig:11,src:000271,op:havoc,rep:32
Normal file
BIN
tests/afl/id:000038,sig:11,src:000271,op:havoc,rep:32
Normal file
Binary file not shown.
BIN
tests/afl/id:000039,sig:11,src:000271,op:havoc,rep:8
Normal file
BIN
tests/afl/id:000039,sig:11,src:000271,op:havoc,rep:8
Normal file
Binary file not shown.
BIN
tests/afl/id:000040,sig:11,src:000271,op:havoc,rep:64
Normal file
BIN
tests/afl/id:000040,sig:11,src:000271,op:havoc,rep:64
Normal file
Binary file not shown.
BIN
tests/afl/id:000041,sig:11,src:000271,op:havoc,rep:32
Normal file
BIN
tests/afl/id:000041,sig:11,src:000271,op:havoc,rep:32
Normal file
Binary file not shown.
BIN
tests/afl/id:000042,sig:11,src:000271,op:havoc,rep:16
Normal file
BIN
tests/afl/id:000042,sig:11,src:000271,op:havoc,rep:16
Normal file
Binary file not shown.
BIN
tests/afl/id:000043,sig:11,src:000308,op:havoc,rep:32
Normal file
BIN
tests/afl/id:000043,sig:11,src:000308,op:havoc,rep:32
Normal file
Binary file not shown.
BIN
tests/afl/id:000044,sig:11,src:000308,op:havoc,rep:16
Normal file
BIN
tests/afl/id:000044,sig:11,src:000308,op:havoc,rep:16
Normal file
Binary file not shown.
BIN
tests/afl/id:000045,sig:06,src:000352,op:flip1,pos:334
Normal file
BIN
tests/afl/id:000045,sig:06,src:000352,op:flip1,pos:334
Normal file
Binary file not shown.
BIN
tests/afl/id:000046,sig:11,src:000352,op:flip2,pos:299
Normal file
BIN
tests/afl/id:000046,sig:11,src:000352,op:flip2,pos:299
Normal file
Binary file not shown.
BIN
tests/afl/id:000047,sig:06,src:000352,op:havoc,rep:16
Normal file
BIN
tests/afl/id:000047,sig:06,src:000352,op:havoc,rep:16
Normal file
Binary file not shown.
BIN
tests/afl/id:000048,sig:11,src:000352,op:havoc,rep:4
Normal file
BIN
tests/afl/id:000048,sig:11,src:000352,op:havoc,rep:4
Normal file
Binary file not shown.
BIN
tests/afl/id:000049,sig:11,src:000352,op:havoc,rep:16
Normal file
BIN
tests/afl/id:000049,sig:11,src:000352,op:havoc,rep:16
Normal file
Binary file not shown.
BIN
tests/afl/id:000050,sig:11,src:000352,op:havoc,rep:8
Normal file
BIN
tests/afl/id:000050,sig:11,src:000352,op:havoc,rep:8
Normal file
Binary file not shown.
BIN
tests/afl/id:000051,sig:11,src:000352,op:havoc,rep:64
Normal file
BIN
tests/afl/id:000051,sig:11,src:000352,op:havoc,rep:64
Normal file
Binary file not shown.
BIN
tests/afl/id:000052,sig:11,src:000352,op:havoc,rep:16
Normal file
BIN
tests/afl/id:000052,sig:11,src:000352,op:havoc,rep:16
Normal file
Binary file not shown.
BIN
tests/afl/id:000053,sig:11,src:000352,op:havoc,rep:16
Normal file
BIN
tests/afl/id:000053,sig:11,src:000352,op:havoc,rep:16
Normal file
Binary file not shown.
BIN
tests/afl/id:000054,sig:06,src:000352,op:havoc,rep:64
Normal file
BIN
tests/afl/id:000054,sig:06,src:000352,op:havoc,rep:64
Normal file
Binary file not shown.
BIN
tests/afl/id:000055,sig:11,src:000352,op:havoc,rep:32
Normal file
BIN
tests/afl/id:000055,sig:11,src:000352,op:havoc,rep:32
Normal file
Binary file not shown.
BIN
tests/afl/id:000056,sig:06,src:000352,op:havoc,rep:64
Normal file
BIN
tests/afl/id:000056,sig:06,src:000352,op:havoc,rep:64
Normal file
Binary file not shown.
BIN
tests/afl/id:000057,sig:11,src:000382,op:havoc,rep:32
Normal file
BIN
tests/afl/id:000057,sig:11,src:000382,op:havoc,rep:32
Normal file
Binary file not shown.
BIN
tests/afl/id:000058,sig:11,src:000382,op:havoc,rep:32
Normal file
BIN
tests/afl/id:000058,sig:11,src:000382,op:havoc,rep:32
Normal file
Binary file not shown.
BIN
tests/afl/id:000059,sig:06,src:000406,op:havoc,rep:8
Normal file
BIN
tests/afl/id:000059,sig:06,src:000406,op:havoc,rep:8
Normal file
Binary file not shown.
BIN
tests/afl/id:000060,sig:11,src:000408,op:havoc,rep:32
Normal file
BIN
tests/afl/id:000060,sig:11,src:000408,op:havoc,rep:32
Normal file
Binary file not shown.
BIN
tests/afl/id:000061,sig:11,src:000449,op:havoc,rep:64
Normal file
BIN
tests/afl/id:000061,sig:11,src:000449,op:havoc,rep:64
Normal file
Binary file not shown.
BIN
tests/afl/id:000062,sig:06,src:000465,op:havoc,rep:16
Normal file
BIN
tests/afl/id:000062,sig:06,src:000465,op:havoc,rep:16
Normal file
Binary file not shown.
BIN
tests/afl/id:000063,sig:06,src:000465,op:havoc,rep:64
Normal file
BIN
tests/afl/id:000063,sig:06,src:000465,op:havoc,rep:64
Normal file
Binary file not shown.
BIN
tests/afl/id:000064,sig:06,src:000478,op:havoc,rep:64
Normal file
BIN
tests/afl/id:000064,sig:06,src:000478,op:havoc,rep:64
Normal file
Binary file not shown.
BIN
tests/afl/id:000065,sig:06,src:000478,op:havoc,rep:32
Normal file
BIN
tests/afl/id:000065,sig:06,src:000478,op:havoc,rep:32
Normal file
Binary file not shown.
BIN
tests/afl/id:000066,sig:11,src:000515,op:havoc,rep:4
Normal file
BIN
tests/afl/id:000066,sig:11,src:000515,op:havoc,rep:4
Normal file
Binary file not shown.
BIN
tests/afl/id:000067,sig:11,src:000518,op:havoc,rep:8
Normal file
BIN
tests/afl/id:000067,sig:11,src:000518,op:havoc,rep:8
Normal file
Binary file not shown.
BIN
tests/afl/id:000068,sig:06,src:000532,op:havoc,rep:8
Normal file
BIN
tests/afl/id:000068,sig:06,src:000532,op:havoc,rep:8
Normal file
Binary file not shown.
BIN
tests/afl/id:000069,sig:06,src:000532,op:havoc,rep:64
Normal file
BIN
tests/afl/id:000069,sig:06,src:000532,op:havoc,rep:64
Normal file
Binary file not shown.
BIN
tests/afl/id:000070,sig:06,src:000557,op:havoc,rep:16
Normal file
BIN
tests/afl/id:000070,sig:06,src:000557,op:havoc,rep:16
Normal file
Binary file not shown.
BIN
tests/afl/id:000071,sig:11,src:000570,op:havoc,rep:32
Normal file
BIN
tests/afl/id:000071,sig:11,src:000570,op:havoc,rep:32
Normal file
Binary file not shown.
BIN
tests/afl/id:000072,sig:06,src:000584,op:havoc,rep:16
Normal file
BIN
tests/afl/id:000072,sig:06,src:000584,op:havoc,rep:16
Normal file
Binary file not shown.
BIN
tests/afl/id:000073,sig:06,src:000584,op:havoc,rep:32
Normal file
BIN
tests/afl/id:000073,sig:06,src:000584,op:havoc,rep:32
Normal file
Binary file not shown.
BIN
tests/afl/id:000074,sig:06,src:000584,op:havoc,rep:32
Normal file
BIN
tests/afl/id:000074,sig:06,src:000584,op:havoc,rep:32
Normal file
Binary file not shown.
BIN
tests/afl/id:000075,sig:06,src:000584,op:havoc,rep:2
Normal file
BIN
tests/afl/id:000075,sig:06,src:000584,op:havoc,rep:2
Normal file
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user