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.

Program Announcements / Newton Physics SDK running in DBPro!

Author
Message
French gui
20
Years of Service
User Offline
Joined: 11th May 2004
Location: France
Posted: 2nd Jul 2004 04:40
Zircher: place the files exactly like the newton dll as it is explained in the readme file.

walaber: I don't know if the question has been already asked but why the monkey is not falling exactly in the same position each time? is there a little random part in the calculation?

My English is not so good I'm just French
French gui
20
Years of Service
User Offline
Joined: 11th May 2004
Location: France
Posted: 2nd Jul 2004 07:09
Another question: (cannot edited the last post, little bug?)

Why have I to set the bone's size on the 3 axis? I understand for the bone's lenght (X). Are the others sizes needed for collision? (boxe)

My English is not so good I'm just French
walaber
21
Years of Service
User Offline
Joined: 22nd Oct 2003
Location: Los Angeles, CA
Posted: 2nd Jul 2004 09:06
zircher - the version I sent you is not the complete release, it's lacking the readme (that explains installaion), and the other demo source code examples.

let me know what you come up with!! sounds like it's going well.

French gui - bones are just boxes. you must define the Y and Z size, or the bone would be too thin to collide with anything. You should do our best to estimate the X and Z size to approximate the size of your model. have a look at the monkey demo, it's really close to the actual size of the model.

Go Go Gadget DBPRO!

Athlon XP 2400+ || DDR-SDRAM 1GB || Nvidia GeForce 4 Ti4200 AGP 8x 128MB
zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 3rd Jul 2004 00:00
The test is going well, but I'm still cutting my teeth on CharacterFX. I chose a powered armor trooper with it has LOTS of overlapping meshes and polygons. The skeleton was easy, but the vert assignment is a pain. Fortunately, liberal use of the hide menu option allowed me to get something done.

It took a few hours just to do a hand, forearm, and upper arm. I might end up re-engineering the model to reduce the poly count. I'm sure the second attempt will go much faster.
--
TAZ

History did not begin with PONG. -- Greg Costikyan

Game Beavers
walaber
21
Years of Service
User Offline
Joined: 22nd Oct 2003
Location: Los Angeles, CA
Posted: 3rd Jul 2004 10:50
yeah, assigning the vertices can be a PAIN!! the first ragdoll demo I made, the model had about 8000 polygons, it took at least 2 hours to assign the vertices.

remember you can use the "bind skin" in the Skeleton menu to automatically assign vertices to nearby joints. it works pretty well, but you'll still have to tweak it later.

Go Go Gadget DBPRO!

Athlon XP 2400+ || DDR-SDRAM 1GB || Nvidia GeForce 4 Ti4200 AGP 8x 128MB
zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 5th Jul 2004 06:02
I had the arms to the side. Bind skin = transporter accident.

One reason why I need to do a "Da Vinci" and reposition the limbs as far as possible from adjacent parts.
--
TAZ

History did not begin with PONG. -- Greg Costikyan

Game Beavers
walaber
21
Years of Service
User Offline
Joined: 22nd Oct 2003
Location: Los Angeles, CA
Posted: 5th Jul 2004 20:09
Zircher - so I can assume you're still in the CharacterFX / model setup stage? let me know when you get into the code part, as that's what I really want tested.

Ragdoll Monkey Bowling
....is progressing really well! I've basically got the user interface complete, and the game is running great. I am now working on the scorecard, and then a few more tweaks before the game is done. I hope to have it done by next weekend, depending on how busy I am with work. I think it has the potential to be a great showcase for DBPro + Newton

Go Go Gadget DBPRO!

Athlon XP 2400+ || DDR-SDRAM 1GB || Nvidia GeForce 4 Ti4200 AGP 8x 128MB
zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 6th Jul 2004 05:12 Edited at: 6th Jul 2004 07:43
Aye, but I hope to move on to the next stage either today or tomorrow. It's been an educational experience so far and a good excuse for me to learn CharacterFX. (I did mention that I was a slow poke, yes?)
--
TAZ

