Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (494)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
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] 2 3
1  Java Game APIs & Engines / Tools Discussion / swt accelerator issues on: 2007-08-31 09:32:56
hi, i've deleloping a tool in swt, using accelerators ( like ctrl+S) , this all works fine, but it looks like they overriding everything, including controls when i have a focus for instance on a textfield, and want to modify that text. is there a  workaroudn for this

regards

paul
2  Java Game APIs & Engines / Java 2D / Panoramic images on: 2007-04-02 13:07:42
I want to display panoramic images(dome pictures) in swt, but i can't find any good resources how to display them on a swt canvas, probable some sines, cosines should be involved. I know however how to display them in opengl, create sphere and texture map it, but opengl is restricted to 4096 * 4096 texturemaps, which i don't want


So What is the math behind displaying them, Smiley

Paul
3  Java Game APIs & Engines / JOGL Development / arcball question again! on: 2007-03-30 12:58:40
i have a correct working arcball, but now i want to constrain the movement to a certain axis, like the rotate tool in max/maya

paul
4  Java Game APIs & Engines / JOGL Development / glclipplane question on: 2007-02-28 22:29:50
i have a problem with the glClipplane function, i have got a 6 plane definitions, which describe a convex volume, there is nothing wrong with the plane equation i've double checked them(derived from 3 points of a polygon, each normal pointing inwards). But in short i'm writing a maya plugin, in which i really need to have those clipping planes, but since it isn't working, and in my pure java/jogl program it is, i believe it is the maya api which prohibits me to do so. So i came up with the following, not sure if it will work though, since i'm rendering a cube( 6 faces which are the clipping planes) render back faces first, with depth writing enabled, store these values, in an array, render front facing polygons also store these in an array, and then render the box into an stencil buffer, to determine the silhouette of the cube( basically drawing the front facing polygons, into the stencil buffer), in my head this should work, so i would only draw pixels that lay between the z depth of the back polys and the front polygons and also in the stencil region. would this work:) and can i do it without pixel shaders:)


Paul 
5  Java Game APIs & Engines / JOGL Development / arcball model rotation on: 2007-02-21 08:17:28
i have created an arcball control for rotating objects, it works pretty well, but the problem is i can move around this object with my arcball camera, and thus looking at an different part of the sphere, and this also means that the sphere doesn't have to be centered at the middle of the screen, and the rotation of the object is wrong, how can i implement this

Paul
6  Java Game APIs & Engines / JOGL Development / drawing origin in the upper left of the screen on: 2007-02-12 12:43:05
i want to draw the origin in the upper left of the screen,for easier moving, how can i do this, basiccaly what i want is some sort of 3d overlaying drawing
7  Java Game APIs & Engines / JOGL Development / Re: drawing a sphere always at the same size on: 2007-02-08 21:02:33
i've almost figured it out, but what i want to do is not to keep my arcball centered at the middle of te screen but it should move along with the center of the object trying to rotate, and thus there rotate around it's axis, while maintaining a constants 2d size

cheers

Paul

p.s. above code was the first incarnation, right now i'm using viewport coordinates
8  Java Game APIs & Engines / JOGL Development / drawing a sphere always at the same size on: 2007-02-08 12:41:49
i want to draw  a glu sphere(for arcball mouse control), always at the same size, no matter what the distance it is from the camera, or its location relative to the camera

i was  thinking to get the 2d postion of the sphere on the viewport(using gluUnproject) then pass this values to
a glOrtho cam:

gl.glMatrixMode(GL.GL_PROJECTION);
      gl.glLoadIdentity();
      
      gl.glOrtho(cam.getFrustLeft(),
            cam.getFrustRight(),
            cam.getFrustBottom(),
            cam.getFrustTop(),
            1, 1000);
      
      
         
      
      gl.glMatrixMode(GL.GL_MODELVIEW);
      gl.glLoadIdentity();
      

and draw it at the location that is interpolated between the viewport dimensions and the the camera frustum parameters

but i really have the idea it can be easier

any help

Paul


