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.

3 Dimensional Chat / exporte 3ds file to x files without lost the animation

Author
Message
Attreid
17
Years of Service
User Offline
Joined: 27th Nov 2002
Location:
Posted: 7th Dec 2002 17:18
hello,
Does someone know how we can exporte 3ds files to x ? I cannot play the 3ds' animations with dark basic pro, but I can play x's animations without any problem.
I have an exporter, but it doesn't work well : it doesn't export the animations.
I saw that with dark basic pro, they give a few models and they're animated. they are in the x format too, and they keep their animation. what programm did they use ?

( yeah, I know, I don't speak well english, but i've a good reason : i'm swiss )
Simple
17
Years of Service
User Offline
Joined: 28th Aug 2002
Location: United Kingdom
Posted: 7th Dec 2002 18:18
There's a .3ds to .X converter that comes with DB1x ... if you have that, then it will convert your .3ds to .x and keep the animations.

It's located in the DarkBasic/Tools folder.

Spec - AMD Athlon 1000mhz - 256mb DDR - Gforce2mx 400 TV out - 30gb HD - 19" Compaq - DVD rom - CDRW - Firewire - ATI TV card - All linked to another PC with higher spec
Morcilla
17
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 8th Dec 2002 15:51
I have the same problem, look at my topic:

"DirectX and 3ds animations with DBPRO":

http://www.darkbasicpro.com/apollo/view.php?t=3138&b=3

I have to imagine that the answer that Simple gives is that we have to use 3dmax for creating animations, and then convert them to .x, if desired.
I haven't tried that tool, I'll post a new reply when I do.

Regards.

Lancewrath
17
Years of Service
User Offline
Joined: 30th Dec 2002
Location:
Posted: 3rd Jan 2003 19:14
Ya i my DB 3ds2x convertor doesnt work for crap. it tried a buncha stuff but i found somthing that works for me.. if you got 3dsmax here is some max script you can run...al this does is export each frame of animation seperately..

utility savesequence "DarkBASIC Sequence Export"
(
local savefilename
--edittext filename "Base filename:"
label l2 "written by Guy Savoie"
spinner start "Start Frame:" type:#integer range0,1000,animationrange.start]
spinner end "End Frame:" type:#integer range0,1000,1] --animationrange.end]
spinner outstart "Output from:" type:#integer range0,1000,animationrange.start]
--button pickdir "Select Output File"
button saveit "Save 3DS Sequence"
on saveit pressed do
(
animbuttonstate = true
savefilename = getsavefilename types:"3DS(*.3ds)|*.3ds"
if (savefilename != undefined) then
(
for f = start.value to end.value do
(
slidertime = f
curfilename = (getfilenamepath savefilename) + (substring (getfilenamefile savefilename) 1 6)
framenum = f as string
curfilename = curfilename + framenum +".3ds"
print curfilename
exportfile curfilename #noprompt
)
)
)
)


then after you run that you should have a folder loaded with animations right? ya you dont want that.. 1 good file or 2 is good enough. Well i ran into some DB code for this


filename$ = "morphdata.dat":rem the name of the animation data file.
lastframe = 39:rem frames are assumed to run from 1 to lastframe - you can customize this
sync on:sync rate 0

for i = 1 to lastframe
cls
text 0,0,buildfilename$(i)
load object buildfilename$(i),1
sync
make mesh from object 1,1
make memblock from mesh 99,1
vcount = memblock dword(99,0)
voffset = memblock dword(99,4)
ncount = memblock dword(99,8)
noffset = memblock dword(99,12)
FCount = memblock dword(99,16)
FOffset = memblock dword(99,20)
FDSize = memblock dword(99,24)
UVOffset = memblock dword(99,28)

vsize = (vcount*12)+ncount*12
fullsize = vsize*lastframe

if i = 1 then make memblock 1,fullsize
copy memblock 99,1,voffset,(i-1)*vsize,vsize
next i

if file exist(filename$) then delete file filename$

open to write 1,filename$
write memblock 1,1
close file 1

end

function buildfilename$(i)
rem this below here is your model file so change the directory and name of your animation
s$ = "lance\lance"+str$(i)+".3ds"
endfunction s$


after you run that prog on your model all you have to do to get it to run in your game is basically code something remotely close to this


set window on
set window layout 1,1,1
set window title "Getting my Damn model to animate"
filename$ = "morphdata.dat":rem the vertex animation file
imagename$="test\lance1b.bmp":rem UV bitmap

lastframe = 39:rem same number of frames.
sync on:sync rate 0
framerate1 = 10
animationp = 5
frameamount = 5
angolo = 0
rem Load the animation data
open to read 1,filename$
read memblock 1,1
close file 1
load image "test\lance1b.bmp", 1
rem Load the base object
load object "lance\lance0.3ds",1
turn object left 1,-110
rem copy it into a mesh object - we need the UV data and the
rem face data.



make mesh from object 1,1
make memblock from mesh 99,1

rem assigning textures and options

vcount = memblock dword(99,0)
voffset = memblock dword(99,4)
ncount = memblock dword(99,8)
noffset = memblock dword(99,12)
FCount = memblock dword(99,16)
FOffset = memblock dword(99,20)
FDSize = memblock dword(99,24)
UVOffset = memblock dword(99,28)

rem VSize is the size of one frame of vertex/normal data
vsize = (vcount*12) +ncount*12
fullsize = vsize*lastframe


rem Load the UV texture
load image imagename$,1

rem Make the generic cube object, and set the right texture
delete object 1
make object cube 1,100
set camera to object orientation 1
texture object 1,1
set object 1,1,1,0
position object 1,0,200,0
turn object left 1,50
rem This is the animation frame
i = 0

while mouseclick() = 0

poopshark = poopshark + 1
if poopshark >=framerate1
i = i + 1
if i > animationp then i = i-frameamount
rem Load the proper animation data
copy memblock 1,99,(i-1)*vsize,voffset,vsize
change mesh from memblock 1,99
rem Load the proper animation data
change mesh 1,0,1
poopshark = 0
endif

text 0,0,"Wrath's 3d Test game"
text 0,415, str$(fcount)+" Polygons"
text 0,430, "Frame Rate: "+str$(screen fps())+" fps"
sync
endwhile

end


run that and your model should work...the only thing you'll need is 1 animation frame 3ds file like Lance0.3ds and the dat file and your good to go.. also the cool thing about this is it makes it really hard for people to steal your models if you make them yourself like me.

if lance = stoned then darkbasic = ?
Lancewrath
17
Years of Service
User Offline
Joined: 30th Dec 2002
Location:
Posted: 4th Jan 2003 01:04
oh btw you might get some bones that might pop out...so you might have to open each frame and delete the bones before you compile the model into the Dat file

if lance = stoned then darkbasic = ?

Login to post a reply

Server time is: 2020-08-12 02:22:26
Your offset time is: 2020-08-12 02:22:26