Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (539)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (603)
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]
1  Java Game APIs & Engines / Java 3D / Re: Simple question: Is there a way to find which direction the camera is facing? on: 2007-04-28 12:25:38
I actually already have that book - it's proved very useful. But anyway, I've just decided to put together my own controls and keep track of the user's position and view. I thought this would be the best way once I start to get into networked multplaying too.

Thanks for the help guys.
2  Java Game APIs & Engines / Java 3D / Re: Simple question: Is there a way to find which direction the camera is facing? on: 2007-04-26 11:04:05
I understand how to create my own behaviour class for navigation and it shouldn't be much of a problem. Only thing is I'm a little short on time and would prefer to use Java3d's built in classes for navigation, if possible.

So using KeyboardNavigatorBehavior and OrbitBehavior I would move about... Is there no Java3d feature or function or something that returns the direction the user is facing in the scene?

I need to know what direction the player is facing to be able to set the initial velocity (including direction and vertical angle) of the ball that they throw. So perhaps they would move about, stop, and then press space bar to shoot the ball in the direction they were looking.

Thanks.
3  Java Game APIs & Engines / Java 3D / Re: Problem with Collision on: 2007-04-26 10:57:42
I'm pretty new to Java3D myself and I found WakuponCollisionEntry was just way too slow to respond. It actually reports a collision once it has already occured. What you want in most cases is to be able to know beforehand whether a collision is about to occur so you can take the appropriate action immediately once it does occur. For this you need to use something called picking. The tutorial that you have linked to is good for understanding so make sure you understand what picking is all about. Also read the Sun Java3D tutorial on picking. And this is also very good:

http://escience.anu.edu.au/lecture/cg/exercises/ex9/picking.en.html

Check this out for quite a good implementation:

http://www.gamedev360.com/fps370/

Hope this helps.
4  Java Game APIs & Engines / Java 3D / Simple question: Is there a way to find which direction the camera is facing? on: 2007-04-25 17:23:14
This is probably such a n00b question, but is there a simple way?

What I want to do is throw a ball (very much like shooting a gun) in the direction the user is currently facing (1st person view).

The first way that came to mind was set the user's initial viewing direction and then keep track of it using my own movement controls. But is there no way to just get which direction the user is facing if using KeyboardNavigatorBehavior? Or even better (for mouse looking), OrbitBehavior?

Many thanks.
5  Java Game APIs & Engines / Java 3D / Re: Bouncing Ball - Physics and Collision Detection on: 2007-04-25 17:19:13
Thanks for the help guys, muchly appreciated. Collisions are now working very well Grin
6  Java Game APIs & Engines / Java 3D / Re: Bouncing Ball - Physics and Collision Detection on: 2007-03-27 22:47:58
Finally got it working  Grin (ball falling to the ground)

I had to create my own Behavior class; pretty simple once you know how, doh!

Now I can start to think about having the ball fall from the sky and bounce in 1 dimension (Y-axis) to a stop. This of course means thinking about collision detection.

I noticed one of the wakeup criteria is WakeupOnCollisionEntry - does anyone know if this can be used in this situation? So that the ball would fall and once it detected a collision with the ground the falling (downward) behavior would halt and the new upward behavior would begin...

Cheers
7  Java Game APIs & Engines / Java 3D / Re: Bouncing Ball - Physics and Collision Detection on: 2007-03-27 20:49:01
Thanks for your reply gideon.

You're right when you say I'm new to game programming! Unfortunately I don't have the time to study 2D game programming as I'm doing this work as part of a project at university (with the deadline approaching quicker than I would like Undecided)

I understand the basic principle you have described for creating a simple falling ball but I can't figure out how to animate this in Java3D. Please see Code for Episode 1 at the following link:

http://wiki.showmedo.com/index.php/PythonThompsonVPythonSeries

Here a falling ball has been implemented (quite simply and painlessly) using VPython.

Calculating the position of the ball every 5ms (say) is trivial; what I can't figure out is how to display the ball in the scene every 5ms.

I am still researching and it seems I may have to use a custom made Behavior class using the WakeupOnTimeElapsed wakeup criteria. Can anyone confirm if this is what is needed?