9  Game Development / Performance Tuning / getting xyz from a bytebuffer on: 2007-02-01 11:03:02
i have a bytebuffer this way
x, y, z <- 3 float
r, g, b<- 3 byte
x,y,z,   <- 3 float
r, g, b <- 3 byte

this are just 2 vertices i can give it directly to opengl( gldrawElements) with some stride between in
but are there methods in java to extract just the vertices.ByteBuffer.asFloatBuffer doeesn't work because
i dont store my vertices consectutive..

Chera

Paul
10  Java Game APIs & Engines / Tools Discussion / Better memory mapped buffers on: 2007-01-19 10:01:14
Because of the way java/jni treats memory mapped files i had to come with a better way of rendering/stream my pointclouds efficiently. The java memory mapped  buffers are not cleared. Even not when setting the buffers to null. the only way to free memory was to explicitly call System.gc() which is a severe penalty. so i've written a small c++ program that will let the user create a file map then map a portion of this file and finally return a bytebuffer.

this is my innermost streaming loop
int handle = DTStreamFiles.createFile(
                  sceneGraphDir + node.getDataFile(),
                  DTStreamFiles.GENERIC_READ,
                  DTStreamFiles.FILE_SHARE_READ,
                  DTStreamFiles.OPEN_EXIST,
                  DTStreamFiles.FILE_ATTRIBUTE_NORMAL);
            
            
            if (handle != -1)
            {
               int byteLength = node.wantedPoints*MathConstants.VERTEX_SIZE;
               int mapHandle = DTStreamFiles.createFileMapping(handle,
                     DTStreamFiles.PAGE_READONLY, 0, 0);
               
               if (mapHandle != 0)
               {
   
                  int valPointer = DTStreamFiles.mapViewOfFile(
                        mapHandle,
                        DTStreamFiles.FILE_MAP_READ,
                        0,
                        0,
                        byteLength);
   
                  if (valPointer != 0)
                  {
                     ByteBuffer buf = DTStreamFiles.getDirectBuffer(valPointer, byteLength);
//DO WHAT U WANT WITH THIS BUFFER it isn't valid anymore after unmapping the file

   //unmap view of file
                  DTStreamFiles.unMapViewOfFile(valPointer);
                  //close mapping handle
                  DTStreamFiles.closeHandle(mapHandle);   
               }
               //close handle
               DTStreamFiles.closeHandle(handle);


it can be found here :
http://home.hccnet.nl/pj.holverda/better_file_mapping.rar


11  Java Game APIs & Engines / JOGL Development / Re: i think you all know this(level) on: 2007-01-07 18:50:29
swt, i'm willing to share source, if anyone is interested( this is only the work of 2 weeks ) to make a full level editor/game engine texturing, lightmapping etc. etc isnt'that difficult
at all, browse my site for pictures i did 3 years ago, but recently i figured out there is also more than work;) so i started to code a small game engine again
12  Java Game APIs & Engines / JOGL Development / i think you all know this(level) on: 2007-01-07 14:26:30
just showing my latest hobby creaing a level-editor, with in build engine

http://home.hccnet.nl/pj.holverda/q3dm17.jpg


Paul
13  Java Game APIs & Engines / JOGL Development / Re: sharing gl textures(SWT) on: 2006-12-19 08:00:23
i already had that, but i found this on the internet , maybe this is causing it
https://bugs.eclipse.org/bugs/show_bug.cgi?id=136515

14  Java Game APIs & Engines / JOGL Development / Re: sharing gl textures(SWT) on: 2006-12-18 17:43:40
i can figure out one 'solution'' right now and that is to give each glcontext it's own texturemanager, but this is a waste of mony
15  Java Game APIs & Engines / JOGL Development / Re: sharing gl textures(SWT) on: 2006-12-18 08:01:53
I have multiple viewports, so i need to share the context and drawable between them i think, but don't know how

here a screenshot

http://home.hccnet.nl/pj.holverda/notextures.jpg only the first viewport has texturing(where i create my texture with glgentextures)
16  Java Game APIs & Engines / JOGL Development / sharing gl textures(SWT) on: 2006-12-17 12:05:02
How can i enable texture sharing, in swt with jogl
17  Game Development / Newbie & Debugging Questions / Re: Simple question on: 2006-11-23 16:39:46
pretty funny jar:) been playing with it for a half hour
18  Game Development / Newbie & Debugging Questions / Simple question on: 2006-11-23 09:35:54
I have 4 points definiing a simple quad(2D), but i need to order them in a counter clockwise format in order to render them properly

