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.

DarkBASIC Professional Discussion / simple problem - complex answer?

Author
Message
adr
23
Years of Service
User Offline
Joined: 21st May 2003
Location: Job Centre
Posted: 16th Jul 2003 23:49 Edited at: 17th Jul 2003 00:56
This may sound like cracking a nut with a hammer, but bear with me. I've animated a fighter dude, and he's a little to his side. So, if you can imagine the camera side on, you'd see his front, but he'd still be looking to his left, for example:
http://www.fuzzee.co.uk/game/right.jpg

Lets say I want him to face left, one yrotate object 1, 180 later, and he looks like this:
http://www.fuzzee.co.uk/game/left.jpg

Oh no! He's facing the wrong way - his back is to the camera! Since the camera isn't going to move much in the game, I'd rather he face the camera, when facing both left and right.

solution:
Have two objects and secretly switch them. One object faces right, one faces left. The left facing one is actually a programmatically mirrored version of the right facing model.

--------- edit ----------------
<snip> bollocks solution </snip>
--------------------------------

Alternatively, you guys will come up with a better solution ("animate your model again, but facing the other way" is not a good solution )

Bender:Blackmail’s such an ugly word. I prefer extortion. The x makes it sound cool.
Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 17th Jul 2003 00:27
I haven't tested it, but I bet this'll piss you off if it works.

SCALE OBJECT ObjNum,-100,100,100

Just invert the scale on the appropriate axis and mmmmmmmmmaaaybe .. I'm not sure .. but maybe, that'll do everything for you.

Machine: P4 2200, 1GB RAM, GeForce4 64MB, Audigy Platinum
http://www.breakbeat-terrorism.co.uk
(It's not all about the coding)
adr
23
Years of Service
User Offline
Joined: 21st May 2003
Location: Job Centre
Posted: 17th Jul 2003 00:32 Edited at: 17th Jul 2003 00:33
It doesn't because x in scale object is world relative, not object relative iirc... dunno if my explanation is correct, but it just screws the guy up. I tried editing the x file information so that we was perfectly turned to 0 degrees then I tried the same thing - still didn't work.

Bender:Blackmail’s such an ugly word. I prefer extortion. The x makes it sound cool.
Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 17th Jul 2003 00:38
It was wishful thinking, but I think just for the audacity of the suggestion I should get a cigar!!

Machine: P4 2200, 1GB RAM, GeForce4 64MB, Audigy Platinum
http://www.breakbeat-terrorism.co.uk
(It's not all about the coding)
Codger
23
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 17th Jul 2003 00:41
yrotate object 1, 180 ( this does as you show rotate 180 )

yrotate object 1, 60 (or -60) should have him face to the left

Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 17th Jul 2003 00:44
He doesnt mean rotation really. He means the facing of the character. Like in combat games where the characters switch from left to right sided stance.

Machine: P4 2200, 1GB RAM, GeForce4 64MB, Audigy Platinum
http://www.breakbeat-terrorism.co.uk
(It's not all about the coding)
adr
23
Years of Service
User Offline
Joined: 21st May 2003
Location: Job Centre
Posted: 17th Jul 2003 00:46 Edited at: 17th Jul 2003 00:46
But the bones animation are still facing towards the right hand side. I doesn't matter how many degrees you rotate him, he'll still be animating the same way...

That's a shit explanation, so I'll try this:

Stick your arm out to the right. Now, by only spinning around on the spot, make it so that your left arm is sticking out.

--- edit - you beat me to it fallout

Bender:Blackmail’s such an ugly word. I prefer extortion. The x makes it sound cool.
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 17th Jul 2003 01:46
well you'll have to make your own animations, then just mirror the bone poisition for the opposite side - but how you'll achieve a mirror turn around in code is beyond me without a good few hundred lines and more animaiton skills than most pros.

really in real-life a fighter won't change this stance unless they wish to change thier tactics or which to do a new move which requires a different side of combat.

you could (if using a bone system) just swap all of the Z values over an interpol...
so like say all the left side bones were 1-10 and all thr right were like 11-20

then just like take the starting positions of each bone into arrays on either side - calculate the distance between the values (on an ABS scale) / by the number of expected frames (so say you game is working to like 25fps ... this is animation frames not realtime frames) then you divide by the number of current frames and add that to the value.

hopefully you'll be left with everything mirrored... providing that the Z is the depth and X is the width those would be the scales you work to.

you may need to do more like also convert the rotation of the spine and such.

adr
23
Years of Service
User Offline
Joined: 21st May 2003
Location: Job Centre
Posted: 17th Jul 2003 02:10 Edited at: 17th Jul 2003 02:25
Quote: "really in real-life a fighter won't change this stance unless they wish to change thier tactics or which to do a new move which requires a different side of combat."


This is an IK+ remake I'm doing here - so "stance" doesn't really come into it

Quote: "you could..."

This is becoming a little complex for me. I can read all the keyframe data in the x file, but it's all in quaternions, which isn't too helpful for me.

----------------------------

This can't be impossible - I distinctly remember counter-strike beta 4 where all the models were left handed. Gooseman was getting a lot of people saying "make em right handed" and he said "it ain't that simple" (tell me about it). Anyway, a couple of weeks later he said "I found out how to do it". I'm pretty sure he doesn't model the hand anims twice...

Ok, back to basics - I'm gonna look and see if CharacterFX can do this. I can see it has a mirror function, but it's getting it so it doesn't mangle the model...

Bender:Blackmail’s such an ugly word. I prefer extortion. The x makes it sound cool.
adr
23
Years of Service
User Offline
Joined: 21st May 2003
Location: Job Centre
Posted: 17th Jul 2003 02:48
Wee!

Milkshape has a "Mirror All" plugin. Maybe I'll shift to that package after all... I dunno...

http://www.fuzzee.co.uk/game/both.jpg

Bender:Blackmail’s such an ugly word. I prefer extortion. The x makes it sound cool.

Login to post a reply

Server time is: 2026-07-21 12:49:45
Your offset time is: 2026-07-21 12:49:45