Loading and setting a 3d object in Opengl.

Hi!

i want to load in my scene an object 3ds.

What is the fastest way? Should i convert it first to any native format of OpenGL?

I would like also to give to the 3d object the position of at least three of its coordinates. I mean:

if my 3d object is a cube of 2x2x2, i would like to set the coordinate (0,0,0) of the cube in some position of space OpenGL, the coordinate (2,0,0) in another position of the space, and the coordinate (0,2,0) in another position. Is it possible?

What operating system / language are you using please?

OS X with Objective-C, Windoze MFC with C++, Linux with GLUT, etc.?

There are lots of .3DS loaders out there. My first google turned up

3DS loader tutorial

which compiled, ran and seems to be very comprehensive.

However here’s what I did. I wanted a simple free 3D Editor and found

[Delgine 3D](http://www.delgine.com/) 

with that you can import .3DS files. The editor saves files in it’s own .dmf format and there is then a really simple single C file to load them C DMF Loader

It has load, translate, scale and triangulate (turn all polygons into triangles) functions.

–STU!

thanks STU!

Originally posted by ppinter1:
[b] What operating system / language are you using please?

OS X with Objective-C, Windoze MFC with C++, Linux with GLUT, etc.? [/b]
Windoze MFC with C++

You might want to have a look at a MFC compliant 3DS mesh loader I wrote a few years ago available at:

http://www2.p-squared.com:8765/Display3DS.php

Good luck with your studies, and feel free to drop a line here with any questions (no promises though… it’s been ages since I looked at that code).

Cheers,
/p2

lib3ds is a nice cross-platform library for loading 3DS files.

Originally posted by ppinter1:
… it’s been ages since I looked at that code.
Yeah, the Display3DS kit for Visual Studio 2005 did indeed need some dusting off to: [ul][li]replace calls to fopen and strcpy with secure versions (fopen_s, strcpy_s)[]replace sizeof with _countof for some char arrays[]#define WINVER as 0x500 (Windows 2000, the minimum necessary)[*]link the Mesh3DS support library only to standard Windows libraries, as MFC is unnecessary there.[/ul][/li] It should load into VS2005 and compile quietly now.