Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (404)
games submitted by our members
Games in WIP (289)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Game Development / Game Mechanics / Re: Accelerate and slow down a camera move on: 2011-06-10 10:44:17
Thanks for the piece of code!

After some more thought, I came out with the following idea: a "standard" sigmoïd method works, but it is not easy to control tune it. Actually I just would like to build a function that looks like a smoothed stair:

1       /-        slow stop
|   /-/
0-/      1       slow start


satisfying f(0)=0, f(0.5)=0.5 and f(1)=1, and any other constraint letting me say "at T I want the cam to have done distance D". Finally, it seems the best is to "build" the function using an interpolation (I will use bernstein, that works well), where each keypoint represent a D=f(T) constraint. One can really "model" the camera behaviour with details.

Cheers,
Martin
2  Game Development / Game Mechanics / Re: Accelerate and slow down a camera move on: 2011-06-08 15:26:09
Hi,

Thanks for these suggestions. One thing I forgot to tell: I want to control the LENGTH of each animation. Up to now I check the frame rate before starting any animation, to determine the number of necessary key points required to have the choosen duration. Unless I misunderstood your suggestion, it seems to me that your solutions requires little thinking to determine acceleration and other parameters to control the number of steps.

I was thinking about using a function to shifts linear steps:
 
(1) compute the linear interpolation of the n intermediate steps. First and last point make distance D.
(2) convert each point to polar, to have a distance information from start.
(3) then each point Pi should be at distance= D*i/n from start.

(4) For this next step, the best is to normalize in [0;1], so consider distance=i/n. We will update each polar point with:
      P.radius = f(P.radius)
I thus need a function y=f(x) that gives y=0 for x=0 and y=1 for x=1, and that let me "stretch" the animation timing easily:
      f(x)=x^2 makes a simple accelerating move, x^3,4,5 will be more "sharp": slower at the beginning and faster at the end.
      f(x)=-(x-1)^2+1 makes the contrary acceleration: fast at the beginning, slow at the end. One must have an even pow value.

so I better need a normalized sigmoïd function. I will tell you if I find a good candidate for this method Smiley

It is a little mangled, but allows to customize speed variation easily! Maybe there are some other more straightforward methods.

Cheers,
Martin
3  Game Development / Game Mechanics / Re: Bullet Angles on: 2011-06-08 14:42:36
Hi!
I have implemented the method that indicates the full polar coordinate (with angle in [0;2*PI]) of an input coordinate, which could be mouse-bob in your case.
Search for Coord2d.fullPolar() here: http://code.google.com/p/jzy3d/source/browse/branches/0.8.1/src/api/org/jzy3d/maths/Coord2d.java

I use it a lot and it works as expected.
Cheers,
Martin
4  Game Development / Game Mechanics / Accelerate and slow down a camera move on: 2011-06-08 02:39:34
Hi folks,
I have a 2d scene, and do camera moves between two given points by simply defining N equal intermediate steps along the line formed by the start and stop point.
I'd like to accelerate at the beginning and slow down at the end. Do you have any suggestions to do that smartly?
Cheers,
Martin
5  Java Game APIs & Engines / Engines, Libraries and Tools / A complete 3d API for plotting surfaces, scatters, etc on: 2011-06-08 02:21:07
Hi all,
I guess this place is better to advertise than the "shared code" section of this forum:
Jzy3d is an open source library that let you easily plot simple 3d for reviewing scientifical data:
http://code.google.com/p/jzy3d/
Cheers,
Martin
6  Game Development / Shared Code / Re: A complete 3d API for plotting surfaces, scatters, etc on: 2011-06-08 02:16:12
jzy3d is an excellent library, it is already used in commercial products. It uses JOGL as a Java binding for OpenGL. It is quite complete and it is not very complicated to use. I hope it will go further in graph rendering and 2D/3D mixing.

Thanks for your support! Yes Jzy3d goes further with great new features still under development. Feel free to follow http://twitter.com/#!/jzy3d to get notified on new features.
Cheers,
Martin
7  Game Development / Shared Code / Re: A complete 3d API for plotting surfaces, scatters, etc on: 2011-04-19 14:51:38
Mm, I thought it was for graphics, but you're right, we're not on java-graphics.org Smiley
Cheers,
Martin
8  Game Development / Shared Code / Re: Astar Pathfinding on: 2011-04-19 14:44:16
That's what I did :/
I will tell you if I find the reason.
Cheers,
Martin
9  Game Development / Shared Code / A complete 3d API for plotting surfaces, scatters, etc on: 2011-04-10 16:58:36
Hi all,
First time I see this forum, and I guess it's worth sharing a project with all of you Smiley
http://code.google.com/p/jzy3d/
Cheers,
Martin
10  Game Development / Shared Code / Re: Astar Pathfinding on: 2011-04-10 15:37:16
Hi,
When running the applet from the browser, the path does not start after the two clicks.
When building and running from sources, the pathfind returns a null path at the following call Sad

GridPath aPath = pathfinding.getPath(mouse.getStart(), mouse.getEnd(), draw.getMap());

Any suggestion to have the demo running?! It seems great!
Cheers Smiley
Martin
Pages: [1]
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars and Titan!

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

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (39 views)
2013-05-17 21:29:12

alaslipknot (48 views)
2013-05-16 21:24:48

gouessej (76 views)
2013-05-16 00:53:38

gouessej (76 views)
2013-05-16 00:17:58

theagentd (84 views)
2013-05-15 15:01:13

theagentd (78 views)
2013-05-15 15:00:54

StreetDoggy (120 views)
2013-05-14 15:56:26

kutucuk (144 views)
2013-05-12 17:10:36

kutucuk (144 views)
2013-05-12 15:36:09

UnluckyDevil (154 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
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!
Page created in 0.099 seconds with 21 queries.