On the bright side, practice makes perfect. Finished the skeleton and vert assignment is pretty short order today.

History did not begin with PONG. -- Greg Costikyan

Game Beavers
FXTC
20
Years of Service
User Offline
Joined: 3rd Jul 2004
Location: CzechRepublic
Posted: 6th Jul 2004 06:43
I use NGC colliding system.Now I umpired for metaphysic : Tokamak or Newton?
After look down upon http://walaber.dbspot .Com/ I passed over on Newton - word of thanks walaber
Please about your opinion: is better used NGC+Newton nawab only himself Newton?
Need do this important decision for me
zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 6th Jul 2004 07:42
Well, if you're making Pong. Newton might be a bit of overkill. I've been very happy with Nuclear Glory's collision DLL. If your game does not need the physics, I would not bother with the performance hit or complexity. BTW, I believe Wolf is working on a custom physics library so Tokomak is not going to get much support while Walaber is up to date on Newton development.
--
TAZ

History did not begin with PONG. -- Greg Costikyan

Game Beavers
zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 6th Jul 2004 09:35
Ok, getting to the point where I can hopefully provide some meaningful feedback. First off, I'm using DBP 1.054.

RagMonkey = NDB_NewtonCreateRagDoll

DBP chokes on this line, minor exclusion.

RagMonkey = NDB_NewtonCreateRagDoll()

Fixes it right up.

NDB_RagDollBoneSetDBProData ChestBone, MonkeyModel, X

You don't explicitly state what X is. The following paragraph that talks about perform checklist for object limbs makes the implication. You also mention making a limb viewer. That essential stops the tutorial cold. For anyone who is following along they can not proceed without taking a break and writing up a utility to determine X.
--
TAZ

History did not begin with PONG. -- Greg Costikyan

Game Beavers
walaber
21
Years of Service
User Offline
Joined: 22nd Oct 2003
Location: Los Angeles, CA
Posted: 6th Jul 2004 13:19
you're absolutely right. I'll include the viewer I use with the tutorial.

I'll send you a copy of the viewer when I get home from work.

the problem is that DBPro doesn't number the limbs in the order they were created in CharacterFX... so you have to look up what limb = what limb number yourself.

I should have included the viewer in the first place. again, I'll send you a copy tonight. thanks for actually going through the tutorial!

Go Go Gadget DBPRO!

Athlon XP 2400+ || DDR-SDRAM 1GB || Nvidia GeForce 4 Ti4200 AGP 8x 128MB
zued
20
Years of Service
User Offline
Joined: 6th Jul 2004
Location:
Posted: 6th Jul 2004 19:47
Hi Walaber. ( And nice work!!!)

question: in every example I have tried everything but the "lookaround" feature feels like it running in slowmotion..how come? (newton or dbpro-fault..)

/zued the swede
walaber
21
Years of Service
User Offline
Joined: 22nd Oct 2003
Location: Los Angeles, CA
Posted: 6th Jul 2004 21:33
Zued I'm not sure what you're asking... do you mean the physics seem "in slowmotion"? if so, that is just an issue with the various physics settings. if you want things to move faster, you can do several different things, like adjusting the object size (world scale), or increasing the gravity, etc. My examples aren't based on real-world sizes/values, so they don't represent anything "realistic". but it just depends on how you setup your objects / masses / gravity / etc.

Go Go Gadget DBPRO!

Athlon XP 2400+ || DDR-SDRAM 1GB || Nvidia GeForce 4 Ti4200 AGP 8x 128MB
walaber
21
Years of Service
User Offline
Joined: 22nd Oct 2003
Location: Los Angeles, CA
Posted: 6th Jul 2004 23:07
Zircher please download the Object Viewer app from my website:

http://walaber.dbspot.com/viewer.exe, it is the viewer I use when making ragdolls. I'll include a link to the download in the tutorial (I don't want to add 1.2MB to the file size).

