User:Carlosadc/Collada

From K-3D

Jump to: navigation, search

COLLADA reading and importing

I decided to to a wiki page about collada reading and importing because this is probably the most important addition to the import/export read/write plug-in set and special care should be taken. This is because collada is a very robust and extended file format which handles almost everything you may want to store from a 3D file. For this matter, collada is also a very big file format, and not it's usually not fully supported by every other software. Having this in mind, I created the next list of fundamental things needed for every importer/exporter (taken from collada specification [1]).

Requirements (for both importing and mesh reading)

Hierarchy and Transformations

  • Translation
  • Scaling
  • Rotation
  • Skewing
  • Static object instantiation: Instances of static objects. Such an object can have multiple transforms
  • Texture-mapping method: A texture-mapping method (cylindrical, spherical, etc.)
    • Does this exist on K-3D?
  • Transform with no geometry: It must be possible to transform something with no geometry (e.g., locator, NULL)
    • Importer?

Vertex Attributes

  • Vertex texture coordinates: An arbitrary number of Texture Coordinates per vertex
  • Vertex UV coordinates: (distinct from texture coordinates)
    • What's the difference?
  • Next code iteration of the reader?
    • Vertex binormals
    • Vertex normals
    • Vertex tangents
    • Vertex colors
    • Custom vertex attributes

Requirements (just for importer/exporter)

Hierarchy and Transformations

  • Parenting
  • Animated object instantiation: Instances of animated objects. Such an object can have multiple transforms
  • Transparency / reflectivity: Additional material parameters for transparency and reflectivity

Materials and Textures

  • RGB textures
  • RGBA textures
  • Baked Procedural Texture Coordinates
  • Common profile material: (PHONG, LAMBERT, etc.)
  • Per-face material

Animation

  • Complex theme and I probably work this at last because as the specification says, quote "Animations are usually represented in an application by the use of sparse key frames and complex controls and constraints. These are combined by the application when the animation is played, providing final output. When parsing animation data, it is possible that an application will not be able to implement the full set of constraints or controllers used by the tool that exported the data, and thus the resulting animation will not be preserved. Therefore, it is necessary to provide an option to export fully resolved transformation data at regularly defined intervals."

Scene Data

  • Empty nodes
  • Cameras
  • Spotlights
  • Directional lights
  • Point lights
  • Ambient lights

Special Notes

For the importer: It must be possible to import all conforming COLLADA data, even if some data is not understood by the tool, and retained for later export. The <asset> element will be used by external tools to recognize that some exported data may require synchronization.

Progress

Finally I was able to setup models with texture coordinates, here is a screenshot: Image:textured.png

Links