Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (538)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (600)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1] 2
  ignore  |  Print  
  3D Studio Loader  (Read 5970 times)
0 Members and 1 Guest are viewing this topic.
Offline DonCrudelis

Junior Devvie





« Posted 2004-06-07 12:12:35 »

Hi everybody!

Is there any 3D Studio loader, which supports
animations (not just one animation)?
If so, please reply my where i can get it.

Thanks in advance!

Emil Alonzo
Offline aNt

Senior Devvie




AFK


« Reply #1 - Posted 2004-06-07 13:18:30 »


http://www.newdawnsoftware.com/resources/xith3d

animation seems abit slow and gets worse the more frames it plays in an animation. lags out abit.. then when it gets back to frame 1 it speeds up again Sad

but the src is there Smiley
Offline DonCrudelis

Junior Devvie





« Reply #2 - Posted 2004-06-07 15:25:40 »


Thanks, it did work!  Smiley
I will try and look at the code to see if I could improve somrthing Cool
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline aNt

Senior Devvie




AFK


« Reply #3 - Posted 2004-06-10 06:46:36 »

well i think the problem is in the for loop under:

packages:
 org.newdawn.xith3d.threeds.model.PosTransform
 org.newdawn.xith3d.threeds.model.RotTransform
 org.newdawn.xith3d.threeds.model.ScaleTransform

in the call 'setTime'.
 
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
for (int i=0;i<frames.size();i++) {
   firstFrame = (PosFrame) frames.get(i);
            
   if (i != frames.size()-1) {
     nextFrame = (PosFrame) frames.get(i+1);
                
     if ((time >= firstFrame.time) && (time < nextFrame.time)) {
       break;
     }
   } else {
     nextFrame = (PosFrame) frames.get(0);
   }
 }


it seems to scan all the frames in the files animation. so it gets incromently slower the more frames you have.
Sad not sure of a work around mind.
Offline kevglass

« JGO Spiffy Duke »


Medals: 211
Projects: 24
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #4 - Posted 2004-06-10 06:57:48 »

How many frames are we talking about here?

I'd be surprised if that was the bottleneck unless we're talking about 1000s of frames.

Have you tried profiling? Smiley (yes, yes, I know, its my code I should sort it out but I have a slight RSI problem right now)

Kev

Offline aNt

Senior Devvie




AFK


« Reply #5 - Posted 2004-06-10 07:57:39 »

yep thousands + frames. not so many keyframes mind prob around 100 at most ever...

im just downloading OptimizeIt so i can make build a profile...
Offline aNt

Senior Devvie




AFK


« Reply #6 - Posted 2004-06-10 08:56:43 »

heres the profiler output:



Seems to hang out in RotTransform.
With an animation of around 8 keyframes
Offline kevglass

« JGO Spiffy Duke »


Medals: 211
Projects: 24
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #7 - Posted 2004-06-10 09:01:50 »

Certainly looks that way, what hideous code did I leave in there.

Kev

Offline aNt

Senior Devvie




AFK


« Reply #8 - Posted 2004-06-10 10:02:48 »

SmileySmileySmileySmileySmileySmileySmileySmileySmileySmileySmileySmileySmileySmileySmileySmiley
Smiley* CLAP CLAP CLAP CLAP CLAP *Smiley
Smiley* !! OH- KEV MAY DO A FIX !! *Smiley
Smiley* CLAP CLAP CLAP CLAP CLAP *Smiley
SmileySmileySmileySmileySmileySmileySmileySmileySmileySmileySmileySmileySmileySmileySmileySmiley
Offline kevglass

« JGO Spiffy Duke »


Medals: 211
Projects: 24
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #9 - Posted 2004-06-10 11:15:43 »

Alright, assuming my hand is in any workable state tonight I'll take a look tonight.

But only because of all the smileys Wink

Kev

