SimpleCOLLADA v0.1.1 (C++)
Users browsing this thread: 1 Guest(s)

The COLLADA model format allows for much more flexibility over the .obj format. This includes vertex colors and animations, which can't currently be imported easily using our current tools. While this parser cannot do animations yet, it can read vertex colors.

SimpleCOLLADA v0.1.1 parses:
  • Vertices
  • Triangle indices
  • Texture coordinates
  • Normals
  • Vertex colors
  • Material data (file path for textures, diffuse color, and transparency)
and puts this data into a single object for easy access, then importing tools can use this data to build the models and put it into the ROM file. You can find out more on how to use this code over on the Github page.

​Github: https://github.com/DavidSM64/SimpleCOLLADA

[Image: PiS3jap.png][Image: k1EE06S.png]
Example of vertex colors created in blender

Wow! This is just what custom levels need to look amazing!

Is there vertex colour editing or COLLADA files in Sketchup?
Because Sketchup supports COLLADA files.
If not, could you show me how COLLADA files work with
vertex colours so I can try and make a plugin. Cool

COLLADA files have vertex colors but unfortunately Sketchup doesn't, so if you want to vertex color your model, you have to export it to COLLADA and import it into Blender, and do what you have to do.
Gone for a while.

How does this work anyways? I get that it will parse a DAE file into F3D but how do you actually execute it, a bit vague but do you make a cpp file with

Spoiler :
#include "SimpleCOLLADA/SimpleCOLLADA.hpp"

/* Somewhere in your code... */
SimpleCOLLADA::Model model("test.dae"); // Create a new model object from a filepath

if (model.modelNodes.size() > 0) {
std::cout << "up_axis = " << (model.upAxis == SimpleCOLLADA::Z_UP ? "Z_AXIS" : (model.upAxis == SimpleCOLLADA::Y_UP ? "Y_AXIS" : "X_AXIS")) << std::endl;
std::cout << "# of Model Nodes: " << model.modelNodes.size() << std::endl;
for (size_t i = 0; i < model.modelNodes.size(); i++) {
std::cout << "----- Model Node " << i << " -----" << std::endl;
std::cout << "# of Vertices: " << model.modelNodes[i]->getNumOfVertices() << std::endl;
std::cout << "# of TexCoords: " << model.modelNodes[i]->getNumOfTexCoords() << std::endl;
std::cout << "# of Normals: " << model.modelNodes[i]->getNumOfNormals() << std::endl;
std::cout << "# of Triangles: " << model.modelNodes[i]->getNumOfTriangles() << std::endl;
std::cout << "# VertexColorGroups: " << model.modelNodes[i]->getNumOfVertexColorGroups() << std::endl;
vector names = model.modelNodes[i]->getVertexColorGroupNames();
for (size_t j = 0; j < model.modelNodes[i]->getNumOfVertexColorGroups(); j++) {
std::cout << "# VertexColors(" << names[j] << "): " << model.modelNodes[i]->getNumOfVertexColors(names[j]) << std::endl;
}
std::cout << "Material pointer: " << model.modelNodes[i]->getMaterial() << std::endl;
}
std::cout << "------------------------" << std::endl;
std::cout << "# of Materials: " << model.materials.size() << std::endl;
for (size_t i = 0; i < model.materials.size(); i++) {
std::cout << "--- Material " << i << " (" << model.materials[i] << ") ---" << std::endl;
std::cout << "Name: " << model.materials[i]->getName() << std::endl;
std::cout << "Tex filename: " << model.materials[i]->getFileName() << std::endl;
std::cout << "Diffuse Color: 0x" << std::hex << model.materials[i]->getColor() << std::dec << std::endl;
std::cout << "Opacity: " << (model.materials[i]->getTransparency()*100.0f) << "%" << std::endl;
}
std::cout << "------------------------" << std::endl;
}
and compile it? because that doesn't work
Gone for a while.

If it is right, from looking at the code, this only should parse a dae file into a SimpleCOLLADA model object. You would have to write the F3D part yourself.

SimpleCOLLADA v0.1.1 (C++)
Users browsing this thread: 1 Guest(s)