Skip to main content
GameDev.net gamedev.net
🔒 Locked

Loading ms3d files to frames.

Started by Krazex Dec 21, 2005 at 6:41 AM 1 replies 450+ views
Original Post
Krazex
Krazex
I am working on a model importer/exporter and want to add support for ms3d. I got importing the models without animation working by the sample of Brett Porter. What i can't get working is loading the animation frame based instead of time based. So basicaly what i want to do is load a ms3d and export static frames to another file. What i need help with is a function that makes frames from time. Can't figure out the matrix calculations. Any help ?
Nit
Nit
To work within the boundaries of the MS3D format, you need to convert the frame times to frame numbers. So if you wanted to animate frames 1-10, you would animate from startTime to endTime where:

startTime = startFrame*1000.0/animFPS;
endTime = endFrame*1000.0/animFPS;

If you have looked at rsn.gamedev.net (or on nehe.gamedev.net), you will also need to modify parts of rsn's advanceAnimation(), e.g. the looping functionality:

[SOURCE]	if ( time > endTime)	{		if ( m_looping )		{			restart();			time = startTime;		}		else			time = endTime;	} [/SOURCE]

Krazex
Krazex
Thanks, will try to loop through the code from start to finish and see if i can get it right, hadn't looked at the advancedAnimation().

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.