Collada Importer

From FreeSpace Wiki
Revision as of 09:58, 24 July 2008 by Spicious (talk | contribs) (Turret Firepoints)
Jump to: navigation, search

This is the WIP page to document the design and implemenation of a Collada to POF model converter. This article was created in response to Cash prize for Collada - POF support!

Background

The goal of this project is to create a stable import system with which to convert the open-standard Collada (DAE) XML-based model format to the Freespace POF binary model format. Many other export options exist, but each has its flaws and none seem to work flawlessly. Using a cross-application format such as Collada and a community-developed converter should help address many of the existing issues. The conversion application PCS2 already has COB->PMF, PMF->POF, and the reverse of both. We have access to the specifications for POF through Volition's documentation but the format is difficult to work with directly. We have access to the PMF specification through the source code to PCS2, but better documentation (in a more human-readable format) for this could be useful. However, PMF is designed to be an easily-accessed format to be used in between other formats and the PMF->POF conversion routines in PCS2. Currently the plan is (barring serious objection by the community) to create a library of routines to convert a DAE file to a PMF file. This library could then be utilized in PCS2 using its existing PMF->POF support, or that functionality could be utilized in another standalone converter. With that in mind, the following are the requirements and specifications a converter and the models must adhere to. As for working with the Collada format, one such possibility is the FCollada library, a free set of routines to interface with Collada.

DAE File Prerequisites

The conventions for a DAE file will be similar to those for Styxx's POF Conversion plugin for 3D Studio Max. All major modelings apps should be able to understand a model that follows these conventions.

Treat everything as case sensitive. All numerical sequences to be interpreted by the converter must be contiguous and begin with 01 unless otherwise specified. Also unless otherwise specified, all nodes should be top level.

Helpers with numbers in the form XX-YY typically refer to the YYth item in the XXth grouping. E.g. engine01-02 would be the second glow of the first thruster. For appropriate helper generated fields the centre is determined by translation field, the radius is determined by the X scaling and the normal is determined by the rotation fields.

This list is in progress and is subject to change. Suggestions should be made in Cash prize for Collada - POF support!

LODs

detailX, where X ranges up from 0.

Debris

debrisXX

Shield

shield

The shield mesh should be triangulated.

Subsystems

subsystem<subsystem name>, no <>.

Engine Glows

engineXX-YY

Dockpoints

dockpointXX-YY

Gun banks

gunbankXX-YY

Missile banks

missilebankXX-YY

Turret Firepoints

<turret subobject name>-YY

Eyepoints

eyepointXX

Subobjects

Subobjects should be set as children of their desired parent object. Turrets will be identified if their names begin with turret. Multipart turrets should be named turretxx-base and turretxx-arm for the base and barrels respectively.

Converter Requirements

Must output a PMF compliant with the structure utilized by the PMF importer of PCS2.

External Links

Cash prize for Collada - POF support!

COLLADA Specification

FCollada Home Page

PCS2 CVS Repository - For COB->PMF reference, only PMF format docs

COLLADA Test Model Bank

POF Constructor Suite 2

Styxx's POF Conversion plugin for 3D Studio Max - The basis for the DAE model conventions