Show Posts
|
|
Pages: [1]
|
|
3
|
Java Game APIs & Engines / Xith3D Forums / Re: Array index exception caused by TextureUnitSta
|
on: 2004-08-19 20:34:35
|
I encountered the same problem, when layering two textures. It's because the Geometry you are trying to texture only has one set of texture coords. You require 1 set of texture coords per TextureUnitState. The code that creates the Geometry would need a extra call to setTextureCoordinates, something like... 1 2 3 4 5 6
| float[] texCoords = { }; quad_data.setTextureCoordinates(0, offset, texCoords); quad_data.setTextureCoordinates(1, offset, texCoords); |
Where quad_data is a QuadArray or similar sub-class of Geometry They do seem to have omitted mentioning this in the tutorial, which I'm sure has caught out many other people
|
|
|
|
|
6
|
Java Game APIs & Engines / Xith3D Forums / Re: Incorrect Normals from ASE object
|
on: 2004-07-26 11:25:54
|
Doh I'm minutes too late!  Yes I've just discovered the convertMeshCoordinates option on the ASEReader constructor - setting it to false works for me. I have to rotate my object but thats no hassle as i was doing that for my 3DS models after importing. Thanks for the help,
|
|
|
|
|
8
|
Java Game APIs & Engines / Xith3D Forums / Re: Fog not visible
|
on: 2004-07-23 16:10:25
|
Ahhh, good to see the javadoc's make this very clear  (i fell over the same problem) - a quick line in the javadoc stating "this hasn't been implemented yet" would save a lot of people a lot of hassle finding this out I'm not having a dig has you guys do a great job, just how long would that take to do? (I mean the comment not implement the fog feature)
|
|
|
|
|
9
|
Java Game APIs & Engines / Xith3D Forums / Transparent texture overlay problem
|
on: 2004-07-22 17:46:49
|
Hi, I'm having problems with applying a transparent texture over the top of another, the effect I want is as follows:  Base Texture +  Texture Overlay (with alpha) =  Desired result I've tried what seems like every combination of TextureAttributes and various modes but no luck, surely this can be done? Here's the code I'm using 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| TextureUnitState tu0 = new TextureUnitState((Texture2D) TextureLoader.tf.getMinMapTexture("floor.jpg"), null, null); TextureUnitState tu1 = new TextureUnitState((Texture2D) TextureLoader.tf.getMinMapTexture("test.png"), null, null); TextureAttributes ta0 = new TextureAttributes(); ta0.setTextureMode(TextureAttributes.MODULATE); tu0.setTextureAttributes(ta0); TextureAttributes ta1 = new TextureAttributes(); ta1.setTextureMode(TextureAttributes.BLEND); tu1.setTextureAttributes(ta1);
appearance.setTextureUnitState(new TextureUnitState [] {tu0, tu1}); |
Can anybody help? or at least explain the setCombineAlphaMode and setCombineRgbMode methods Thanks....
|
|
|
|
|
10
|
Java Game APIs & Engines / Xith3D Forums / Re: Node.sharedCopy(..)
|
on: 2004-07-16 13:17:11
|
|
Bombadil,
Would it be possible to post or send me your code?
I thought I had a work around too, but my animations are always animating the first model loaded not the cached copies.
This is driving me nuts, yet again this seems a very common problem that lots of people must have encountered?!
|
|
|
|
|
11
|
Java Game APIs & Engines / Xith3D Forums / Re: Node.sharedCopy(..)
|
on: 2004-07-16 08:13:19
|
|
Thanks, but thats what I'm currenty doing (casting to a BranchGroup) and it's all working fine.
But the issue is - I then have a BranchGroup not a TDSModel, so I can not use any of the TDSModel methods (e.g. setCurrentFrame for animation)
I need to cast it to TDSModel not BranchGroup.
|
|
|
|
|
12
|
Java Game APIs & Engines / Xith3D Forums / Re: sharedCopy(..) and TDSModel
|
on: 2004-07-15 23:03:20
|
Hi, Just encountered this same problem with the 3DS loader. I want to load lots of the same model file and have them all over my scene. So I setup a hashmap to cache previously loaded models and I get them from there if they have already been loaded once. But doing this resulted in an exception: com.xith3d.scenegraph.IllegalSceneGraphOperation: Illegal attempt to set the parent of this Node blah blah So I tried to use sharedCopy to get copies of my model, yet I get an exception when casting from the sharedCopy call to a TDSModel. Casting to a 'plain' BranchGroup works fine, BUT I can't use any of the features of the TDSModel class (e.g. animation) that I require. Here is the working code from my ModelLoader class 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| public class ModelLoader { static HashMap cache = new HashMap(20);
static BranchGroup load(String model_file) { if(cache.containsKey(model_file)) { TDSModel mdl = (TDSModel)cache.get(model_file); return (BranchGroup)mdl.sharedCopy(mdl); } else { try { FileInputStream fis = new FileInputStream("features/"+model_file+".3ds"); TDSModel model = new TDSLoader().load("/features/", fis, true); cache.put(model_file, model); return model; } catch (IOException e) { System.out.println("Error loading 3DS model '"+model_file+".3ds'"); return null; } } } } |
If I change the line return (BranchGroup)mdl.sharedCopy(mdl); to return (TDSModel)mdl.sharedCopy(mdl);I get the ClassCastException.... Help! Any ideas as I REALLY need to cache my models like this, it geatly improves load time and memory usage (I noticed at least 16mb was saved in one small test) Ben
|
|
|
|
|
13
|
Java Game APIs & Engines / Xith3D Forums / Re: Problem with PointLight
|
on: 2004-07-15 22:32:51
|
Could be a specularity (shiny-ness) problem with (large) white highlights showing over the whole object making them appear white. Here's some code for a completely non-specular material 1 2 3 4 5 6
| Material matt_basic = new Material(); matt_basic.setAmbientColor(1f, 1f, 1f); ; matt_basic.setDiffuseColor(1f, 1f, 1f); matt_basic.setShininess(0.00f); matt_basic.setSpecularColor(0.00f, 0.00f, 0.00f); matt_basic.setLightingEnable(true); |
|
|
|
|
|
14
|
Java Game APIs & Engines / Xith3D Forums / Re: PointSound problem
|
on: 2004-07-09 17:02:06
|
|
aNt - Hi, that FMOD looks interesting, as I've got problems with JOAL in Xith3D (it's just seems really buggy) I'd like to try it.
The API looks a little confusing, any code snippets to get started (say a single 3d point sound looping)?
|
|
|
|
|
16
|
Java Game APIs & Engines / Xith3D Forums / Incorrect Normals from ASE object
|
on: 2004-07-09 11:34:22
|
Hi, I want to load some ASE models into my game, but they appear to be loading with incorrect normal information, as the screenshot below demonstrates. (The cylinder was created in 3D Studio Max) I noticed that the world coords in 3D Studio have Z as the vertical axis. In Xith Y is the vertical axis (i.e. Xith is left handed and 3dStudio is right handed). I think this is the root of the problem, any ideas how to solve or get around this?  Surely I'm not the first person to have seen this? I've tried swapping the Z and Y coords in the ASE file that hasn't helped. Cheers Ben
|
|
|
|
|
17
|
Java Game APIs & Engines / Xith3D Forums / Re: Mouse cursor/pointer problem
|
on: 2004-07-08 20:22:58
|
Solved it ! All it needed was to call setCursor on the component of the CanvasPeer, bit of a guess but it worked! Assuming CanvasPeer is called "canvas_peer" 1 2 3 4
| Toolkit tk = Toolkit.getDefaultToolkit(); Cursor cursor = tk.createCustomCursor(tk.getImage("flask.png"), new Point(0, 0), "blah"); canvas_peer.getComponent().setCursor(cursor); |
Ben
|
|
|
|
|
18
|
Java Game APIs & Engines / Xith3D Forums / Re: Moving the camera/player a fixed distance
|
on: 2004-07-07 22:20:35
|
|
java - I could have move the camera a fixed distance and turned it 90 degrees without much problem at all.
What I wanted was the player/camera to move and turn smoothly between these fixed interval grid points and not stop anywhere between.
In retrospect I probably wasn't that clear in my post... Oh well it's fixed now
Thanks for your interest, Ben
|
|
|
|
|
21
|
Java Game APIs & Engines / Xith3D Forums / Re: Moving the camera/player a fixed distance
|
on: 2004-07-05 06:11:52
|
|
Hi,
It would be nice to have something in the main Xith API for this. In the mean time I have solved my problem. It all stemmed really from using someone else's class and changing it to suit my needs.
Once I wrote my own camera class from scratch I got it working. Happy to sumbit my code here for people to use but I suspect it's a bit too specialised. I'll be putting all my work on my website soon anyhow.
Thanks, Ben
|
|
|
|
|
22
|
Java Game APIs & Engines / Xith3D Forums / Re: Moving the camera/player a fixed distance
|
on: 2004-07-02 11:39:47
|
|
OK, no closer to a solution, I still end up jigging the player about when they stop to re-center them on the grid, it looks really wrong.
I'm a bit frustrated that Xith3D has no real avatar/camera etc classes. Surely moving a camera around is standard stuff that all games require... Yet there is no support for it.
Every thing seems such hard work, and I have to write everything myself. I know I should be ashamed but I'm considering moving to Dark Basic or something....
|
|
|
|
|
24
|
Java Game APIs & Engines / Xith3D Forums / Moving the camera/player a fixed distance
|
on: 2004-07-01 19:40:54
|
Hi, I know I seem to be posting more questions than answers, hopefully that will change soon! The requirement for my game is that the player (camera) moves set distances on a grid of 'cells' (to reproduce the movement on old games like Dungeon Master). I'm using a modified version of the MovementForce class I found as part of a Quake3 bsp demo (also used in the Maze3D demo) to move about. A quick screen shot might explain what I'm on about  I've messed about all day trying to stop the force after moving a certain distance, the problem is I either end up overshooting that distance by some small ammount, this error adds up and up and I end up not in the center of my "grid" of cells anymore. No ammount of correcting helps this. I have no need for the CollisionSystem as I know if the character is going to hit a wall from the 2D map array I have. I understand this is a very specific problem but any clues, the best way to move a character an exact set distance? Thanks, Ben
|
|
|
|
|
25
|
Java Game APIs & Engines / Xith3D Forums / Re: fullscreen?
|
on: 2004-07-01 19:04:21
|
Hi, I noticed that Full Screen didn't actually fill the screen but simply removed the window borders, it'll only be "genuine" full screen if you set the resolution of your CanvasPeer to that of the desktop. Here's how I do it in my app 1 2 3 4 5 6 7 8 9 10 11 12 13
| public static int SCR_WIDTH = 800; public static int SCR_HEIGHT = 600; public static final int SCR_DEPTH = 32; public static final boolean SCR_FULL_SCREEN = false;
if(SCR_FULL_SCREEN) { Dimension scr_sz = Toolkit.getDefaultToolkit().getScreenSize(); SCR_WIDTH = scr_sz.width; SCR_HEIGHT = scr_sz.height; }
RenderPeer rp = new RenderPeerImpl(); CanvasPeer cp = rp.makeCanvas(null, SCR_WIDTH, SCR_HEIGHT, SCR_DEPTH, SCR_FULL_SCREEN); |
Hope that helps.
|
|
|
|
|
27
|
Java Game APIs & Engines / Xith3D Forums / Simple Geometry Utils
|
on: 2004-06-30 15:30:49
|
Hi, I require some simple geometry utility classes for generating planes, cylinders etc. (planes to beging with) I've tried the TestUtils class but all it can generate is one big quad as the plane, this is messing with my lighting  so I need to tesselate the plane into sub-quads or triangles. I'm tying to write a class, what is the best Geometry class to use for this sort of thing (QuadArray, TriangleArray or something else)? Are there any docs on the format that QuadArray and Triangle array expect their data?  If something exists out there to already do this I'd gladly use that! I can't be the first person to have required this... Cheers, Ben
|
|
|
|
|
28
|
Java Game APIs & Engines / Xith3D Forums / Re: Problem with PointLight
|
on: 2004-06-30 08:02:02
|
Thanks, I was simply using the X part (constant attenuation) I didn't know Y, Z did anything! I've changed to quadratic distance (Z) and it's looking a lot better, I need to play about with the values and the ambient light to get it looking 100% as I want. Here's a new screen shot Thanks a lot!
|
|
|
|
|
29
|
Java Game APIs & Engines / Xith3D Forums / Problem with PointLight
|
on: 2004-06-29 22:55:28
|
Hi, I have been playing about with Xith3D for a couple of days writing a Dungeon Master clone, and I've got a tiny problem with using PointLight. I have a PointLight at the same location as the View eye, which moves with the player (representing a torch carried by the player). I want this to only illuminate a small "pool" of light arround the player, the problem is that far away walls are still being lit brightly looking very odd. See this screenshot for details - Any ideas how to prevent this? I've tried adding a BoundingSphere to the light and changing the attenuation but none of this has helped. BTW - I know the graphics and math theory why this happening but I don't know how to stop it in Xith3D Any help very much appreciated, cheers Ben
|
|
|
|
|
|
Add your game by posting it in the WIP section,
or publish it in Showcase.
The first screenshot will be displayed as a thumbnail.
|
|