Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / 3d model/direction,angle, mouse angle question

Author
Message
deathfinderxx
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location:
Posted: 2nd Jul 2009 04:31
Ok I am abit new to c++ and 3d codeing, but what im trying to figure out is the 3d model animations and looking. I kno how joints and bones and animations work for a mode ( alittle bit atleast since i make 3d models) But my question is how is the concept of making the upper torso,arms and head supposed to follow the angle of the mouse? Is it individual animations for every single angle? Also is the legs and torso usually seperate to make it easier to do animations? I wouldnt think it would be alot of angles for me since I'm codeing a 3d platform shooter.
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 2nd Jul 2009 06:03
It would depend on how you are doing your animation, wether your are deforming your model with bones and a skin or not.. But, the theory that you would need to figure out, would be to attach a "control" object(which would most likely be a hidden bone) to the back of the "character" and have its movement affected by your camera, thus when your camera pans right the character would "lean/twist" in that direction... If your are not using bones and a skin modifier to deform your model(ie, just using vertex manipulation), then you would need to animate the movement manually in your modelling package and just play it at the right time, when the camera is at certain angles to the character model.

Of course the actual mathematics of doin it will be complex, but its always best to work out your code yourself, otherwise you wont learn anything

Of course, the problem would be a little simpler to work out if you didnt want it to twist in the middle, I mean, its alot easier if you just had the rotation of your model fixed to your camera, so when the cam looks left, so does the model..

For examples of code doin all of the above things, do a forum search for terms like "animation control" "animating bones" "camera controls" and things like that, that should get you something useful.

If it ain't broke.... DONT FIX IT !!!
deathfinderxx
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location:
Posted: 2nd Jul 2009 06:07
Well in a platformer all i need for the torso is look up and down towards the mouse, it could still do its animations like throwing a grenade and what not. and the legs do the running crouching and wut not. I just dont really kno where to start :/ I have my model. It's one object and has no animations right now. I just dont know what I should do.
deathfinderxx
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location:
Posted: 2nd Jul 2009 08:20
still response? Well right now im gonna try and figure this Sparky's collision dll so I can get some collision in. Do you have msn or anything?
Phosphoer
16
Years of Service
User Offline
Joined: 8th Dec 2007
Location: Seattle
Posted: 2nd Jul 2009 08:35
I have never attempted anything like this, but I imagine that Mista is spot on. You should make all the animations that you want your model to have. Then parent the torso to a separate 'back' bone which has no animation key frames, and manually control that bone with code.

deathfinderxx
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location:
Posted: 2nd Jul 2009 08:45
Ok so pretty much, have all the animations do what ever, and have just a random joint/bone that the is moved by code which just moves the torso up and down while animations are still played? which kinda is a pain because some animations are still going to be hard like walking and throwing a grenade. Im just so confused about this :/
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 2nd Jul 2009 11:06 Edited at: 2nd Jul 2009 11:08
Sorry, I assumed that you were using a 3d model in 3d space, as opposed to a 2d ? platformer.. ( if its a 3d platformer then what I said I think would still be whats needed)

If its a 2d platformer then it becomes a bit easier, There is an entire series in the TGC newsletter, that you can find from:

http://www.thegamecreators.com/?gf=newsletter

about building a platform game in 2d, I dont mean a little piddly 2 second job either, I mean the full kit and kaboodle so to speak, everything from initially designing it right the way through to polishing it off with an nice UI and sounds effects, AI etc, I would suggest starting with that for some really good ideas on how to move you character around with the camera. Its a 2d platformer "bruce-lee" fighting type game.

The first part of the series can be found in Newsletter 62.

EDIT : I should mention that the tutorial series I mention is based in DarkBasic Pro, but the techniques and majority of the commands used are the same in DarkGDK, some of the data manipulation though will be difference as C++ handles some of those things differently than DBPro.

If it ain't broke.... DONT FIX IT !!!
deathfinderxx
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location:
Posted: 2nd Jul 2009 11:17
I was talking about a 3d one. I just dont really understand :/
deathfinderxx
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location:
Posted: 3rd Jul 2009 05:36
ok does anyone have an example for that extra bone thing with the torso movement. cuz that would help alot and i wouldnt need to animate the upper torso. please and thank you because i really needa figure this out or im at a stand still

Login to post a reply

Server time is: 2024-10-01 06:00:27
Your offset time is: 2024-10-01 06:00:27