PS. Does anyone else have a list of things they need to see sorted out (I'm not adding new features, just fixes)

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline aNt

Senior Devvie




AFK


« Reply #10 - Posted 2004-06-10 13:13:39 »

only things i have found over the months using the loader is getName(); returns nothing for me,
thought it should return the name of the shape matching the name i gave it in the modeler.
and the animation thing- ditching the loop would be cool. i would like to have alot of objects
animating at the same time Smiley

also texture loading- if i load a lot of shapes with textures the way textures are loaded in the
loader- it tends to run out of memory. i changed it to use getMipMap() (think its using disk caching) but then
transparent textures (png) didnt work Sad strange thing is a changed it back and it started working
ok.. so not sure if this was a xith3d bug that was fixed.

but animations being nicer would make my day Smiley
Offline kevglass

« JGO Spiffy Duke »


Medals: 211
Projects: 24
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #11 - Posted 2004-06-10 18:05:03 »

It seems I can't even get a model on the screen anymore Sad

Going to be hard to fix anything..

Kev

Offline aNt

Senior Devvie




AFK


« Reply #12 - Posted 2004-06-10 18:09:24 »

do u want one of my 3ds files?
Offline kevglass

« JGO Spiffy Duke »


Medals: 211
Projects: 24
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #13 - Posted 2004-06-10 18:12:24 »

Na, I've got piles of 3DS models now, just nothing showing up from the test app. I guess Xith must have changed significantly since I last tried it.

Kev

Offline aNt

Senior Devvie




AFK


« Reply #14 - Posted 2004-06-10 18:19:27 »

im using a build from the 29th of April.
All works here still.

i could upload the xith3d.jar for u?
Offline kevglass

« JGO Spiffy Duke »


Medals: 211
Projects: 24
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #15 - Posted 2004-06-10 18:36:29 »

Nope, back on track now! Smiley

Kev

Offline aNt

Senior Devvie




AFK


« Reply #16 - Posted 2004-06-10 18:37:56 »

sweet Smiley
Offline kevglass

« JGO Spiffy Duke »


Medals: 211
Projects: 24
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #17 - Posted 2004-06-11 13:11:44 »

New version uplaoded. It might be better, it might break a bit. PLEASE backup an old version before downloading this one...

Kev

Offline DonCrudelis

Junior Devvie





« Reply #18 - Posted 2004-06-11 17:29:12 »

In 3D Studio, is it possible to have e.g two animations in the same file?
Or do you need to have e.g Character Studio?

Thanks,
Emil Alonzo
Offline aNt

Senior Devvie




AFK


« Reply #19 - Posted 2004-06-12 08:27:04 »

2 animations? sorry i dont understand.

do u mean u want to shapes to animate? one doing
one thing the other doing somthing else. if so then yes
would be pointless if u couldnt do this.

but i would think about how u want to make objects for
a game world. i make component parts of a model then
animate them parts. after that i bring them into Xith3D
and connect them up separate files (IO is fast if u
ask me-  for somthing like loading).

if u make say 10 shockwave explosion effects
then 10 explosion centers along with 10 models of stuff
that looks like smashed up parts animating. Next you
bring them parts into Xith and mix them together
(maybe even changing he colors in Xith3d to add more
complexerty. u end up with alot of combinations.

if u make them as final done deals u end up with only 10

this is also cool with making characters. make them
separate parts if u can.

history: Quake did this along time back Smiley
Offline DonCrudelis

Junior Devvie





« Reply #20 - Posted 2004-06-12 12:45:41 »

Ok

Thanks for the help!  Grin Grin

Emil Alonzo
Offline aNt

Senior Devvie




AFK


« Reply #21 - Posted 2004-06-18 11:00:11 »


1  
2  
3  
      for(int i = 0; i < model.numChildren(); i++) {
        System.out.println("name of child: " + model.getChild(i).getName());
      }


returns nothing Sad. is there away of getting the names
of the models i have set in my modeler? so i can add
tages in my models?
Offline kevglass

« JGO Spiffy Duke »


Medals: 211
Projects: 24
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #22 - Posted 2004-06-18 11:56:54 »

You know, I had a look at this, and the code is in there to support NamedObjects. I couldn't be sure anything had actually been named in my test models.

Could you possibly shoot me over a 3DS model with something telling me what names should be turning up so that I can run some tests and hopefully give you a fixed version?

Cheers,

Kev

Offline aNt

Senior Devvie




AFK


« Reply #23 - Posted 2004-06-18 12:40:39 »

here u go:

http://www.topresultmate.com/xith3d/v1.3ds

should be 5 shapes nice and simple:

name: leftwing
name: vapor_1
name: vapor_0
name: front1
name: body

so rock and roll. i sort of got it to work changing your TSDModel class adding this:

1  
2  
3  
public Iterator getObjectNames() {
  return(objects.keySet().iterator());
}


its just i pulling the keys- all i need. but getting the name from a Group would be more rock and roll Smiley

- hows the hand?
Offline aNt

Senior Devvie




AFK


« Reply #24 - Posted 2004-06-18 14:23:04 »

if i want to get the location of a shape group in the world i would guess i would need to do this:

1  
System.out.println("c: " + model.getNamedObject("vapor_0").getVworldBounds().getCenter().toString());


but i get 0f, 0f, 0f. but the object is moving
Offline kevglass

« JGO Spiffy Duke »


Medals: 211
Projects: 24
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #25 - Posted 2004-06-18 16:45:59 »

Might be worth printing the complete bounds out, it might be that the bounds arn't updating as the object moves. However, if thats the case, and the original bounds are right (which I wouldn't be sure of) then there may be a problem in the scenegraph, in that bounds wouldn't be updating with transform group changes..

Kev

Offline aNt

Senior Devvie




AFK


« Reply #26 - Posted 2004-06-19 09:15:47 »

well looked into it and the:
1  
model.getBounds.toString() 

we get the bounds and location of the model OK. also the:
1  
model.getVworldBounds().toString()

changes as exspected. it seem the children of the model are not getting updated. they are moving along in the scene ok. just there getBounds are al 0f, 0f, 0f 0f and there getVworldBounds() dont change from 0f, 0f, 0f 0f
1  
model.getNamedObject("vapor_0").getVworldBounds().toString()

isnt working. maybe i should update my Xith3D to a newer version and try that......
Offline aNt

Senior Devvie




AFK


« Reply #27 - Posted 2004-06-24 11:29:42 »

ok at last i get my computer working again. sodding thing

and have the new CVS of Xith3d and JOGL and all that
other jazz. and bosh still get 0f,0f,0f, r0f from a nested
object bounds...

gurrr- Sad *stomp stomp*
Offline Yuri Vl. Gushchin

Senior Devvie




Speak Java!


« Reply #28 - Posted 2004-06-25 06:04:14 »

Test case? [want to take a look, because of bounds work fine for me]

Yuri

Yuri Vl. Gushchin
JProof Group
Offline aNt

Senior Devvie




AFK


« Reply #29 - Posted 2004-06-25 13:30:41 »

Here is a test case as requested:  
 
http://www.topresultmate.com/xith3d/3ds-bounds-test.zip  
 
i have added kevs 3ds src also because i changed his  
TDSModel.java- just added a little bit of code that returns the  
model names- makes life simpler...
 
im thinking of added a Texture Manager so models can  
share the same textures. will do that and upload it  
to so kev can pass his expert eye over it.  
 
But theres nothing to amazing going on- i have build it
around kevs code to make it simpler to see whats
happening...  
 
The main model.getVworldBounds is ok. but the children  
just return 0s  
 
i get this:  
 
The main Model.getVworldVounds: BoundingSphere [-0.42404148,-0.18567085,-0.09359161 radius 12.151663]  
 
Model: redBox getVworldBounds: BoundingSphere [0.0,0.0,0.0 radius 0.0]  
Model: redBox2 getVworldBounds: BoundingSphere [0.0,0.0,0.0 radius 0.0]  
Model: redBox1 getVworldBounds: BoundingSphere [0.0,0.0,0.0 radius 0.0]  
 
The main Model is cool the kids are not so funky.
Pages: [1] 2
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

rwatson462 (28 views)
2014-12-15 09:26:44

Mr.CodeIt (19 views)
2014-12-14 19:50:38

BurntPizza (37 views)
2014-12-09 22:41:13

BurntPizza (73 views)
2014-12-08 04:46:31

JscottyBieshaar (34 views)
2014-12-05 12:39:02

SHC (46 views)
2014-12-03 16:27:13

CopyableCougar4 (42 views)
2014-11-29 21:32:03

toopeicgaming1999 (110 views)
2014-11-26 15:22:04

toopeicgaming1999 (96 views)
2014-11-26 15:20:36

toopeicgaming1999 (29 views)
2014-11-26 15:20:08
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!