Show Posts
|
|
Pages: [1]
|
|
2
|
Java Game APIs & Engines / Xith3D Forums / Will Xith3D utilise java 1.5 features soon?
|
on: 2004-03-06 15:30:19
|
|
Hello again, just wondering if Xith3D will make some changes since 1.5 beta released with load of new features, like in the Group class changing from an ArrayList of objects to an ArrayList of Group's/Nodes and all of thous constants, into logically grouped enum would be quite cool and great step ahead of java3d
|
|
|
|
|
3
|
Java Game APIs & Engines / Xith3D Forums / Re: There is definately something wrong with eithe
|
on: 2004-03-06 14:31:35
|
|
"Feck", i found out what the problem was now, i never created the geometry someone on the net did, when i checked it out the file in 3DS Max all the object's local co-ordinate systems where not centered to the object's center, they where all at the worlds origin so i adjusted the all the objects pivot points to the object's center and everything is fine now thats been doing in me for ages, feck ill make the geometry myself from now on lol.
Sorry for pointing the blame on Xith3D :-/ case closed.
|
|
|
|
|
4
|
Java Game APIs & Engines / Xith3D Forums / There is definately something wrong with either...
|
on: 2004-03-06 11:33:17
|
|
There is definately something wrong with either the getLocalToVworld() method or the ASE file loader, you can get the absolute position of an object from its bounding sphere's center but if you try to get the original translation transform of the geometry made in the 3D modeller, even when the nodes are live from root to the most bottom child all the transforms are at identity, this causes me alot of problems because i use the center of the bounding sphere as my position so if the position has been updated and set the translation of a transformGroup (the correct way aswell) instead of staying in the position its translating from (0, 0, 0) to the where ever the bouding sphere's center is which is not correct. for example one of the geometry in my app its bounding sphere's center is
(2.1570811, 20.593824, -18.71343)
which is the correct center when i check in 3DS Max, there for there should be a translation matrix with something like this:
(1, 0, 0, 2.1570811) (0, 1, 0, 20.593824) (0, 0, 1, -18.71343) (0, 0, 0, 1)
some where in the tree but i can't find it in any node, i've even tried messing around with the flags of the AseFile object and still the same all node's transform matrices at identity. I've read all simillar post's with simillar problems and tried the solutions but still the same problem, am i not getting something here i just dont get it
|
|
|
|
|
6
|
Java Game APIs & Engines / Xith3D Forums / Re: the center of geometry with bounding sphere
|
on: 2004-03-04 11:17:40
|
Hi,
Bounding sphere defines shape bounds in local coordinate system (i.e. the same coordinate system where shape vertices are defined).
If you want to determine center of bounding shpere in Vworld coordinates, you can use Node.getVworldBounds() (you can use this even for groups).
If you want to do something different, you have to check the structure of your scenegraph and apply appropriate transforms either to local bounds, or to vworld bounds (your choice).
Yuri
Thanks for replying, still wondering about something, once i get the center position from the bounds, when the geometry is suppose to move after the position is updated, where do i apply the translation? after i've loaded the data from the ase file, i attach a named node to a BranchGroup and then attach the BranchGroup to a TransformGroup so i can move it around, when i update this TransformGroup to the center position that i obtained from the bounds its not correct, when i print out the value of the Matrix contained in that TransformGroup before applying the transformation, its at identity, so i guess must be the local coordinate system, where should i apply the translation at the most top node?
|
|
|
|
|
8
|
Java Game APIs & Engines / Xith3D Forums / the center of geometry with bounding sphere
|
on: 2004-03-03 08:06:41
|
Hi, basically in my pool game i'm using the geometry from a ASE file that someone else made, with the pool balls i need to get the center of the ball to set the center of mass 4 my physics calculations so what i do is i get the bounds of the ball, cast to a bounding sphere and get the center from there but in my game loop when i set the translation transform to that center when it isn't moving, its gets moved to the incorrect place here is snippet of what i'm doing: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| TransformGroup tg = (TransformGroup)namedNodes.get("poolball1")
Shape3D visualBall = (Shape3D)b.getChild(0);
bounds = visualBall.getBounds();
Vector3 centerOfGravity = new Vector3f(((BoundingSphere)bounds).getCenter());
Transform3D trans = tg.getTransform(); trans.setTranslation(centerOfGravity);
tg.setTransform(trans); |
one ball is placed correctly but the rest stay in the wrong position, i guess ill have to do it the hard way and get the geometry and calculate the center myself?
|
|
|
|
|
11
|
Java Game APIs & Engines / Xith3D Forums / Re: glActiveTextureARB not supported on uni's PCs
|
on: 2004-02-23 16:32:59
|
|
RR i didn't notice the version there. I was afraid this would happen there would be no way i'd be allowed to update the drivers of the uni's computers, and i doubt they would do an update to all the computers while classes are running just 4 my project. So i'm pretty much stuffed unless i can change some settings in Xith3D is this a possiablity?
|
|
|
|
|
12
|
Java Game APIs & Engines / Xith3D Forums / glActiveTextureARB not supported on uni's PCs
|
on: 2004-02-23 11:35:27
|
|
Hi i'm using Xith3D for my final year project and i've been making the project at home which runs fine on my computer but when i tested it on the uni's computers (with all the lib jars and dll's visiable) its starts up by showing a JFrame then exits an exception message about an opengl extension not on the PC's but i'm not using any extensions at the mo, i guess its Xith3D using them, is there any where i can get the program to run on the uni's computers so i can show it at my presentation please help, the exception message is:
Init GL is net.java.games.jogl.impl.windows.WindowsGLImpl OpenGL Renderer = GDI Generic OpenGL Version = 1.1.0 OpenGL Vendor = Microsoft Corporation OpenGL Extensions = GL_WIN_swap_hint GL_EXT_bgra GL_EXT_paletted_texture net.java.games.jogl.GLException: Method "glActiveTextureARB" not available at net.java.games.jogl.impl.windows.WindowsGLImpl.glActiveTextureARB(Win dowsGLImpl.java:94) at com.xith3d.render.jogl.TextureShaderPeer.shade(TextureShaderPeer.java :668) at com.xith3d.render.CanvasPeerBase.setState(CanvasPeerBase.java:121) at com.xith3d.render.CanvasPeerBase.render(CanvasPeerBase.java:99) at com.xith3d.render.jogl.CanvasPeerImpl.drawBin(CanvasPeerImpl.java:678 ) at com.xith3d.render.jogl.CanvasPeerImpl.display(CanvasPeerImpl.java:849 ) at net.java.games.jogl.impl.GLDrawableHelper.display(GLDrawableHelper.ja va:74) at net.java.games.jogl.GLCanvas$DisplayAction.run(GLCanvas.java:194) at net.java.games.jogl.impl.GLContext.invokeGL(GLContext.java:192) at net.java.games.jogl.GLCanvas.displayImpl(GLCanvas.java:182) at net.java.games.jogl.GLCanvas.display(GLCanvas.java:82) at com.xith3d.render.jogl.CanvasPeerImpl.render(CanvasPeerImpl.java:950)
at com.xith3d.scenegraph.View.renderOnce(View.java:732) at com.xith3d.scenegraph.View.renderOnce(View.java:665) at JavaPool.run(JavaPool.java:215) at java.lang.Thread.run(Thread.java:534)
P.S: i'm also using the xith3D 3DS loader aswell if that makes any difference, maybe when it loads the textures its using that extension?
|
|
|
|
|
13
|
Java Game APIs & Engines / Xith3D Forums / Is it worth it?
|
on: 2004-02-06 07:23:38
|
|
Hi i wont to create a online 3D Pool game for my final year project, basically my project is about the current state of advanced java games development (which is looking really bright), i've used jogl before but i think with the amount of time i have i think it would be more productive to use a scene graph thus Xith, also i wont to have sound & music support so Xith seems even more compelling to use with Joal & JavaSound support in the scene graph. i already have the geometry for the pool table, balls and cue its in 3DS format, how good is the 3DS Loader in Xith?
|
|
|
|
|
14
|
Java Game APIs & Engines / JOGL Development / how do i use sub - texture of an existing texture
|
on: 2003-11-25 12:58:58
|
|
Hi i'm loading in one 256 x 256 texture into the card with glTexImage2D() and then i create a texture object with 3 IDs that i bind with three 64 x 64 subtextures of the large texture but its not working or i'm doing something wrong can someone have a look and tell me if this is correct please cheers.
This is from the init() method :
gl.glEnable(GL.GL_TEXTURE_2D); gl.glShadeModel(GL.GL_SMOOTH); gl.glClearColor(0.0f, 0.0f, 0.0f, 1.0f); gl.glHint(GL.GL_PERSPECTIVE_CORRECTION_HINT, GL.GL_NICEST);
gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE); gl.glEnable(GL.GL_BLEND);
gl.glPixelStorei(GL.GL_UNPACK_SWAP_BYTES, GL.GL_TRUE); gl.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, 1); gl.glTexImage2D(GL.GL_TEXTURE_2D, 0, 4, 256, 256, 0, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, img); gl.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_S, GL.GL_CLAMP);
gl.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_T, GL.GL_CLAMP);
gl.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR);
gl.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_LINEAR); gl.glGenTextures(3, textureIDs); gl.glBindTexture(GL.GL_TEXTURE_2D, textureIDs[0]); gl.glTexSubImage2D(GL.GL_TEXTURE_2D, 0, 0, 0, 64, 64, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, img);
gl.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_S, GL.GL_CLAMP);
gl.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_T, GL.GL_CLAMP);
gl.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR);
gl.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_LINEAR); gl.glBindTexture(GL.GL_TEXTURE_2D, textureIDs[1]);
gl.glTexSubImage2D(GL.GL_TEXTURE_2D, 0, 64, 0, 64, 64, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, img); gl.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_S, GL.GL_CLAMP);
gl.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_T, GL.GL_CLAMP);
gl.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR);
gl.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_LINEAR);
gl.glBindTexture(GL.GL_TEXTURE_2D, textureIDs[2]); gl.glTexSubImage2D(GL.GL_TEXTURE_2D, 0, 128, 0, 64, 64, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, img);
gl.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_S, GL.GL_CLAMP);
gl.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_T, GL.GL_CLAMP);
gl.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR);
gl.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_LINEAR);
/////////////////////////////////////////////////////////////////////////////
And this is part of the display method to draw one of the sub textures onto a quad:
gl.glClear(GL.GL_COLOR_BUFFER_BIT); gl.glBindTexture(GL.GL_TEXTURE_2D, textureIDs[currentTexID]);
gl.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); gl.glBegin(GL.GL_QUADS); gl.glTexCoord2f(0.0f, 0.0f); gl.glVertex2i(0, 0); gl.glTexCoord2f(0.0f, 1.0f); gl.glVertex2i(0, 64 - 1); gl.glTexCoord2f(1.0f, 1.0f); gl.glVertex2i(64 - 1, 64 - 1); gl.glTexCoord2f(1.0f, 0.0f); gl.glVertex2i(64 - 1, 0); gl.glEnd();
gl.glFlush();
|
|
|
|
|
15
|
Java Game APIs & Engines / Java Sound & OpenAL / Re: javax.sound.sampled API - Real - Time Panning
|
on: 2003-11-13 15:25:37
|
|
The Control classes are not good at it in real time, it produces alot of hishes and clicks because its not gradually changing the samples overtime. I would use joal and jogl for my project but the requirements of my project are to get the game running on my uni's computers which 1) i doubt OpenAL will be installed on them and i wont be allowed to do it myself. 2) i did some tests and jogl doesn't display correctly. So i'm pretty much stuck with using almost pure java libs which isn't 2 bad not doing some mad 3D game here lol.
|
|
|
|
|
16
|
Java Game APIs & Engines / Java Sound & OpenAL / javax.sound.sampled API - Real - Time Panning
|
on: 2003-11-13 07:44:02
|
Hi i'm trying to map a mono sound of a character to stero by panning. I have a class that filters a stream of bytes, i can get the sample of the mono sound but i'm having problems in creating the stereo samples. Its hard for me to explain so ill paste some code here its from the class Soundfilter. This is the method i use to get the sample from bytes and works fine. public static short getSample(byte[] buffer, int position) { return (short)( ((buffer[position+1] & 0xff) <<  | (buffer[position] & 0xff)); } But if i want to put it back with a new left and right sample in new byte array of samples i have this method: public static void setSample(byte[] buffer, int pos, short leftSample, short rightSample) { buffer[pos]= (byte)(leftSample & 0xff); buffer[pos + 1] = (byte)((leftSample >>  & 0xff); buffer[pos + 2] = (byte)(rightSample & 0xff); buffer[pos + 3] = (byte)((rightSample >>  & 0xff); } Is the left and right sample in the correct position? In a 16bit sample of stereo sound does the first 2 bytes represent left sample and the next 2 bytes represent right sample?
|
|
|
|
|
18
|
Discussions / General Discussions / 2D Games jogl or awt.Graphics?
|
on: 2003-10-28 10:39:56
|
|
Hi i trying to make a gaunlet clone using jogl, i have done a lot of research i read alot about that its not worth using OpenGL for 2D as it could be slower than using awt.Graphics but then i read that people are making 2D java games with Jogl using textures for faster preformance. I dont know what the best route would be, i know some OpenGL so i'm no bothered about using it just what would be advan and disadvantages. thanks
|
|
|
|
|
|
Add your game by posting it in the WIP section,
or publish it in Showcase.
The first screenshot will be displayed as a thumbnail.
|
|