let me know how it goes!! I'm really excited to see a working ragdoll made with Newton by someone other than me!

Go Go Gadget DBPRO!

Athlon XP 2400+ || DDR-SDRAM 1GB || Nvidia GeForce 4 Ti4200 AGP 8x 128MB
zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 7th Jul 2004 02:03 Edited at: 7th Jul 2004 03:39
Booyah! That little app makes a big difference in understanding what you wrote. I was able to walk through the model and ID all the limbs by number, name, and (visual) position.

A few observations: One, your crosshairs could stand to have keys to scale up and down their thickness since they were rather bulky in realtionship to my model. If I had used an even smaller scale of model, I could have completely lost the model inside the crosshairs. Two, I also noticed that while the crosshairs jumped from one joint to the next, the XYZ display did not change from 0,0,0. Bug or is the relative position data for the limbs supposed to be all zeros? For purposes of creating a ragdoll model, what would work best there?
--
TAZ

Using the data from object_viewer and the mesh demo code I was able to fire up a quick test and watch the trooper model crumple into a nice heap. I still have to configure the bones (and fix some vert assignments.) But, using the demo mesh code, I was able to get something running at lunch time.

[edit for typos and clarity]

History did not begin with PONG. -- Greg Costikyan

Game Beavers
walaber
21
Years of Service
User Offline
Joined: 22nd Oct 2003
Location: Los Angeles, CA
Posted: 7th Jul 2004 08:58 Edited at: 7th Jul 2004 09:02
zircherI believe the "XYZ" was just a temp thing for me, it's actually showing the results of the limb angle command. I'll make the viewer a little better before I release the tutorial... I'll definately add the axis-size-adjustment you mentioned.

The only thing I use the tool for, is determining what limb number to use for each bone. all of the other data I get straight from character FX, like in the tutorial.

