Java-Gaming.org Hi !
Featured games (81)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (576)
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
Hi,

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
Hi,

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
Hi,

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:


http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=Sound;action=display;num=1096703204
http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=Sound;action=display;num=1112588031
etc


Please everyone, can you place a vote?
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6251460

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

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
HI,
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?

thanks
9  Java Game APIs & Engines / Java Sound & OpenAL / Need a work around - 1.5 issue on: 2005-03-24 06:55:40
Hello,
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:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5070730
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 AudioClip.play() 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?

thanks.
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.

Longarmx (38 views)
2014-10-17 03:59:02

Norakomi (28 views)
2014-10-16 15:22:06

Norakomi (24 views)
2014-10-16 15:20:20

lcass (28 views)
2014-10-15 16:18:58

TehJavaDev (53 views)
2014-10-14 00:39:48

TehJavaDev (54 views)
2014-10-14 00:35:47

TehJavaDev (43 views)
2014-10-14 00:32:37

BurntPizza (64 views)
2014-10-11 23:24:42

BurntPizza (36 views)
2014-10-11 23:10:45

BurntPizza (78 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
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!