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 / My animated object method! AKA... My evil plan to save the world!

Author
Message
Da_Rhyno
15
Years of Service
User Offline
Joined: 25th May 2011
Location:
Posted: 1st Oct 2011 07:02
The code should be pretty self-explanatory.

This just shows the concept for what I'm planning on doing, and from what I can tell it works thusfar.

What it does is it uses limbs for individual frames of an animation and animates off that.

Tell me what you all think! Constructive criticism only, please.

Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 1st Oct 2011 12:08
All I get is a scrolling box.

IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 1st Oct 2011 13:07
Quote: "Tell me what you all think!"

I think you are reinventing the MD2 file format. You could simply create your objects in MD2 format, and avoid messing around with vertex data - the data format is very simple to follow, and unlike other formats, is pretty much fixed in stone.

However, if you are determined to carry on down this road, here's how I'd do it:


I would suggest that you use my plug-in commands which are available for the creation of the new object (BEGIN NEW OBJECT, ADD NEW LIMB, FINISH NEW OBJECT), but if not, then your method will do, if a little less neatly.

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 1st Oct 2011 16:22
Quote: "Constructive criticism only, please."

That's ok for making practices. Time ago I made something like that in Darkbasic Clasic as in old darkbasic, we couldn't load Mdl. Later a made something different for Dbpro, but what I'm trying to do is to save the animation in the same dbo/x .




Cheers.

I'm not a grumpy grandpa
Da_Rhyno
15
Years of Service
User Offline
Joined: 25th May 2011
Location:
Posted: 1st Oct 2011 18:16
Quote: "Quote: "Constructive criticism only, please."
That's ok for making practices. Time ago I made something like that in Darkbasic Clasic as in old darkbasic, we couldn't load Mdl. Later a made something different for Dbpro, but what I'm trying to do is to save the animation in the same dbo/x .


+ Code Snippet

rem chafari´s SET OBJECT KEYFRAME
autocam off
sync on
_floor=1000
make object box _floor,300,2,300
color object _floor,rgb(0,155,0)

make object box 1,10,10,10
color object 1,rgb(100,0,0)
position camera -100,100,-100
point camera 0,0,0

do
`setting animation -----------------------------------------------
loop object 1,1,10 //like a normal animated object
fr=object frame(1)
set object speed 1,2 //setting speed
if fr=1 then move object up 1, 0.3
if fr=3 then move object 1,0.4
if fr=5 then move object down 1,0.3:perform csg difference _floor,1
`------------------------------------------------------------------
sync
loop



Cheers.
"


Does that code actually work? I tried something where I tried to append the animation data in the DBO via a memblock, but it didn't work out so well.


Quote: "All I get is a scrolling box.
"


That's what it's supposed to do is reposition the box per each frame.


Quote: "I think you are reinventing the MD2 file format. You could simply create your objects in MD2 format, and avoid messing around with vertex data - the data format is very simple to follow, and unlike other formats, is pretty much fixed in stone.
"


Would ID software have a problem with me if I used it in commercial code, do you think?

Also, @Ian... I still gotta download your matrix1 utils plugin.
Da_Rhyno
15
Years of Service
User Offline
Joined: 25th May 2011
Location:
Posted: 1st Oct 2011 18:35 Edited at: 1st Oct 2011 18:36
CHAFARI!!!!!!!!!!!!!!!! THAT'S EXACTLY WHAT I'VE BEEN LOOKING TO DO!!!!!!!!!!!!!!!!!!!!!!!!!

Thank you so much man!

EDIT: What I've been trying to do is set object position/direction and vertex infos for each frame in my loop.
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 1st Oct 2011 19:06
@Da_Rhyno
I'v done that just saving to a .txt file,like most plugin that save animation to .ani,..but I want to export anim directly in the object.

Cheers.

I'm not a grumpy grandpa
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 1st Oct 2011 22:01
If I really understood DBPro's animation system, I'd add commands to allow you to build it into objects that you create using my commands.

Quote: "Would ID software have a problem with me if I used it in commercial code, do you think?"

No, I wouldn't have thought so.

Other programs have used MD2 in the past, and many continue to allow the data to be created and/or loaded. Besides, it's a file format - while the data within an MD2 file may be copyrighted, the file format itself cannot be (you can't copyright an idea, only the expression of an idea - the data is the expression).

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 1st Oct 2011 22:35
Quote: "If I really understood DBPro's animation system, I'd add commands to allow you to build it into objects that you create using my commands"


That would be wonderful!!

Cheers.

I'm not a grumpy grandpa
Da_Rhyno
15
Years of Service
User Offline
Joined: 25th May 2011
Location:
Posted: 2nd Oct 2011 04:39
Quote: "If I really understood DBPro's animation system, I'd add commands to allow you to build it into objects that you create using my commands."


That seems to be the trouble everyone's having... They kind of skim over it in the DBO manual.
Da_Rhyno
15
Years of Service
User Offline
Joined: 25th May 2011
Location:
Posted: 2nd Oct 2011 08:50
Hmmm... It appears I jumped the gun a bit on this.

I thought it would automatically keep the animation with the object, but it appears it's not. It doesn't retain the frames after it goes through it's loop. Kinda sucks. >_<

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 2nd Oct 2011 12:19
Quote: "I thought it would automatically keep the animation with the object, but it appears it's not"


Vertexdata commands just works at runtime.

Quote: "That seems to be the trouble everyone's having... "


That's the really trouble

Here's an example showing how directX works:




Cheers.

I'm not a grumpy grandpa
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 2nd Oct 2011 14:52
Quote: "That seems to be the trouble everyone's having"

Believe me, not it's not - I'm talking about the internals, not the 'how to use'.

Here's your problem:
LOCK VERTEXDATA FOR LIMB 1, 0

You are updating the same limb every time, which is not what you said you were going to do. You were going to create a limb for every animation frame, then show/hide as needed.

Like this:


Da_Rhyno
15
Years of Service
User Offline
Joined: 25th May 2011
Location:
Posted: 2nd Oct 2011 19:38
@Ian - The last thing I posted wasn't the limb animation, rather one I thought would work with individual frames.
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 3rd Oct 2011 15:13
Animation doesn't update the underlying data - the underlying data is copied and transformed for display, then discarded.

DVader
22
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 3rd Oct 2011 16:19
"Besides, it's a file format - while the data within an MD2 file may be copyrighted, the file format itself cannot be (you can't copyright an idea, only the expression of an idea - the data is the expression)."

Err, MP3? That's only a file format but does have some license issues. MD2 is probably ok, but not all formats are free to use.

Da_Rhyno
15
Years of Service
User Offline
Joined: 25th May 2011
Location:
Posted: 3rd Oct 2011 19:07
I actually thought the main issue with MP3s was just EMI's concern about people pirating music with it, not the file format.
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 3rd Oct 2011 21:43
Quote: "Err, MP3?"

Nope, that's a patent issue, and actually nothing to do with the file format itself and everything to do with the compression methods needed to produce and/or decode it.

There are no patents involved with MD2.

Login to post a reply

Server time is: 2026-07-10 06:07:59
Your offset time is: 2026-07-10 06:07:59