One thing you need to remember, however, (it may not be too clear in the tut) is that using the data straight from CharacterFX, you end up with a model mirrored about the Z axis (compared to what you see in CharacterFX). this is because CharacterFX is "Left-Handed" and DBPro is "Right-Handed" (or the other way around, it doesn't really matter). so what you have to do is re-export your model from characterFX into milkshape (milkshape ASCII), and export from Milkshape using the JT .X Exporter, with the "Right-Handed" option selected. now your model should load facing away from you (assuming it faced forward in the first place).

Either way, the best way to confirm everything is to first make a version of your ragdoll (using the bone data from CharacterFX) out of primitives, like I explain. this let's you visualize exactly how Newton is interpreting the skeleton. what I did is load my mesh model at (0,0,0), and then make a primitive ragdoll at (0,0,0). During the first few loops, the primitive ragdoll will "fall out" from under the mesh one. you can use this to check that each bone is the right size.... know what I mean?

by the way, using a humanoid model should mean less bones than my monkey example, because I used 3 joints per arm, and 2 extra joints for the ears...

looking forward to see what you come up with!

Go Go Gadget DBPRO!

Athlon XP 2400+ || DDR-SDRAM 1GB || Nvidia GeForce 4 Ti4200 AGP 8x 128MB
Yyrd
20
Years of Service
User Offline
Joined: 29th Mar 2004
Location: Under some bridge
Posted: 7th Jul 2004 11:41
anybody know how to control the damping of an object velicity?

i cant seem to adjust the drag at all.
ive tryed adding mass, adjusting the damping itsefve, with poor results,
i love to turn off the damping but can't. i love to cancel out the damping with impulse, but i dont know the math working of it to do so.
walaber
21
Years of Service
User Offline
Joined: 22nd Oct 2003
Location: Los Angeles, CA
Posted: 7th Jul 2004 11:57
RAGDOLL BETA TESTERS - there is an error in the documentation / tutorial about the NDB_RagDollBoneSetOffset command! in the tutorial and the documentation, it says to pass 3 rotation values x.y.z. But this command has changed now, and uses MATRIX data. you must setup a temp-matrix before calling the command, and that data will be used for the offset.

I think the example programs are right... have a look at those. basically you need to call NDB_BuildMatrix with the information you got from CharacterFX / other sources, and then call NDB_RagDollBoneSetOffset bonenum

sorry about that, I forgot I changed the command, and didn't update the tutorial / documentation.


Yrd you should use the formula Julio gave you on the Newton forum, and apply the force with the custom gravity functions (NDB_BodySetGravity, NDB_NewtonBodySetForceAndTorqueCallback)

Go Go Gadget DBPRO!

Athlon XP 2400+ || DDR-SDRAM 1GB || Nvidia GeForce 4 Ti4200 AGP 8x 128MB
zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 7th Jul 2004 14:20 Edited at: 7th Jul 2004 23:42
Thanks for the heads up. BTW, I got a fully working ragdoll trooper up and running tonight so I'm a happy camper. Since I used your mesh code example, I was fortunate enough to not trip on that glitch.
--
TAZ

A Blaze of Glory armored trooper taking a tumble off the platform.


Just some comments about the demo. I built the model in DoGA CGA and exported it to X. From there, I imported it into Milkshape 3D using the Direct X Tool and rotated the whole model 180 degrees and exported it using the Wavefront OBJ format. This format is also usable by CharacterFX. I then followed the rest of the tutorial for setting up the skeleton and assigning the verts. I was then able to export from CharacterFX to .X and use that directly with DBP without needing an extra step to Milkshape 3D. I'm sure that I missed some details such as playing with CharacterFX's material editor, but that was the gist of it for model creation. Oh yeah, since this guy is in armor and not organic, I used rigid skin and assigned all the verts manually. Binding was not that useful due to the nature of the model.

[edit for typos and clarity]

History did not begin with PONG. -- Greg Costikyan

Game Beavers
walaber
21
Years of Service
User Offline
Joined: 22nd Oct 2003
Location: Los Angeles, CA
Posted: 7th Jul 2004 14:45
wow! looks great! I like the model!! if you get a chance, could you send me the model + source code for your program? I'd like to take a loot at it.

this is very exciting, it means ragdolls in DBPro is now something accessible to everyone!

Go Go Gadget DBPRO!

Athlon XP 2400+ || DDR-SDRAM 1GB || Nvidia GeForce 4 Ti4200 AGP 8x 128MB
Yyrd
20
Years of Service
User Offline
Joined: 29th Mar 2004
Location: Under some bridge
Posted: 7th Jul 2004 23:17 Edited at: 7th Jul 2004 23:19
Quote: "Yrd you should use the formula Julio gave you on the Newton forum, and apply the force with the custom gravity functions (NDB_BodySetGravity, NDB_NewtonBodySetForceAndTorqueCallback)
"

his function was not usefull or at least it seems it was.


F = m (v – v0) / dt
v is the magnitud of the velocity you want.
v0 is the magnitud of body velocity
dt is the simulation time step.
F is the magnitud of the force you need to apply to the body.


first i dont know the velocity i want. im adding impulse. not setting velocity.
second i got this example to try.


this also usen the idea abouve. but it looks like you will need to set velocity. hence will then have a object they acts like it has a infident mass. meaning will push anything out of its way. losen all physic's

this cuold be soulved bye adding impulse to counter the lost engery instead of doing a "NDB_NewtonBodySetVelocity body + lost"
but i dont know how to convert impulse into velcity.

last why do you say to "and apply the force with the custom gravity functions (NDB_BodySetGravity, _NewtonBodySetForceAndTorqueCallback)"
why not just impulse?



i know im becoming very anoying ive been askibng for help on this for 3 weeks now..
zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 7th Jul 2004 23:54 Edited at: 7th Jul 2004 23:55
Quote: "wow! looks great! I like the model!! if you get a chance, could you send me the model + source code for your program? I'd like to take a loot at it."


Thanks. Technically, this is my second ragdoll. Learning from my past mistakes and using your object_viewer utility, I re-exported the model from DoGA CGA, rebuilt the model's skeleton, re-assigned the verts, and tweaked the source code in one sitting.

The source code is not perfect since I used approximate values for some of the limb sizes. I plan to continue fine tuning the sizes and rotation values since I have some other tests I want to perform. I'll zip up the WIP and send it to you this morning.
--
TAZ

History did not begin with PONG. -- Greg Costikyan

Game Beavers
FXTC
20
Years of Service
User Offline
Joined: 3rd Jul 2004
Location: CzechRepublic
Posted: 8th Jul 2004 10:02
Please about cooperation do new CSM import with Newton dynamically

http://forum.thegamecreators.com/?m=forum_view&t=33633&b=13

THX
walaber
21
Years of Service
User Offline
Joined: 22nd Oct 2003
Location: Los Angeles, CA
Posted: 8th Jul 2004 14:59
Yyrd - yes, you do know the velocity you want... it's the velocity from the previous loop.

you record the current velocity.

then call NewtonUpdate

then record the new velocity. calculate the change in velocity from the previous frame, and then use the equation to calculate the force required to speed the object back up to the previous velocity. then add that force to the body.

then repeat.

those are the steps. you should do this every loop, and set the force with NDB_BodySetGravity (don't forget to also add the gravity vector here). remember you must call NDB_NewtonBodySetForceAndTorqueCallback with flag "1" to make sure custom gravity is enabled for the body.

please give that a try, and tell me if it works.

if you are still stuck, I can try to make an example of an environment with no loss of energy.

Go Go Gadget DBPRO!

Athlon XP 2400+ || DDR-SDRAM 1GB || Nvidia GeForce 4 Ti4200 AGP 8x 128MB
FXTC
20
Years of Service
User Offline
Joined: 3rd Jul 2004
Location: CzechRepublic
Posted: 8th Jul 2004 19:41
This link http://dbpro.softcz.com/exe/6_lolek.Rar on Czech www record nick in DBP forum has: GENERAL
wh1sp3r
21
Years of Service
User Offline
Joined: 28th Sep 2003
Location: Czech republic
Posted: 8th Jul 2004 20:12
??? I like Newton iam looking forward to new version(i hope, that it will in new version cylinders and vehycle psychic)

PS: Real programmers aren't afraid of math!.

☺☺ AthlonXP 2500+, Ati Radeon 9600 128MB, dualDDR 512MB 400Mhz CL3.0, SB LIVE!, monitor 19" ☺☺
walaber
21
Years of Service
User Offline
Joined: 22nd Oct 2003
Location: Los Angeles, CA
Posted: 8th Jul 2004 22:30
the next version is scheduled to include both.

I can't wait to get my hands on it! I love being the author of the wrapper, because I get to play with all of the new features first (with the excuse of makeing demos and "testing")

no word on a release date yet though.

Go Go Gadget DBPRO!

Athlon XP 2400+ || DDR-SDRAM 1GB || Nvidia GeForce 4 Ti4200 AGP 8x 128MB
Yyrd
20
Years of Service
User Offline
Joined: 29th Mar 2004
Location: Under some bridge
Posted: 8th Jul 2004 23:48 Edited at: 8th Jul 2004 23:55
ill give a donation if you can make an expamle of a free moven object that has no damper effect!
kinda like a space ship.

i just cant get ti work right..

ive tryed so many things. and i get a so unstable code. where that speed changes 50 mph for no reason at 100mph.

and i try on othe pc and it completely fails.
i realy been trying, not just begging people to tell me how to do it.


and this idea of saven data and restoring it, i cant figure out cause , it cancels out any force i put on the object too.


think:

object is moven down z at 10 velocity

i add 5 impluse z

i save the veloicty (10)

i run update

i added force from the saved (10)

im back to ten. and the impluse of 5 is lost!

repaet, back to 10, repaet , back to 10,
hell least im moven.....

i hope that makes sence..

sorry if im ingorant. but that how i see it. tgherefore im missing something somewhere.

one more thing the dev told me therev wuold be a subpath for my dammper problem, you get the pre relase for the patches,

did they add it? they said it will be a command to only to give the value needed to cancel out the damper.

why dont you and wolfy team up? yall be a great team. his project of tokamak is dead .yall cuold combine his ezrotate and netwon and make a super wrapper.
zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 9th Jul 2004 05:47 Edited at: 9th Jul 2004 06:24
Any chance we can get an interim release of the wrapper with the buoyancy commands in it? I'd really like to be able to play with that feature this weekend.

Looking through previous posts you also mentioned the possibility of adding impulses to to a ragdoll. Any tips on how to add assorted impulses to a ragdoll's limbs would be sweet. I'm trying to get up to speed on the docs, but a nudge in the right direction never hurts.
--
TAZ

I was able to get some spastic action, but I'm not sure how to equate a given bone with the 'rigid body' ID that the impulse command expects. [FIXED]

I found a glitch between the docs/dll and the keyword file.

The docs/dll expects NDB_RagDollBoneGetBody but the keyword file has NDB_NewtonRagDollBoneGetBody. The little code fragment below gives the ol ragdoll a swift kick to the head.



History did not begin with PONG. -- Greg Costikyan

Game Beavers
walaber
21
Years of Service
User Offline
Joined: 22nd Oct 2003
Location: Los Angeles, CA
Posted: 9th Jul 2004 08:54
Zircher you're way ahead of me, the e-mail I just sent you said all of the above information

the beta version I sent you actually has the buoyancy commands in it... I think the docs are there too, have a look and let me know.


Yyrd you're right, it's not as simple as it sounds. I'll have to think about it a bit, and see if I can come up with something... however the best choice would probably be to wait for the update in Newton, with the new functionality for this.

Go Go Gadget DBPRO!

Athlon XP 2400+ || DDR-SDRAM 1GB || Nvidia GeForce 4 Ti4200 AGP 8x 128MB
zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 9th Jul 2004 09:53
LOL, it's there. I guess learning to spell correctly would help when I search.

NDB_BodySetBuoyancyPlane is throwing me logically, but I can see where it could be used for effects like waterfalls and other non-level water features. Time to hit the docs.
--
TAZ

History did not begin with PONG. -- Greg Costikyan

Game Beavers
Gazzaden
20
Years of Service
User Offline
Joined: 21st May 2004
Location:
Posted: 9th Jul 2004 09:54
If this has already been covered, please forgive me. I downloaded the archive from your website. I am a bit of a newbie and I really don't know how to set up DBPro to use the wrapper. Please help.

Thank you

Gazzaden
zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 9th Jul 2004 10:02 Edited at: 9th Jul 2004 11:37
Have you looked at the source code for the six demos included? They really help to explain a lot.
--
TAZ

History did not begin with PONG. -- Greg Costikyan

Game Beavers
Gazzaden
20
Years of Service
User Offline
Joined: 21st May 2004
Location:
Posted: 9th Jul 2004 10:31 Edited at: 9th Jul 2004 10:31
What I am saying is I don't know how to include the .dll files. At the moment my compiler returns an error as soon as it hits the first Newton specific command.

Gazzaden
zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 9th Jul 2004 11:36
Ah, have you bothered with the most excellent README.txt file?

Quote: "
Newton SDK DBPro Wrapper v 1.23

by Walaber

INSTALLATION INSTRUCTIONS:

1) MOVE the "NDB.dll" file into your Dark Basic Pro "compiler\plugins-user" directory.

2) MOVE the "ndb_docs.html" file into your Dark Basic Pro "Help" directory.