Thanks for the help Smiley
8  Java Game APIs & Engines / Java 3D / Re: Bouncing Ball - Physics and Collision Detection on: 2007-03-27 19:20:24
After reading the Sun Java3D Tutorials (and kind of understanding) I think I have to use behaviors? Do I need to create my own behavior or can I use PositionInterpolator?

There doesn't seem to be much documentation about this anywhere on the Internet. I've not had any luck in finding much anyway.
9  Java Game APIs & Engines / Java 3D / Re: Bouncing Ball - Physics and Collision Detection on: 2007-03-27 14:25:55
OK I think this might be more complicated than I initially thought, so I've decided to start with a simple ball bouncing up and down in the center of the scene.

Putting the physics to one side for a moment, what would be the best way to animate such a bouncing ball? The first method that comes to mind is to simply calculate the ball's position every 5ms (say) based on the principles of physics in such a scenario (in this case mainly gravity), and every 5ms draw the ball in its new position. I don't really know much about animation in Java3D at the moment so would this be an OK method? If not, what better methods are there?

Thanks Smiley
10  Java Game APIs & Engines / Java 3D / Bouncing Ball - Physics and Collision Detection on: 2007-03-26 19:54:46
Hey, I'm pretty new to Java3D and what I want to do is have the ability for a player in my 3D FPS game be able to throw a ball at a given angle and given speed and then for the ball to bounce realistically off of the ground and the walls and eventually come to a stop.

I have no idea where to begin with this but I know I'm going to need some physics and collision detection in there.

Does anyone have any resources I could refer to for help with carrying out this task? Perhaps you know someone who has done it before with a guide on a website somewhere? I've tried googling but havn't really found much useful.

Many thanks.
11  Java Game APIs & Engines / Java 3D / Re: Newbie Stuck With Textures HELP! on: 2007-01-11 17:50:08
Indeed backface culling was the problem, thank you very much my friend  Wink

I did some research and rather than reverse the order of the coordinates I simply disabled backface culling for the time being with these first 2 lines:

1  
2  
3  
4  
5  
PolygonAttributes polyAppear = new PolygonAttributes();
polyAppear.setCullFace(PolygonAttributes.CULL_NONE);
Appearance floorAppearance = new Appearance();
floorAppearance.setPolygonAttributes(polyAppear);
floorAppearance.setTexture(floorTexture);


I wouldn't have been able to figure it out without your help so thanks again. No doubt I'll be here to bug you again very soon when my next problem crops up  Grin
12  Java Game APIs & Engines / Java 3D / Newbie Stuck With Textures HELP! on: 2007-01-09 20:29:56
This is my first post so I'd just like to start off by saying hello to one and all on this forum  Grin

My introduction: I'm 22 in my final year at university studying Computer Science and am working on a 3D game/environment.

I've chosen Java3D and am still learning the ropes with the tool. My main problem right now is with textures.

I've started by creating geometry for a flat floor made up with 100 squares, so it's a 10x10 grid. I've done this using the QuadArray structure. I have specified texture coordinates and have loaded in a texture. The problem is it displays nothing - the world is just black.

But when I simply change the QuadArray structure for a LineArray structure the lines are displayed and the texture is applied to the lines. I know for a fact the geometry created in the loop is correct. The texture must be loading correctly since it is applied to the lines fine right?

So I thought the problem was with the texture coordinates which I was initially putting into an array as the floor geometry was being created in a loop, and then applying the texture coordinates at the end using setTextureCoordinates. As can be seen from my source, I commented this out and tried a more basic approach, and still no result.

So why won't it work with QuadArray? I know this might seem like a very basic and stupid question but I'm still learning and have no idea where to go from here!

Thanks muchly for any help  Smiley
Pages: [1]
 

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

The first screenshot will be displayed as a thumbnail.

rwatson462 (30 views)
2014-12-15 09:26:44

Mr.CodeIt (20 views)
2014-12-14 19:50:38

BurntPizza (42 views)
2014-12-09 22:41:13

BurntPizza (76 views)
2014-12-08 04:46:31

JscottyBieshaar (37 views)
2014-12-05 12:39:02

SHC (51 views)
2014-12-03 16:27:13

CopyableCougar4 (49 views)
2014-11-29 21:32:03

toopeicgaming1999 (115 views)
2014-11-26 15:22:04

toopeicgaming1999 (105 views)
2014-11-26 15:20:36

toopeicgaming1999 (31 views)
2014-11-26 15:20:08
Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

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
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!