Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (107)
games submitted by our members
Games in WIP (534)
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]
 

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 (35 views)
2014-07-24 01:59:36

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

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

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

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

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

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

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

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

Riven (56 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!