3) MOVE the "keywords_ndb.ini" file into your Dark Basic Pro "Editor\keywords" directory.

4) place the "newton.dll" file in the director with your application.
"

--
TAZ

History did not begin with PONG. -- Greg Costikyan

Game Beavers
walaber
21
Years of Service
User Offline
Joined: 22nd Oct 2003
Location: Los Angeles, CA
Posted: 9th Jul 2004 12:07
yup, that should do it.

Go Go Gadget DBPRO!

Athlon XP 2400+ || DDR-SDRAM 1GB || Nvidia GeForce 4 Ti4200 AGP 8x 128MB
zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 9th Jul 2004 12:43 Edited at: 9th Jul 2004 12:46
I've managed to fake a buoyancy system for my trooper and he does a good imitation of standing (technically, a hanged man on a long rope.)

I've decided to add some punches and kicks via impulses. Much to my chagrin, the add impulse vectors are global and not local. So, I can punch north or south but I can't punch forward. Any suggestions while I ponder this lastest challenge? I imagine I'll have to face a similar problem when I switch from key scans to mouse click and drag. I can now see why Ragdoll Kung Fu and Madness used side views for their games.
--
TAZ

History did not begin with PONG. -- Greg Costikyan

Game Beavers
walaber
21
Years of Service
User Offline
Joined: 22nd Oct 2003
Location: Los Angeles, CA
Posted: 9th Jul 2004 13:15
I would suggest using the NDB_NewtonBodyGetMatrix command to get the rotation matrix of the body.

