PDA

View Full Version : moving 3ds models in C++


ibsta
12-14-2004, 03:19 PM
Hi

I was just wondering whether it is possible to move a model that was created in 3ds in C++. I know we can "move" the model by loading it using a 3ds loader and then we can change the coordinates, viewing angle but the question I want to know is whether it is possible to move the individual parts?

I am not a graphics developer and do not know much about designing in 3ds. Say for eg we have a model of a jeep. If the user presses the right arrow, is it possible to render the truck's wheel to turn right and same with the steering wheel? For example, say someone purchases the model of the hummer from turbosquid:

http://www.turbosquid.com/FullPreview/Index.cfm/ID/193891/Action/FullPreview

is it possible?

BantamCityGames
12-14-2004, 05:53 PM
I've never done any 3D programming but I think 319,000 polys is too much to use in a game model.

Ratboy
12-14-2004, 06:11 PM
Hmm..

The simplest way I can think of to do that would be to have your artist set up an animation of the jeep turning its front wheels through their maximum angles in each direction, and animate the steering wheel at the same time. It might look like this:

Keyframe 0: Everything at rest (straight ahead).
Keyframe 1: Wheels turned hard left
Keyframe 10: Straight ahead
Keyframe 19: Wheels turned hard Right.

Then the programmer uses the animated scene to control the steering by looking up the frame that corresponds to the Jeep's current wheel direction and displaying that particular frame. If the Jeep is doing a gentle left turn, the code would display frame 6; on a recklessly hard right, the code would use frame 19.

Clear as mud?

Nemesis
12-15-2004, 07:51 AM
I think that the best way (save for having a proper jointed-body / boning system) is to load your jeep model as distinct models e.g. for the body, wheels etc. and place and orient the individual bits accordingly. This would allow you to animate the wheels for forward motion, turning the front wheels for steering etc.

Teeth
12-15-2004, 08:11 AM
As Nemesis points out, you could have a skeleton for your jeep and change the orientation of the different bones in code. More work perhaps than just doing it with lots of different bits and bobs.

ibsta
12-15-2004, 05:38 PM
thnx for the replies