Raydium 3D Game Engine

Official forum for everything about Raydium, ManiaDrive, MeMak, ...
It is currently Thu Mar 28, 2024 2:02 pm

All times are UTC




Post new topic Reply to topic  [ 25 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: Tue May 15, 2007 4:24 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
Raydium supports MD2 "format" for animations. To see how it works in Blender, download a MD2 file (there's a lot of this all over the web, it was the format for Quake 2 models) and import it in Blender (File -> Import -> MD2).

Then use our "triEXP-MD2-36.py" to generate the .tri file.

You can also filter the generated .tri file (that may be very big) with our "anim.php" script.


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 16, 2007 7:43 am 
Offline
User avatar

Joined: Mon Feb 26, 2007 6:58 pm
Posts: 16
Location: hungary
Thx!

I saw the "triEXP-MD2-36.py".
This code shows me, that animation segments length fix,
and number of segments is 20, number of all frames is 198.

Do I think it right?


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 16, 2007 8:25 am 
Offline
User avatar

Joined: Mon Feb 26, 2007 6:58 pm
Posts: 16
Location: hungary
And why is 0 in the sub-tri format?


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 17, 2007 4:40 am 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
I'm not sure to understand fully your question ;)
The API doc may help you on this point: http://wiki.raydium.org/wiki/RaydiumApiReference#chap23


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 17, 2007 12:29 pm 
Offline
User avatar

Joined: Mon Feb 26, 2007 6:58 pm
Posts: 16
Location: hungary
In the API doc:

---cut-------------------------

Version 2 files are a bit different, as showed below:

2
3 1743
0 39 stand
40 45 run
46 53 attack
1 ( <- look this - MsV)
5.1 15.75 -3.82 0.0000 0.0000 -1.0000 0.5158 0.5489 rgb(0.5,0.5,0.5)
6.3 11.75 -3.82 0.0000 0.0000 -1.0000 0.5196 0.5365 rgb(0.5,0.5,0.5)
5.0 11.75 -3.82 0.0000 0.0000 -1.0000 0.5158 0.5365 rgb(0.5,0.5,0.5)
...

---------------------------------

And generate the "triEXP-MD2-36.py" this:

---cut-------------------------

2
20 1050
0 39 stand ( <- these lines are writed static!!! - MsV)
40 45 run
46 53 attack
54 57 pain1
58 61 pain2
62 65 pain3
66 71 jump
72 83 flip
84 94 salute
95 111 taunt
112 122 wave
123 134 point
135 153 crstnd
154 159 crwalk
160 168 crattack
169 172 crpain
173 177 crdeath
178 183 death1
184 189 death2
190 197 death3
( <- end - MsV)
0 ( <- it is also static, but 0 is not this format - MsV)
0.177944 -0.077402 45.815002 0.320313 0.277344 c.tga
0.177944 -0.332233 45.639915 0.273438 0.226563 c.tga
0.177944 -0.077402 45.639915 0.347656 0.226563 c.tga
0.432304 -0.841897 45.289745 0.031250 0.207031 c.tga
...

------------------------------------

i'm sorry, dut I English is very-very weak... :(


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 17, 2007 12:39 pm 
Offline
User avatar

Joined: Mon Feb 26, 2007 6:58 pm
Posts: 16
Location: hungary
In pyton script:

Code:
# shame :)
      nv=0
      for nvi in mesh.faces:
          nv=nv+1
      nv=nv*3

      self.file.write("2\n") #tri version
      self.file.write("20 %i\n" % nv) # number of anims
      # anims
      self.file.write("0 39 stand\n")         #(these are static data :-/ - MsV)
      self.file.write("40 45 run\n")
      self.file.write("46 53 attack\n")
      self.file.write("54 57 pain1\n")
      self.file.write("58 61 pain2\n")
      self.file.write("62 65 pain3\n")
      self.file.write("66 71 jump\n")
      self.file.write("72 83 flip\n")
      self.file.write("84 94 salute\n")
      self.file.write("95 111 taunt\n")
      self.file.write("112 122 wave\n")
      self.file.write("123 134 point\n")
      self.file.write("135 153 crstnd\n")
      self.file.write("154 159 crwalk\n")
      self.file.write("160 168 crattack\n")
      self.file.write("169 172 crpain\n")
      self.file.write("173 177 crdeath\n")
      self.file.write("178 183 death1\n")
      self.file.write("184 189 death2\n")
      self.file.write("190 197 death3\n")
      self.file.write("0\n") #sub-tri version           #(it is truly correct???- MsV)
            
      for object in scene.getChildren():
          objtype=object.getType()


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 17, 2007 12:54 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
Let me be clear : the tri format v2 ("animation version") allows you to have as many animations as you want, with as many frames as you want, in version 0 or version 1, as you want.

Then comes the MD2 exporter. MD2 is a ""standardized"" format, with a fixed number of animations of a fixed length.

It's two different things :) We provides the MD2 python Blender exporter as a demo of Raydium animation support, but you can generate "TRI2" files by your own !


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 22, 2007 8:54 am 
Offline
User avatar

Joined: Mon Feb 26, 2007 6:58 pm
Posts: 16
Location: hungary
Ok. I understand ;)

Thx!

But...

Code:
      self.file.write("0\n") #sub-tri version


The script write static 0 to version, but use the newer version...
(Ahh... I'm dumb... sorry!)


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 22, 2007 9:10 am 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
No, you're right, this script exports frames as TRI version 0 (aka "without normals").


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 28, 2007 6:50 pm 
Offline
User avatar

Joined: Mon Feb 26, 2007 6:58 pm
Posts: 16
Location: hungary
Thank you for your forbearance.

I see this is right.
(I didn't behold normals are absent.)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 25 posts ]  Go to page Previous  1, 2

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 37 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group