this returns a unit vector representing the global direction of each axis of the body. for example, with your ragdoll, the x axis is aligned with the direction of the bone, so your Y or Z axis' most likely represent the "front" of the body. to get which direction your body is facing, try these steps:

HeadBody = NDB_RagDollBoneGetBody(HeadBone)
NDB_NewtonBodyGetMatrix HeadBody
NDB_GetMatrix

(now, assuming the Y axis is the front of the head)
dx# = NDB_GetVector_X(2)
dy# = NDB_GetVector_Y(2)
dz# = NDB_GetVector_Z(2)

px# = NDB_GetVector_X(4)
py# = NDB_GetVector_Y(4)
pz# = NDB_GetVector_Z(4)

now dx,dy,dz is a unit vector facing the direction of your head. simply multiply these values by a scale factor (the power of the impulse),and use them, along with px,py,pz (position of the body) for your Impulse.

should work great!

*note you could also ignore the Y component if you just want to know the direction on the XZ plane.

Go Go Gadget DBPRO!

Athlon XP 2400+ || DDR-SDRAM 1GB || Nvidia GeForce 4 Ti4200 AGP 8x 128MB
zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 9th Jul 2004 14:37 Edited at: 9th Jul 2004 14:40
Hmm, I did not get the expected results. Instead, dx# = dz# regardless of facing.
--
TAZ

