Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (475)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (530)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Behavior question  (Read 960 times)
0 Members and 1 Guest are viewing this topic.
Offline esvxm

Senior Newbie




Java games rock!


« Posted 2004-02-03 18:13:34 »

Hi!

I want to use TimeElapsed behavior or FrameElapsed behavior or any other method. What I want to do is that if a specific time has passed e.g. 2000milsec, I run a bit of code, when 2500 milsec pass I run an other. How could this be achieved?. Thanks.
Offline rdcarvallo

Senior Member


Projects: 5
Exp: 15 years


2D Java games forever!


« Reply #1 - Posted 2004-02-03 19:23:11 »

Hi,
 What are you triying to do??
 What does the bit of code? add shapes?? change colors?? (anything that changes the scene) or other things.. (I/O to file)
 If the code changes the Scene you MUST use behavior (and set the capabilities needed), else you can use Threads to make the code run in steps.

 If you want to use behaviors to make your code time dependant use TimeElapsed behaviors..

 Read the Java3D Tutorial from Sun, it's really easy to understand..

Offline Breakfast

Senior Member




for great justice!


« Reply #2 - Posted 2004-02-03 20:16:25 »

Create a behaviour that runs using the WakeupOnElapsedTime as it's wakeup criterion. Should be fairly easy.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline esvxm

Senior Newbie




Java games rock!


« Reply #3 - Posted 2004-02-04 00:48:06 »

Hi!

Thanks for the reply. I am using the TimeElapsedBehavior. What I am trying to do is animate an articulated figure. I have the various ranges and transforms setup. What I want to do is move the right leg, then after a little delay, the left arm moves, so that the character is animated. I am not sure if the ElapsedFrame or the postFrame could be used. Thanks
Offline zingbat

Senior Member




Java games rock!


« Reply #4 - Posted 2004-02-05 21:19:56 »

I guess you dont want to use a third-party api for your animations and instead want to learn how to do it yourself.

If that is the case then it would be important to know how are you modeling your animation data.
I know some ways, maybe one of them is similar to what you are doing and all of them require the use of a skeleton which is just an hierarchy of transforms. If you want to be compatible the standards check the h-anim site and name your transforms accordingly to their convenction.

About the data you could attach a piece of data to each transform (bone). It can be physical data like a force vector being applyed at certain transform. It can also be anim data, a table that associates relative time values with with a certain transformation matrix (mostly rotations). I supose you use the timeline method.
In this case its neccessary to register the absolute time when the animation starts (for instance when the forward key is pressed read current time and associate it with the start of your current animation) then wait until a frame is going to be rendered and based on the time passed after the animation started and the current time choose the required matrix for each of your bones.
To simplify things you should allow only one animation to be played at a time, otherwise you will need to create a blending process somehow.
Offline esvxm

Senior Newbie




Java games rock!


« Reply #5 - Posted 2004-02-06 23:02:13 »

Hi!

What other API I could use? Also is there any way to use the inverse kinematics, to calculate the joint angles and then put them in the animation file so that it looks more realistic?.
Offline zingbat

Senior Member




Java games rock!


« Reply #6 - Posted 2004-02-07 21:45:11 »

Check the "Character Animation" thread in this part of the  forums. There is also the j3d.org which has a very complete library of java3d classes available for download.

I don't know if its worth to use inverse kinematics unless you are making a 3d modeler, but of course you could use any technique with java3d as long you know the maths for it. I don't know it myself and its not required at all to do animations. In fact it may even slow down your code considerably if you're thinking of a game.
Offline esvxm

Senior Newbie




Java games rock!


« Reply #7 - Posted 2004-02-08 16:06:17 »

you could use any technique with java3d as long you know the maths for it

I am new to Java3D...can you plz mention where at j3d.org these classes are..

Thanks
Pages: [1]
  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.

pw (11 views)
2014-07-24 01:59:36

Riven (9 views)
2014-07-23 21:16:32

Riven (11 views)
2014-07-23 21:07:15

Riven (12 views)
2014-07-23 20:56:16

ctomni231 (42 views)
2014-07-18 06:55:21

Zero Volt (38 views)
2014-07-17 23:47:54

danieldean (32 views)
2014-07-17 23:41:23

MustardPeter (34 views)
2014-07-16 23:30:00

Cero (49 views)
2014-07-16 00:42:17

Riven (50 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
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!