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  Java Game APIs & Engines / JInput / Re: Decreasing the sensitivity on: 2010-08-04 21:50:47
maybe...

Math.sqrt(value)

or...

Math.pow(value, 1.0 / factor)
I tried that. something like this:
1  
2  
3  
4  
   public void theta1(double x, double y){
      y = Math.pow(y,1/2);
      x = Math.pow(x,1/2);
      setTheta(Math.atan2(y, x));

My Y and X are dependant on each other.  Since they are in a ratio, theta will always be the same if x and y are being modified by the same factor
2  Java Game APIs & Engines / JInput / Decreasing the sensitivity on: 2010-08-04 21:34:25
The xbox controller is extremlly sensitive.  I was wondering how I should go about decreasing the sensitivity.  I was thinking about dividing the poll data by 2.  Would that work or is there an easier way.
3  Java Game APIs & Engines / JInput / Re: Converting xbox controller sticks to theta on: 2010-08-04 18:48:22
You are flipping the Y axis, so:
Math.atan2(-y, x);
Sorry my mistake.  I originally did that but it didn't work.  I realized it was an error in my code.
4  Java Game APIs & Engines / JInput / Re: Converting xbox controller sticks to theta on: 2010-08-04 18:01:53
hum ... inverting your Y  on calling Math.atan2 ?
Like this? Math.atan2(1/y, x)
5  Java Game APIs & Engines / JInput / Re: Converting xbox controller sticks to theta on: 2010-08-04 17:03:37
maybe because the screen Y axis grows in the oposite direction of a normal cartesian Y axis .  (i.e. moving up in your screen means decreasing Y, while in a cartesian plan it means increasing , and that is probably how the controller returns the values. )

How could this be fixed?
6  Java Game APIs & Engines / JInput / Re: Converting xbox controller sticks to theta on: 2010-08-04 15:58:17
Math.atan2 ( y, x ) returns the angle theta  .

beware of the order of the parameters, Y first, then X .

Thank you.  I feel like the y axis is inverted.  When I move the stick up it paints my arrow down.
7  Java Game APIs & Engines / JInput / Converting xbox controller sticks to theta on: 2010-08-04 15:35:45
Hi, The xbox controller has 2 analog sticks.  They output values of x and y (rectangular).  I want to convert these values to theta.  How can I do this?
8  Java Game APIs & Engines / JInput / Listener or Timer on: 2010-07-21 17:15:26
I am using a timer to refresh the polling data every 50 milliseconds.  Is there anyway to use a listener instead?
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!