History did not begin with PONG. -- Greg Costikyan

Game Beavers
walaber
21
Years of Service
User Offline
Joined: 22nd Oct 2003
Location: Los Angeles, CA
Posted: 9th Jul 2004 15:06
that's odd... I'll have a look at it tomorrow (i should have some time tomorrow to fiddle around)

Go Go Gadget DBPRO!

Athlon XP 2400+ || DDR-SDRAM 1GB || Nvidia GeForce 4 Ti4200 AGP 8x 128MB
Gazzaden
20
Years of Service
User Offline
Joined: 21st May 2004
Location:
Posted: 9th Jul 2004 15:28
Doh Of course, readme.txt (slaps head). Thanks for that!!!

Gazzaden
Yyrd
20
Years of Service
User Offline
Joined: 29th Mar 2004
Location: Under some bridge
Posted: 9th Jul 2004 22:19
well guys, I've been encoraged to work on my own math for the physic's ive been told bye too many people that usen newton for my project is an over kill. so i will go back to my reg model. ive learn how these physic work so ill follow the meathod.
im not maken a complete pyhsic engine but a fliud dynamic one.

all wish me luck..... Yyrd checking out.
see yall in irc.
zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 9th Jul 2004 23:43
Good luck and have fun. Hopefully, your exposure to Newton will give you a solid idea of what features you will need for your project.
--
TAZ

History did not begin with PONG. -- Greg Costikyan

Game Beavers
walaber
21
Years of Service
User Offline
Joined: 22nd Oct 2003
Location: Los Angeles, CA
Posted: 10th Jul 2004 14:00
project update