Paul
19  Java Game APIs & Engines / Tools Discussion / Re: Creating my own 'pak' file creator on: 2006-11-17 11:23:19
Who the hell would store ~40GB  of data in ONE file?
Beside polygons, models, textures, i'm also storing point clouds, where a single point of such an cloud consist of an
(x, y z ) (r, g, b) ( u,v ) and (normal.x, normal.y, normal.z) since this data is coming from a laser scanner it are billions of points(which are then divided in an octree)
so 40 gig is not that much

Perhaps it would make sense in this case to use a database instead of a file-structure?

How should i achieve this, right now the algorithm to load files goes like this -> determine visible nodes -> load files -> memory map them -> render
but i have no idea how to do it in say SQL or with other databases
20  Java Game APIs & Engines / Tools Discussion / Re: Creating my own 'pak' file creator on: 2006-11-17 11:21:24
i already store the leafnodes as individual files, so they would never reach the 4 gig limit
21  Java Game APIs & Engines / Tools Discussion / Re: Creating my own 'pak' file creator on: 2006-11-17 10:49:57
Who the hell would store ~40GB  of data in ONE file?
Beside polygons, models, textures, i'm also storing point clouds, where a single point of such an cloud consist of an
(x, y z ) (r, g, b) ( u,v ) and (normal.x, normal.y, normal.z) since this data is coming from a laser scanner it are billions of points(which are then divided in an octree)
so 40 gig is not that much
22  Java Game APIs & Engines / Tools Discussion / Creating my own 'pak' file creator on: 2006-11-17 08:24:38
I want to write my own pak file creator, i've searched the internet for virtual file systems and found truezip, while truezip will fullfill my needs there is one big drawback, it stores zip files up to 4 GB whereas my files tend to be a factor 10 larger. But since these files are stored in a way like this /textures/...,/pointclouds/... etcetc.
I'm wondering how difficult it can be to wrap this files in a nice pak file and browse inside this file as if it were a normal file.

any pointers?

Paul
23  Java Game APIs & Engines / JOGL Development / GLOrtho question on: 2006-11-16 09:18:29
I have an ortho camera that has it's center focussed on say (-1000, 500, -1000), where my up vector is 'z'. Now i want this camera centered on this vertex( top view) This all works so far. But i have problems with clipping everything above the z value of the vertex, right now my walls, roofs etc. etc. are also drawn. So How do i set the correct near value;
24  Game Development / Game Mechanics / finding the (shortest)line segment between to line segments on: 2006-10-25 08:16:57
i want to find the shortest line segment between to line segments, i've already calculated the shortest line segments between 2 infinite lines, but this is not excactly what i want

Paul
25  Java Game APIs & Engines / Java 2D / Re: point inside rotated ellipse on: 2006-09-28 12:17:35
Mathworld is your friend.

From a quick perusal of that page, it looks really easy to determine if a point is inside the ellipse if you know the two focus points - You simply sum the distance from the focus points to the point in question, if it's above the length of the major axis, the point lies outside, otherwise inside.

