Diesto
4th December 2002 18:56 UTC
Jedi vs Sith 3D
Jedi vs Sith 3D
----------------
Okay, call me immature, but I had the idea of fighting swords and wanted to realize it. Unfortunately the sword movement is rather poor, but programming in an 1-line-editor is even worse! So I was too lazy to enter the calculations for elbow and wrist moves. Okay, I confess, these calculations were too difficult, either.
I wish I could have at least global variables and more space for the programming!
Diesto
UnConeD
4th December 2002 21:23 UTC
I like the idea, but the end result is rather uninteresting... there are also a few culling problems (the red glowing thingy between the two cilinders).
If you want more space to code, type your code in notepad and copy/paste whenever you're done. This allows you to do find/replace and stuff like that.
I had a similar idea for swordfighting, and here's what I came up with... basically you have two variables per sword that define rotation, which are determined by a fixed formula in function of a1,b1 for the first sword and a2,b2 for the second. These four variables are increased/decreased by a fixed value every frame.
Each frame, you check if the two swords intersect (or come within a certain distance of eachother). If so, you flip the signs of the increments for a1,b1,a2,b2 and randomize their absolute value.
The sign flipping has the effect of the swords bouncing off eachother (and reversing direction), while the randomization makes sure they don't repeat constantly. You could also change the increments onbeat to get a more randomized fight.
Diesto
4th December 2002 21:32 UTC
Originally posted by UnConeD
I like the idea, but the end result is rather uninteresting...
Dunno if u got the first version in which the swords were touching all the time. Rather stupid. I changed that.
Originally posted by UnConeD
I had a similar idea for swordfighting, and here's what I came up with... basically you have two variables per sword that define rotation, which are determined by a fixed formula in function of a1,b1 for the first sword and a2,b2 for the second. These four variables are increased/decreased by a fixed value every frame.
Each frame, you check if the two swords intersect (or come within a certain distance of eachother). If so, you flip the signs of the increments for a1,b1,a2,b2 and randomize their absolute value.
How can I check for a collision/intersection? I defined the target point (xt,yt,zt) and let the swords move to this point. Then the target point is far outside on the right/left before they hit again in the middle.
I'd like to see your solution ;)
Diesto