still working on the next version of the wrapper. today I added buoyancy functionality for ragdolls!! here's a screenshot to prove it:



it's working great, although getting the right mass settings for your objects, combined with the liquid settings, takes a little trial-and-error. just one more reason to use accurate values when making things with Newton!!

Go Go Gadget DBPRO!

Athlon XP 2400+ || DDR-SDRAM 1GB || Nvidia GeForce 4 Ti4200 AGP 8x 128MB
FXTC
20
Years of Service
User Offline
Joined: 3rd Jul 2004
Location: CzechRepublic
Posted: 10th Jul 2004 18:58
Hmm nice job walaber
X3N0Wolf
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: United Kingdom
Posted: 11th Jul 2004 01:20
Yeah it's looking great OK, question time folks: I've finally started tinkering with Newton in DBP and I was wondering what the difference was between NDB_SetMatrixIdentityMatrix and NDB_SetMatrixZeroMatrix ? Wouldn't setting all the temp matrix values to zero give a matrix with no rotation or translation anyway? Or am I missing something (highly likely ) ? Also, in the demos, when creating objects, is NDB_SetMatrixIdentityMatrix just used as a safety precaution to clear the matrix out before entering data into it, or does it serve a higher purpose too?

Any help would be much appreciated!

X3N0

By the Great Wolf... it actually WORKS!!!
Gimme Fuel Gimme Fire Gimme That Which I Desire!
walaber
21
Years of Service
User Offline
Joined: 22nd Oct 2003
Location: Los Angeles, CA
Posted: 11th Jul 2004 11:38
an Identity MAtrix and a Zero MAtrix are different things. Matrix rotation deals with multiplication, so a Zero matrix would not have the same affest as the Identity matrix. for more detail, have a quick search on google.

yes, all of the calls the NDB_SetMatrixIdentityMatrix are just to make sure we have a clear matrix to work with. The next version of the wrapper will have a command called "NDB_BuildMatrix" that will make a matrix in a single command, given the rotation and translation data. it's a VERY usefull command.

Go Go Gadget DBPRO!

Athlon XP 2400+ || DDR-SDRAM 1GB || Nvidia GeForce 4 Ti4200 AGP 8x 128MB
eat much pie
20
Years of Service
User Offline
Joined: 9th Apr 2004
Location: Within the mind of a lowly mortal...
Posted: 11th Jul 2004 18:10
You're all going to laugh at me for asking this, but what do you mean by a matrix? I know about the matrices in DBPro (ie. landscapes), but I don't understand why these matrices would be helpful in Newton.

I'm guessing you're talking about the "matrix4" 3D maths commands, but I don't know what these are. Could anyone explain?

Cheers!

Checkpoint Router: my very own AI routing program: http://eatmuchpie.dbspot.com
X3N0Wolf
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: United Kingdom
Posted: 11th Jul 2004 21:44
Ah right, yeah I think I got it, some values in an Identity Matrix are 1, not 0, that's why it wouldn't have the same effect, right? <laughs> I still don't understand what the hell it does but as long as it works I won't worry my tail off over it! So yeah, like eat much pie, I wouldn't mind an explanation myself if it's not too much bother like

That upcoming command sounds like a total bonus to me dude!

I don't want to confuse any issues with matrices here, but is it possible to convert a DBPro Matrix (the thing you use to make terrain) into a Newton collision object, like WOLF's Tokamak wrapper could? Would I have to use Memblocks or something to manually create a mesh out of it first (no idea how incidentally, but I think it can be done can't it?), make an object from the mesh, then kick that object over to the NDB_NEWTONCREATETREECOLLISION command to build it?

Thanks all!

X3N0

By the Great Wolf... it actually WORKS!!!
Gimme Fuel Gimme Fire Gimme That Which I Desire!

Login to post a reply

Server time is: 2024-11-22 13:12:17
Your offset time is: 2024-11-22 13:12:17