Mouse Movement

Started by san14, March 16, 2007, 06:41:53 AM

Previous topic - Next topic

Mouse Movement In JPCTDemo.java Type example

Mouse Movements
0 (0%)
Mouse Mapper
1 (100%)

Total Members Voted: 1

san14

Hi
  I am trying to implement Mouse in JPCTDemo.java type example Plz can any one help me out with suggesions or example.


With Regards
San
San14

EgonOlsen

What's the purpose of this strange poll? Anyway...basically, you've to make the mouse to be placed in the center of the screen and get the deltas in x and y direction for each frame. Divide this deltas by some value that fits your needs and your mouse speed and rotate the camera accordingly around the x- (for up/down) and y- (for left/right) axis. Then reset the mouse back to the center.
To do this in OpenGL mode, LWJGL has a mouse class. To do this in AWT/Swing, usw java.awt.robot and calculate the deltas yourself. The Paradroidz-sources include a mouse mapper that should handle most of this (the mouse management, not the rotation of the camera itself of course).

san14

Sorry for that. I did it by mistake.(Poll).

Paradroidz-sources

I tried to run but It gives message Texture not found. From where can i find texture.


With Regards
san
San14

EgonOlsen

From the actual download of the game. But that's not the point. Just have a look at  the MouseMapper. No need to run the game for this.

san14

Hi EgonOlsen


    I have extended MouseMapper to my JPCTDemo.java type example. I could get couse click and mouse draged. But I am not able to zoom in environment and turn in environment.
I get this error.


Software renderer disposed
Software renderer (OpenGL mode) initialized
117-133 -> using splitted buffer access!
Can't find desired videomode (850 x 500 x 32) - searching for alternatives
[ Mon Feb 19 06:17:32 PST 2007 ] - ERROR: Can't find any suitable videomode!
[ Mon Feb 19 06:17:32 PST 2007 ] - ERROR: Can't set videomode - try different settings!
Software renderer disposed
[ Mon Feb 19 06:17:32 PST 2007 ] - WARNING: Couldn't create LWJGL-mouse - initialize the OpenGL renderer first!


Can you suggest me how to use mouse for movement in to JPCTDemo.java type example.

With Regards
San
San14

Melssj5

850x500 is not a supported resolution, with sw rendering you can asign any size but OpenGL has predefined video modes like 800x600 or 1024x768. If you want to get the list of  supported video modes you can get them using the jpct API.
Nada por ahora

Mr.Marbles

I just came across this thread while searching for a mouse input solution which would satisfy both hardware and software rendering modes (since my AWT MouseEventListeners are useless in hardware). Is there a reason why the MouseMapper in Paradroidz hasn't be added to the latest release of jPCT? It seems like a natural thing to have in the library since KeyMapper is already there. Just a thought...

EgonOlsen

Quote from: Mr.Marbles on April 02, 2007, 03:00:29 PM
Is there a reason why the MouseMapper in Paradroidz hasn't be added to the latest release of jPCT? It seems like a natural thing to have in the library since KeyMapper is already there. Just a thought...
There was a reason for not adding it, but i can't remember it... ??? I may add it to a future release.

ToddMcF2002

If you are going to add it - please add a wrapper for CustomCursor that implements both Rendering paths.

I had a pretty harrowing time getting the lg renderer to accept the transparency and orientation of my GIFs - which also affects the offset to 2D x and y if you decide to give up and invert the GIFs like I did.