3ds2sol

By Jose Parrot

 

Windows 1.0 (October,23,2008)                                                                                     

                                                                                               

A 3ds model converter to dat format, to use with SOL3d.

 

 

Contents

 

Introduction

Features

3ds conversion to dat

 

 

Introduction

This package was developed to be used together with sol3d package.

It reads a 3ds file, converts the chunks with vertex and triangle mesh data to dat format, appropriate to open with sol3d.

The package is developed in MS Visual C++ 2005 and mixes managed C++ and pure C/C++.

 

Features

·         Full windows xp interface

·         Reads 3ds files

·         Optional scalling to fit better in sol3d environment

·         Optional displacement to centralize or move the objects

·         Automatic scalling and translation for best values for sol3d requirements

 

3ds conversion to dat

The package has two important modules:

·         3dsloader

·         dat conversion

 

3dsloader

This module is adapted from the Tutorial 4: 3d engine – 3ds models loader, by Damiano Vitulli.

The loader opens a 3ds file, get the geometry (vectors, triangular mesh) and skips the others chunks.

Optional automatic or customized scaling and translations commands are available.

 

dat conversion

3ds file contains vertex coordinates and polygon described by index of vertices.

Vertex coordinates are stored in an array of vertex structure { x,y,z }.

Polygons are triangles, stored in an array of polygon structure { a,b,c } being these the index of the vertices of such polygon.

dat data structure has arrays of points {x,y,z}, lines {point 1, point 2}, faces {line 1, line 2, line 3}.

The conversion is done by inserting each new line, found in the polygons descriptors, in the edges array.

Each face is set to 3 edges, as 3ds file are supposed to have only triangles.