Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (769)
Games in Android Showcase (230)
games submitted by our members
Games in WIP (856)
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  
  need some animation advice  (Read 1304 times)
0 Members and 1 Guest are viewing this topic.
Offline bennythemink

Innocent Bystander

« Posted 2005-07-23 12:13:59 »


im making a crowd simulatior in java3d. the basic idea is the user drags and drops people and obstacles onto a 2d map and then hits run. then using this info a java3d representation will appear showing the people moving around avoiding each other and the obstacles.

what happens is that at each time step each person object is sent to a behaviour object (e.g. a separation or a collision avoidance behaviour) and a vector3d is calculated and applied to the person object. this then updates the java3d rep.

i need help as i dont know how to update the java3d representation at each time step and what unit of time to use as i dont think System.currentTime Millis is the right way to go about it?

ive attached my class diagram in case anyones interested. im still only at the design stage so any advice now would be a big help:)
many thanks.
Offline Breakfast

Senior Devvie

for great justice!

« Reply #1 - Posted 2005-07-26 20:13:36 »

If you were working in 2D you might be able to call "render" every few milliseconds to keep updating the view but that isn't really how java3d works.

What Java3D does is to update the scene as often as it possibly can- it is constantly updating it. You change things in the scene using behaviours and usually you do it regardless of what java3d is doing at the time. You can use a behaviour that tells you every time that a frame is rendered but you have to be careful because on different hardware you will potentially get very different results.

It's quite conceptually tricky to get started with but once you get your head round the way it works it's reasonably easy to use.
Offline Jeff

JGO Coder

Got any cats?

« Reply #2 - Posted 2005-07-29 21:40:34 »

The magic of frame by frame update is using the WakeOnFrame(0) wakeup conditio nfor the beahvior.

This ensurs that the behavior will be woken once per frame and only once per frame.

Using behavior priority groups you can specify the order in which all your WakeOnFrame(0) behaviors are executed.

HOWEVER its important to realize that changes applied to transforms dont effect things like bouding volumes right away.  Thats not calculated til the behaviors all all done.  So you may get odd effects if you try to read those thinsg back and use them in your logic.

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!
Pages: [1]
  ignore  |  Print  

EgonOlsen (1669 views)
2018-06-10 19:43:48

EgonOlsen (1706 views)
2018-06-10 19:43:44

EgonOlsen (1158 views)
2018-06-10 19:43:20

DesertCoockie (1585 views)
2018-05-13 18:23:11

nelsongames (1185 views)
2018-04-24 18:15:36

nelsongames (1709 views)
2018-04-24 18:14:32

ivj94 (2533 views)
2018-03-24 14:47:39

ivj94 (1758 views)
2018-03-24 14:46:31

ivj94 (2835 views)
2018-03-24 14:43:53

Solater (971 views)
2018-03-17 05:04:08
Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45

Deployment and Packaging
by philfrei
2018-08-20 02:33:38

Deployment and Packaging
by philfrei
2018-08-20 02:29:55

Deployment and Packaging
by philfrei
2018-08-19 23:56:20

Deployment and Packaging
by philfrei
2018-08-19 23:54:46 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‑
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!