Show Posts
|
|
Pages: [1]
|
|
1
|
Java Game APIs & Engines / Xith3D Forums / Re: Functional Background Node
|
on: 2004-08-22 03:23:52
|
|
Thanks.
I have another question. I use the classes : com.xith3d.io.ScribeInputStream com.xith3d.io.ScribeOutputStream com.xith3d.io.Scribe com.xith3d.io.ScribeGeometryArray
Can you free them from 'Log4j.jar', so xith3d-user must not send this jar also with his examples? (It's only 2 lines per class that have references to class 'org.apache.log4j.Category' from Log4j.jar ) Thanks.
Adi
|
|
|
|
|
2
|
Java Game APIs & Engines / Xith3D Forums / New xit3d -> HINT for textureloader
|
on: 2004-08-21 21:47:10
|
|
Changing xith3d.jar from Xith3D_2004-05-03_cvs to Xith3D_2004-07-28_cvs lets show my graphic a bit different. There must be a change in the TextureLoader-class.
A call (in Xith3D_2004-05-03_cvs):
Texture2D tex = (Texture2D) TextureLoader.tf.loadTexture( bImage, "RGB", false, Texture.NICEST, Texture.NICEST, Texture.WRAP );
does not the same how in Xith3D_2004-07-28_cvs. A change in the second parameter must be done, to fix this problem :
Texture2D tex = (Texture2D) TextureLoader.tf.loadTexture( bImage, "RGBA", false, Texture.NICEST, Texture.NICEST, Texture.WRAP );
|
|
|
|
|
3
|
Java Game APIs & Engines / Xith3D Forums / Re: Functional Background Node
|
on: 2004-08-21 20:13:44
|
|
Hello Will
Putting a geometry in a background node results in some positions to a SingularMatrixException. (I have bypassed this problem by creating a 'normal' node). As far as i can overview, it comes from class 'View'. If a geometry was added in a background node, with it's method 'setGeometry', then automatically during rendering there was a call to method 'getBackgroundTransform()' from class 'View',that sometimes results in a SingularMatrixException.
(I don't understand, why in this method an inverted matrix is required.) Bye Adi
|
|
|
|
|
5
|
Java Game APIs & Engines / Xith3D Forums / Re: What i have learned from Xith3D.....
|
on: 2004-07-23 21:13:50
|
|
Hello Kev
Your Question : <<"Why not seperate your visualisation from your simulation?">> i have tried, and it works. Good, i have not an 1:1 representation between simulation- and visualisation-datas, but it works.
However, i think it was not the worst, if someone could compile xith3d for floats or doubles. (It makes migration to xith faster, i think).
Thanks for your advice and also to all others.
Adi
|
|
|
|
|
7
|
Java Game APIs & Engines / Xith3D Forums / Re: What i have learned from Xith3D.....
|
on: 2004-07-23 00:43:10
|
|
Hello Kev
I think my card is ok.(I have a NVIDIA GeForce FX 5700 Ultra with 128 MB).
Alas, i already have minimized all my distances with a scaled factor of 0.000016f . (Because, alone the distance from sun to pluto is in reality 5869660000.0 km (kilometers).) This results in a distance, in my system, to ~93914.0f. Now, when my (constant) speed is e.g. 1500.0f km/second (very fast), the way that i make in a second underlies also this scaled factor, so i got ~0.024 km in my system. Further on, i must divide this value with my framerate e.g 64. I got now 0.000375f km per frame.
Now, i have the problem to add 93914.0f + 0.000375f. Adding this as double is simple, i always get the correct sum. But this (double) sum i can't put as 93914.000375f in a float. Also, i must work with a realistic acceleration, so it takes a long time until i have reached such a speed, that an addition takes effect.
Or have i overseen something?? What do you mean about that??
Bye Adi
|
|
|
|
|
8
|
Java Game APIs & Engines / Xith3D Forums / What i have learned from Xith3D.....
|
on: 2004-07-22 18:45:23
|
|
I have ported a bigger program from java3d to xith3d. Almost what i can do in java3d, i can do with xith3d. Absence behaviors in xith3d was not a trouble. Working with overlays in java3d is a nightmare (synchronisation problems), not in xith3d (mostly). A bigger disadvantage in xith3d is the missing 'Text2D-' and 'Text3D-' classes in the core API. But the main disadvantage from xith3d is, it is complete useless for simulations. Why that??? Xith3d calculates all with floating points. My program is a solar system simulator with real datas that must calculate with big and small datas. The precesion from floating points is to low for such a program, i must say. (Look at a sum from a floating point value greater than 2048.0f and a floating point value lower than 0.0001f and you know what i mean. In doubles, the sum is correct!). My conclusion is, xith3d is a good API for games, but a bootleneck for simulations. That is, what a have learned.
Bye Adi
|
|
|
|
|
9
|
Java Game APIs & Engines / Xith3D Forums / Re: Geometry and Light
|
on: 2004-07-19 20:33:29
|
|
Hello Adenthar
I use my own primitives. Sphere with trianglegeometry or sphere with quadarraygeometry. I have no idea, how i can integrate an image here, so i can show you an example. Also you must do a correct setting for Textureattributes, Light and Material (for your Appearance). ( HAVE YOU SET THE FLAG 'GeometryArray.NORMALS' IN YOUR GEOMETRY???). e.g.
int features = ...............; final int FLAGS = GeometryArray.COORDINATES | (features&GeometryArray.NORMALS) | (features&GeometryArray.TEXTURE_COORDINATE_2); ............................. TriangleArray geom = new TriangleArray( maxPoints, FLAGS ); geom.setCoordinates(0, vertex); if ( (FLAGS&GeometryArray.NORMALS)!=0 ) geom.setNormals( 0, vertex ); ............................
Then all works fine in Xith.
Bye Adi
|
|
|
|
|
12
|
Java Game APIs & Engines / Xith3D Forums / Re: Problem with PointLight
|
on: 2004-07-15 20:39:11
|
|
Hello
Thanks for your help.
Normally, a SpotLight is good, but a sun in a solarsystem shines in all directions, not in a specific one, how a SpotLight does.
If i have no light integrated, all is highlighted. Normally, my textured planets cannot be seen, without a lightsource.
I only have one lightsource, (sitting in the center, the sun), but the lightsource is sitting on my position, i think. When i change my lightsource to red, with a simple rotation, i can see that the color from the lightsource changes from red to white, but i have only that red color light. What can it be??? Bye Adi
|
|
|
|
|
13
|
Java Game APIs & Engines / Xith3D Forums / Re: No, not so
|
on: 2004-07-11 14:11:55
|
Hello The light intensity must be grow weaker in the distance, e.g. for (0.0f<=distance<=1.0f) R = i*a.x + i*a.y*d + i*a.z*(d*d) is ok, but for (distance>=1.0f) R = i*a.x + i*a.y/d + i*a.z/(d*d) is correct. Also, there is a difference between 'java3d' and 'xith' in 'setAttenuation(new Point3f(1f, 1f, 0f))'. In 'java3d' you can set : setAttenuation(new Point3f(1f, 0f, 0f)) or setAttenuation(new Point3f(0f, 1f, 0f)) or setAttenuation(new Point3f(0f, 0f, 1f)) but not 2 values concurrently, how setAttenuation(new Point3f(1f, 1f, 0f)) A Problem what i have with a PointLight in xith is. that i can't set it corretly. Normally, under a pointlight, one half from a sphere must be highlighted and the other not. (There a no reflections from a side, and the own shininess from the sphere is very low) My question is: " How can i set a pointlight correct, so one half from a sphere is highlighted and the other not?  " Thanks Adi
|
|
|
|
|
14
|
Java Game APIs & Engines / Xith3D Forums / View and background (awfull crash)
|
on: 2004-06-14 14:37:42
|
Hello (Excuse me, my english are not the best.) From class View, method getBackgroundTransform() i always got a SingularMatrixException. I only use orthogonal matrixes, so that an inverted matrix can't be singulär. The exception occurs mostly, if a have rotated to a angle of PI (3,14..). On this angle (or nearby) also the 'FieldOfView' for the background changes dramatically The code (from Xiith3d) is: Quat4f rot = new Quat4f(); Matrix4f translateMatrix = new Matrix4f(); Matrix4f rotMatrix = new Matrix4f(); public Transform3D getBackgroundTransform() { rotMatrix.setIdentity(); translateMatrix.setIdentity(); getTransform().get(rot); rotMatrix.set(rot); // Why that?  ? translateMatrix.set(new Vector3f(0, 4f, 0)); rotMatrix.mul(translateMatrix); backgroundTransform.set(rotMatrix); // I know, if the determinant from rotMatrix // is zero, there is no inverted matrix from rotMatrix // If rotMatrix a product from 2 orthogonal // matrixes, how it is possible, that rotMatrix // can have a determinant that is zero??? backgroundTransform.invert(); backgroundTransform.transpose(); return backgroundTransform; } Is there another solution for that problem??? What can i do?? Or have i overseen something?? That problem occurs only, if i use a background.
|
|
|
|
|
16
|
Java Game APIs & Engines / Xith3D Forums / D.Yazel@ Problem 'com.xith3d.io.ScribeInputStream'
|
on: 2004-05-22 09:19:02
|
|
1) To use the class 'com.xith3d.io.Archive', i must create a 'com.xith3d.io.Scribable' -Object. For that, i also must convert my Texture in a BufferedImage. Now, many pictures and textures are from type 'BufferedImage.TYPE_CUSTOM'. With that stored type under 'com.xith3d.io.ScribeOutputStream', the ScribeInputStream fails, because BufferedImages can not been created back with that type.
2) Another problem is the method close() (throws an exception) from class 'com.xith3d.io.Archive' after a read. I think there was a closed stream, before this method can do this.
3) Also a problem that occurs is , if i convert an BufferedImage to a texture, the complett texture was flipped from Bottom to Top.
Before i write the datas to the ScribeOutputStream, i must call BufferedImage bi=TextureLoader.tf.flipImageVertical(bi); I think, with converting the datas from a BufferedImage to a Texture the used ImageComponent2D flips the image from Bottom to Top. // Read in from 'ScribeInputStream in' int w = in.readInt(); int h = in.readInt(); //Reading in datas, are correct.I have proofed this. int[] pixels = in.readIntArray(); BufferedImage bImage = new BufferedImage( w, h, BufferedImage.TYPE_INT_ARGB ); bImage.setRGB(0, 0, w, h, pixels, 0, w ); Texture2D tex = (Texture2D)TextureLoader.tf.loadTexture( bImage, "RGB", false, Texture.NICEST, Texture.NICEST, Texture.WRAP ); //The next can flip the Image from Top to Bottom tex.setImage(0, new ImageComponent2D(ImageComponent.FORMAT_RGBA, w, h, bImage));
Beside that, it is good component !!
|
|
|
|
|
18
|
Java Game APIs & Engines / Xith3D Forums / Need help with texture!
|
on: 2004-05-11 19:34:07
|
|
Hi
I have a sphere class (not indexed) that gives me back a Shape3D-Object. Now with
TexCoordGeneration texGen = new TexCoordGeneration( TexCoordGeneration.SPHERE_MAP, TexCoordGeneration.TEXTURE_COORDINATE_2 );
i apply it to the used Appearance and all works fine. I see my sphere with the right texture.
The problem is, i rotate the sphere but the texture stands still and does not follow the rotation from my generated Shape3D.
What can it be? I'm very happy for a hint to this problem. Bye
|
|
|
|
|
|
Add your game by posting it in the WIP section,
or publish it in Showcase.
The first screenshot will be displayed as a thumbnail.
|
|