Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (753)
Games in Android Showcase (228)
games submitted by our members
Games in WIP (842)
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 / Java 2D / Re:  Calculating line intersection for a scre on: 2005-04-18 12:59:59

I used a Cohen-Sutherland algorithm to clip all the points in my polygons. This has worked perfectly. However I realise the issue is in fact the getScreenProjection algorithm.

This issue occurs the the point that needs to be mapped is either very close to the viewPoint or behind it. This gives a very laarge factor. This simple fix is to have a large viewPoint - however you then don't get the perspective look I'm after - you get a rather flat view.
Any suggestions or ideas? what do you do?

2  Java Game APIs & Engines / Java 2D / Re:  Calculating line intersection for a scre on: 2005-04-12 12:19:56

just to add - what I'm essentially after is Clipping Operations.

A clipping algorithm to  identify portions of the picture that lie inside or outside of a specified region (ie clip window).

   * Point Clipping - checking whether a single point is within the clip window
   * Line Clipping  - eliminate lines entirely outside the clip window, and calculates new endpoints for lines only partially within the clip window
   * Polygon Clipping  - calculate the boundary(s) for that part of a polygon which overlaps the clip window
3  Java Game APIs & Engines / Java 2D / Calculating line intersection for a screen view on: 2005-04-12 05:53:54

I have an issue when calculating the perspective view in my game. Most of the time it's fine, but sometimes I end up with a very large x or y value (-ve or +ve) and due to the limitations of java it flips the coordinates and I end up with a line drawing in the wrong direction.

What I would like to calculate (as part of my screen projection method) is if the point is outside the screen (lets say 600,800) I'd like to calculate the point on edge of the screen, so that the points are always between zero and the max dimension of the screen.

I thought about trying to calculate the line intersection depending which quadrant it is, but this seems messy. Is there a better way to do this?

Here's my code for reference:

 public Point getScreenProjection(Coordinates a)

   double f = (viewPoint.z - screenPlane.z) / (viewPoint.z - a.z);
   Point p = new Point();
   p.x = (int)(a.x * f + dimensions.x * .5);
   p.y = (int)(dimensions.y * .5 - a.y * f) + (int)(m_yoffset);
   return p;

The point 'dimensions' is the dimension of the screen view (ie 600,800).
4  Java Game APIs & Engines / Java Sound & OpenAL / Vote for this sound bug on: 2005-04-11 07:38:14
Hi everyone,

Ok I've got a bug opened on sun, that relates the the fact the java sound is STILL not fixed - see threads:;action=display;num=1096703204;action=display;num=1112588031

Please everyone, can you place a vote?

5  Java Game APIs & Engines / Java 2D / z-buffering on: 2005-04-04 11:44:37

is anyone using a z-buffer in there game?
I'm currently just sorting all my objects and drawing them from front to back, however I get a few strange artifacts depending on the rotation.
I'm looking a a z-buffer, but I read that they are expensive - andyone with any experience?
6  Java Game APIs & Engines / Java 2D / Re: Can't get consistent FPS in Applet on: 2005-04-04 07:41:52
But is is based on time no?
what do you mean? (sorry bit slow today)
7  Java Game APIs & Engines / Java 2D / Can't get consistent FPS in Applet on: 2005-04-01 06:55:23
Hi everyone,

I have a problem thats really starting to do my head in!  Cry
I have a online game that is run via an applet in a browser. It works OK, except that I can't get consistent timing for the FPS. It has balls which move about, but sometimes they speed up/slow down non- linear manner. When I run the same game throught AppletViewer is nice and smooth. Its only when I run in an applet I have the issues. However I'm stuck using and applet as it needs to be easy and quick to use for the online users.

The code for the thread is :

long framerate = 1000 / 30; //  frames per sec
long oldtime;
while (true) {
     oldtime = System.currentTimeMillis();

     // update object movement                        
     // draw stuff
     long currenttime = System.currentTimeMillis();
     if (currenttime - oldtime < framerate) {
     try {
           Thread.sleep((oldtime + framerate) - currenttime);
     } catch (InterruptedException e) {

Edited so say: I'm using a doubled BufferedImage to do the drawing. I'm not sure if its an issue with the consistency of the FPS or whether its the timing between calculating the movement of the objects. I'm not calling pain directly rather update() FYI.t
8  Java Game APIs & Engines / Java Sound & OpenAL / Re: Need a work around - 1.5 issue on: 2005-03-29 05:55:15
thanks for that!. I'll try this later tonight.
Quick question though - is the synchronous or asynchronous? when you call clip.start() does it reutn immeadiatly or after its finshed?

9  Java Game APIs & Engines / Java Sound & OpenAL / Need a work around - 1.5 issue on: 2005-03-24 06:55:40
this is my first post on this forum - only just found it - I shall be around more now!!
Anyhow to my issue.

You may or may not be aware of this bug:
which is meant to be fixed. However with my game it doesn't appear to be fixed Angry .

I'm using the classic Applet.getAudioClip which has been working great is earlier JVM's. My issue is that I need to play many short clips very very close together (for example balls breaking in a game of pool). Currently you are either hear silence or the occasionaly sound clip.

Reading the bug report (thats meant to be fixed but is'nt) - there is a work around using java sound (Mixers,Clip,Line,etc) - however I need to emulate the behaviour of the classic Applet.getAudioClip . - this is great as is asyncronous - every time I call it returns immeadiatly and every time I call the same instance again - it plays another sound. I find with java sound this doesn't seem possible .

Any ideas on how I can fixed my issue?

Pages: [1]
nelsongames (19 views)
2018-04-24 18:15:36

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

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

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

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

Solater (65 views)
2018-03-17 05:04:08

nelsongames (110 views)
2018-03-05 17:56:34

Gornova (175 views)
2018-03-02 22:15:33

buddyBro (730 views)
2018-02-28 16:59:18

buddyBro (93 views)
2018-02-28 16:45:17
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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!