Finding the focus points also looks pretty easy. Assuming that the ellipse is centered on the origin, with the major axis on the x-axis and with length 2 * a, and the minor axis on the y-axis with length 2 * b, the two focus points lie at ( -c, 0 ) and ( c, 0 ), where c = a * sqrt( 1 - b2 / a2 ) ( I'm getting this from equations 38 and 39 ).

So, for an ellipse as you have defined it, this code (using javax.vecmath classes) should probably work
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
   /**
    * Computes the focus points of an ellipse
    *
    * @param startPoint
    *           The start of the major axis
    * @param endPoint
    *           The end of the major axis
    * @param height
    *           The height of the ellipse
    * @return A two element array, containing the focus points
    */

   public static Point2d[] computeFocusPoints( Point2d startPoint, Point2d endPoint, double height )
   {
      double a = startPoint.distance( endPoint ) / 2;
      double b = height / 2;
     
      double eccentricity = Math.sqrt( 1 - ( ( b * b ) / ( a * a ) ) );
     
      // compute the vector from the start to the first focus
     Vector2d delta = new Vector2d();
      delta.sub( endPoint, startPoint );
      delta.scale( 0.5 );
     
      assert delta.length() == a;
     
      delta.scale( 1 - eccentricity );
     
      Point2d f1 = new Point2d( startPoint );
      f1.add( delta );
     
      Point2d f2 = new Point2d( endPoint );
      f2.sub( delta );
     
      return new Point2d[] { f1, f2 };
   }


I haven't tested it, and the assert will almost certainly fail due to floating point errors, but it should get you going.

I found out myself

float a = Vector2.getDistance(end, start)*.5f;
      float b =height;
      float c = (float)Math.sqrt(a*a - b*b);
      Vector2 center = Vector2.add(end, start);
      center.scale(.5f);
      Vector2 dir = Vector2.sub(end, start);
      dir.normalize();
      dir.scale(c);
      f1 = Vector2.add(center, dir);
      dir.negate();
      f2 = Vector2.add(center, dir);
      Vector2 tmp = Vector2.sub(v, f1);
      Vector2 tmp2 = Vector2.sub(v, f2);
      float v1 = tmp.getLength();
      float v2 = tmp2.getLength();
      
      return ((v1+v2)<(2*a));




26  Java Game APIs & Engines / Java 2D / point inside rotated ellipse on: 2006-09-28 10:42:37
I have defined a ellipse like this (startPoint, endPoint) <- major axis
end a height, which is the minor axis, now how can i easily determine if a point is inside a ellipse

Pual
27  Java Game APIs & Engines / JOGL Development / performance? on: 2006-09-16 11:19:41
Recently i've ported my code to the new jogl code( jsr231) but there are some differences
in the method e.g.

   // extract the point on the far plane
      glu.gluUnProject( x,
            dClickY,
            1.0,
            mvmatrix,
            0,
            projmatrix,
            0,
            currentViewport,
            0,
            objPosFar,
            0);

after every array, there need to be stored an(index?) integer.
But what is the purpose is this, considered the fact that most arrays start at zero, and what is the overhead compared with the old standard espicially when callen 10's of thousand times a frame

tia

Pul
28  Java Game APIs & Engines / JOGL Development / Re: Getting the amount of available texture memory on: 2006-08-02 19:38:38
nothing is ever simple:), first thing that comes up into me is to, create a lots of textures and see when opengl runs out of memory,
but i consider this more as a hack, than as a proper solution. Even window$s showhs the amout of memory on the video card.
So if there are any other solutions possible i'm eager to know

Paul
29  Java Game APIs & Engines / JOGL Development / Getting the amount of available texture memory on: 2006-08-02 10:01:13
can i query this via jogl, or java.system?

Tia

Paul
30  Java Game APIs & Engines / JOGL Development / culling individual vertices( e.g. GL_POINTS) on: 2006-07-24 13:00:15
i want to cull individual vertices of a vertices array. But glNormalPointer doesn't seem to work for them, however i've reconstructed valid normals, since when putting lighting on the correct Points lit up.  How can i 'discard' back 'pointing' Points


Paul
Pages: [1] 2 3
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Dwinin (22 views)
2014-09-12 09:08:26

Norakomi (55 views)
2014-09-10 13:57:51

TehJavaDev (66 views)
2014-09-10 06:39:09

Tekkerue (33 views)
2014-09-09 02:24:56

mitcheeb (54 views)
2014-09-08 06:06:29

BurntPizza (38 views)
2014-09-07 01:13:42

Longarmx (24 views)
2014-09-07 01:12:14

Longarmx (30 views)
2014-09-07 01:11:22

Longarmx (28 views)
2014-09-07 01:10:19

mitcheeb (37 views)
2014-09-04 23:08:59
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

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!