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.

Newcomers DBPro Corner / how does one add Dx Mesh then animate

Author
Message
sweldon
12
Years of Service
User Offline
Joined: 27th Dec 2011
Location: Delaware,Ohio
Posted: 4th Jun 2013 05:33
How does one load a Direct X Mesh and load it into Dark Basic Professional then animate limbs for movement ?

Some times logic is a conclusion of the illogical ITems
sweldon
12
Years of Service
User Offline
Joined: 27th Dec 2011
Location: Delaware,Ohio
Posted: 4th Jun 2013 06:40
I figured this much out but it doesn't move the way i wish it to like a true up down and left and right extra.... Someone please give me some advice on how to fix this ?

Some times logic is a conclusion of the illogical ITems
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 6th Jun 2013 13:03
If it is a model made with several limbs, you just rotate limbs into the DO/LOOP ...if it is a single mesh model, you have to add bones to your model, and then use the same method to animate it.

Cheers.

I'm not a grumpy grandpa
sweldon
12
Years of Service
User Offline
Joined: 27th Dec 2011
Location: Delaware,Ohio
Posted: 7th Jun 2013 15:55
thank you . I will try that.

Some times logic is a conclusion of the illogical ITems
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 8th Jun 2013 04:34
First off, you might want to steer away from listing the complete path to a file (like this):
Quote: "
load object "c:\users\sweldon\Desktop\L_Shield.x",1
"


Typically, references are relative to the folder in which the .dba/.dbpro files are located. So, if the "L_Shield.x" is in the same folder as the .dba/.dbpro file, you could simply code it as:

This way, if you ever use the same code on another machine, or share it with someone else, it will not error because it cannot find the pathway.

You asked about loading a mesh, but actually load an object. Technically, there is a difference, but perhaps an object is what you really meant.

Normally, an object is created in a 3D modeling program, rigged and animated (and skinned too, for that matter). The object is then loaded into DBP and you can cycle the object through the frames created in the 3D modeller by using the PLAY OBJECT and LOOP OBJECT commands.

You can indeed rotate an object's limbs in DBP as Chafari has said. This can be a lot of work, depending upon what you are doing. Plus, bear in mind that only that limb will move unless you link the limb to another and establish a parent/child relationship. So, if the hand and arm are two different limbs, it will look awful to rotate one and not the other.

Another thing worth mentioning, the variables you are using, x3D, y3D, and z3D by default are integers, and therefore are not as accurate as float variables. The POINT OBJECT command needs to use float variables in order to be precise (you can use double floats if you really need high precision). You can easily fix this be either defining them as floats, i.e. early in your code do this:

or simply put the # sign at the end of each variable, i.e.:


Hope this is helpful,

LB

So many games to code.....so little time.

Login to post a reply

Server time is: 2024-11-23 15:08:32
Your offset time is: 2024-11-23 15:08:32