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 / dbLoopObject

Author
Message
Yero008
13
Years of Service
User Offline
Joined: 5th Dec 2010
Location: Romania
Posted: 2nd Feb 2011 12:27
When I load the first level I load this object "surubelnita.x", the object appears but it doesn't have animation. But it's animated, when I use directx viewer the object is animated.

This is the code I use. This is where I load the first level.
I also uploaded the object.
What can I do?
Forward thanks.

Attachments

Login to view attachments
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 2nd Feb 2011 14:07
I think dbLoopObject broke in the last update.

Yero008
13
Years of Service
User Offline
Joined: 5th Dec 2010
Location: Romania
Posted: 2nd Feb 2011 14:14 Edited at: 2nd Feb 2011 14:15
What should I do? Should I use a while or an if and keep playing the object?
Thanks for the answer
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 2nd Feb 2011 14:20 Edited at: 2nd Feb 2011 14:21
dbLoopObject(999,0,100);

you are looping from frame 0 to 100, i believe it is actually playing, but only in a very small range, in your modeling program, it might appear 0-100, but exporting it to .X make it something over 30k as i recall, check out the exporting options to get the exact number

also don't spam posting like that..

Yero008
13
Years of Service
User Offline
Joined: 5th Dec 2010
Location: Romania
Posted: 2nd Feb 2011 15:22 Edited at: 2nd Feb 2011 15:33
Sorry for the spam, I also tried dbLoopObject(999), and it doesn't animate. I checked the options in the modeling program an it says it's from 0 to 100. Should I move the dbLoopObject inside the main loop(while ( LoopGDK ( ) ))?
I placed it outside the main loop because this is how I saw in the tutorials provided with dark gdk.
I used 3d Max studio and the panda exporter plug-in if it helps.
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 3rd Feb 2011 20:32
try 36000 or something instead of 999

Red Eye
16
Years of Service
User Offline
Joined: 15th Oct 2008
Location:
Posted: 3rd Feb 2011 21:32 Edited at: 3rd Feb 2011 21:34
Maybe it depends on each exported animation, but I recall (fpsc chars at least) each exported animation would be 199 directx frames for each keyframe in modeling package.

EDIT: You can simply check this by using the folowing methode:


...totalFramesb being the total frames your modeling package gives you.

Yero008
13
Years of Service
User Offline
Joined: 5th Dec 2010
Location: Romania
Posted: 4th Feb 2011 16:40 Edited at: 4th Feb 2011 17:26
@RedEye
I tried your method and the program says Framesa=16000. I tried dbLoopObject(999,0,16000), and dbLoopObject(999,0,1600) and neither one works, the object does nothing.
Edit:
I made a small project where I just load the object and i tried several ways to play the animation and it didn't work. Did anyone tried the object? Could the problem be from the plug-in(panda exporter)? But in directx viewer there is animation.
Later edit:

I tried dbSetObjectFrame (999,10000); and the object is moved, like it should be.
Where should I put dbLoopObject(999); int the loop, or where I load the object?
Red Eye
16
Years of Service
User Offline
Joined: 15th Oct 2008
Location:
Posted: 4th Feb 2011 17:17
Quote: "I tried dbSetObjectFrame (999,10000); and the object is moved, like it should be.
Where should I put dbLoopObject(999); int the loop, or where I load the object? "


dbLoodObject must be called once so it will loop to the end frame set and start over, if you call it multiple times, it will start over on the frame you gave it to start, and it the object will do nothing as it stays there, as it is looping in a loop. If you get me...

In this thread, i showed on how I work with playing animations:

http://forum.thegamecreators.com/?m=forum_view&t=180992&b=22

Yero008
13
Years of Service
User Offline
Joined: 5th Dec 2010
Location: Romania
Posted: 4th Feb 2011 17:27
I'll try your suggestion.
Also I tried the tutorials, and I used the colonel x example and it doesn't work also(I used the code provided with the example, I just compiled it). Does my dark gdk need to be reinstalled?
Red Eye
16
Years of Service
User Offline
Joined: 15th Oct 2008
Location:
Posted: 4th Feb 2011 18:23
Did you had any wornings or anything like that? + Is your DarkGDK updated?

What tutorial are we talking about? Did the model had any animations at all?

Yero008
13
Years of Service
User Offline
Joined: 5th Dec 2010
Location: Romania
Posted: 4th Feb 2011 18:29
I didn't have any warnings. I downloaded dark gdk 3 months ago.
I'm talking about 3D objects tutorial, the one that comes with dark gdk, where they load and animate(the animation doesn't work also) colonel x.
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 4th Feb 2011 23:19
I had a complete game I wrote and when I updated to the latest update all my models stopped looping, then I put the old Basic3D lib back in and it worked again.

Can anyone say they have the latest update and they have dbLoopObject working right now in front of them?

Yero008
13
Years of Service
User Offline
Joined: 5th Dec 2010
Location: Romania
Posted: 5th Feb 2011 16:21
So the problem is in my dark gdk's version?
TerryRussell
13
Years of Service
User Offline
Joined: 11th Dec 2010
Location: Chichester, UK
Posted: 5th Feb 2011 21:51 Edited at: 5th Feb 2011 21:54
I also found that the latest version of Dark GDK does not run the object looping. I haven't yet had time to dig into the code to fix it, so what I did to get around this was to create a counter in my program:

int iLoopCounter=0;

and then update that within the GDK loop.

I set up a small routine so that the counter gets incremented every so many milliseconds, and resets to whatever I need once it reaches some end point. Your requirements will be different to mine, but it is all very basic coding, anyway.

Each movement is called using
dbSetObjectFrame(ColonelObject,iLoopCounter);

(where ColonelObject is obviously the ID of the model concerned).

Hope that helps!

Amazing Simulation
www.amazing-forum.com
TerryRussell
13
Years of Service
User Offline
Joined: 11th Dec 2010
Location: Chichester, UK
Posted: 5th Feb 2011 21:53 Edited at: 5th Feb 2011 21:54
Sorry, I meant

dbSetObjectFrame(ColonelObject,iLoopCounter);

[update]
Fixed the original post now

Amazing Simulation
www.amazing-forum.com
TheeLord
16
Years of Service
User Offline
Joined: 23rd Jan 2008
Location: Chicago
Posted: 9th Feb 2011 07:31
It seems like any good animation system should probably used a looping system based on time instead of framerate anyways, correct?

Login to post a reply

Server time is: 2024-11-19 14:25:20
Your offset time is: 2024-11-19 14:25:20