Show Posts
|
|
Pages: [1]
|
|
1
|
Java Game APIs & Engines / Xith3D Forums / per face textures
|
on: 2004-06-06 12:26:43
|
|
hi all,
how does one use multiple textures in the way that each face has it's own image? as i see it, you can attach only one texture to an Appearance, and a Texture only contains one image.
thanks in advance, verence
|
|
|
|
|
2
|
Java Game APIs & Engines / Java 3D / constant fps strategy
|
on: 2004-06-03 15:10:19
|
it may be that this was asked before, but if, i couldn't find the thread  what are your strategies to get a constant fps rate? i'm using a typical main loop: while(running) { calculation(); renderFrame(); sync(); } except that i don't have a good strategy for sync(), and that's why i'm asking  ok, thanks in advance
|
|
|
|
|
3
|
Java Game APIs & Engines / Xith3D Forums / Re: moving Camera
|
on: 2004-06-02 21:03:16
|
sorry  , now i see nothing even in the first place. imho it has no effect on the camera movement, since lookat() is a method of the view's current transformation, which is getting overwritten by view.setTransform() during the movement. so i checked the rotation matrices before and after the movement and (surprise again) the view's orientation is different. so i just store the rotation matrix of the view everytime it rotates and do a Tranform3D.mul() everytime the view translates. it works. but now that i read that, it sounds quite obvious... hm, even einstein said that simply talking about can solve a problem  btw, does xith provide methods for "local" translations ie translations relative to the object's coordinate system (meaning that (0, 0, 1f) always moves you forward regardless how the cameras rotation is)? in plain opengl i used some simple trigs for this, but then, this was c. ok, thanks.
|
|
|
|
|
4
|
Java Game APIs & Engines / Xith3D Forums / Re: moving Camera
|
on: 2004-06-02 19:19:28
|
damn, it just won't work  ok, some code: object creation (just a cube for simplicity): 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| Geometry g = Cube.createCubeViaTriangles(0, 0, 0, 1, true); Shape3D shape = new Shape3D(g); Transform3D transform = new Transform3D(); transform.setTranslation(new Vector3f(0, 0, 4.0f)); TransformGroup transformGroup = new TransformGroup(transform); transformGroup.addChild(shape); scene.addChild(transformGroup); view.getTransform().lookAt( new Vector3f(0, 0, 0), new Vector3f(0, 0, 10f), new Vector3f(0, 1, 0) );
view.setFrontClipDistance(0.1f); view.setBackClipDistance(100f); |
so the cube is 4 units away from the view which is at the origin. but when this: 1 2 3
| Transform3D transform = new Transform3D(); transform.setTranslation(new Vector3f(0, 0, -1.0f)); view.setTransform(transform); |
gets executed (via keylistener), the cube vanishes. the view is now one unit farther away from the cube, so it should still be visible (it doesn't matter to what point the view is translated, i tried many things). is it possible that the information which way is up is somehow lost (last param from lookat())? or did i forget something?
|
|
|
|
|
5
|
Java Game APIs & Engines / Xith3D Forums / Re: moving Camera
|
on: 2004-06-02 14:58:02
|
Hi adenthar! I do like this: 1 2 3
| Transform3D transform = new Transform3D(); transform.setTranslation(new Vector3f(xPosition, yPosition, zPosition)); view.setTransform3D(transform); |
somehow this does not work for me  my initial setting for the view: 1 2 3 4 5
| view.getTransform().lookAt( new Vector3f(0, 0, 0), new Vector3f( 0, 0, 10), new Vector3f( 0, 1, 0) ); |
i can see my objects, and the current translation of the view is 0, 0, 0 (surprise). but when i do this: 1 2 3
| Transform3D transform = new Transform3D(); transform.setTranslation(new Vector3f(0, 0, 1)); view.setTransform(transform); |
i can see nothing. what did i do wrong? thanks in advance
|
|
|
|
|
7
|
Game Development / Newbie & Debugging Questions / Re: newbie question (sort of)
|
on: 2003-12-22 13:31:49
|
Whats the size of your background image (kb)? Reducing the size of the image file or tweaking the Image loading could help. it's a 30kb jpeg. but doesn't java convert it into it's own data format when it's loaded? and what do you mean by "tweaking the image loading"? i use getResourceAsStream() and a MediaTracker, but the loading time does not matter (display a fancy progress bar and the player is content  ). greets
|
|
|
|
|
8
|
Game Development / Newbie & Debugging Questions / Re: newbie question (sort of)
|
on: 2003-12-22 12:21:24
|
actually i'm doing nearly the same in my little experiment (i took a look around here before i did post  ). i was just wondering about scrolling a big background image around, which seemed a bit slow to me. hm, maybe i should use tiles for the background also. i was maybe expecting too much concerning speed  . i did a small j'n'r game ages ago in pascal on a 386dx40 in 320x200 and the background scrolling was very fast, but that was done by directly modifying the linear vga memory (mode13, $0a000 and y*320+x, these things i won't forget for a lifetime  ). as a start i wanted to create a similar game using my native tongue, because j'n'r games are so damn addictive  . greets
|
|
|
|
|
9
|
Game Development / Newbie & Debugging Questions / newbie question (sort of)
|
on: 2003-12-21 01:52:44
|
hi there, this is my first post here, so hi there  . i'm working with java for some years (server & normal gui apps), did some c++ gaming stuff (mostly 3d, using opengl, irrlicht). since i want to learn java2d and game programming (2d) in java in general, i started with a very simple experiment: a scrolling background. the render loop looks like this: 1 2 3 4 5 6 7
| Graphics g; for (int i = 0; i < 1000; i++) { g = (Graphics) strategy.getDrawGraphics(); g.drawImage(img, 0, 0, 640, 480, i, 0, i + 640, 480, null); g.dispose(); strategy.show(); } |
it runs very slow. i use a java.awt.Window with a size of 640x480. what am i wrong about? the second thing i want to ask: what is (in general) a good way or technique to do these image stuff (scrolling and drawing sprites)? i do not want to use a third-party api like gage cos i want to learn how it works  . ok, cu, verence
|
|
|
|
|