Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (511)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (577)
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] 2
1  Game Development / Game Mechanics / phys2d question: is there a way to detect when a collision has occured? on: 2007-12-17 02:19:21
and if possible, how strong the impact of collision was?

i want to make it such that when a ball bounces against something, it will play a corresponding sound...
2  Game Development / Game Mechanics / Re: phys2d question: why is my gravity backwards... on: 2007-12-04 04:37:00
What graphic API are you using ?

For the demo, it is java2D. The Y axis is up to down. If you use an opengl binding, the "Y" axis is down to up. It all depend on how you do the binding betwen the physis object and the rendering.
oh i see~ im using java3D... i think i get it... different graphic API have different Y axis representation...
3  Game Development / Game Mechanics / Re: phys2d question on iterations on: 2007-11-28 06:58:54
i found out more about iterations...

if you have a iteration of 1, very little force is produced when 2 bodies collide - even if both bodies have a restitution of 1.0f

i tested it out on my program, using 1 ball bouncing on a body and another ball bouncing on a staticbody...

apparently i had to increase the number of iterations to 10 to achieve a similar collision result from both balls...

__________________________

in other words, the number of iterations determine the accuracy of the force produced from a collision between 2 bodies. is my understand correct...?
feedback appreciated.  Smiley
4  Game Development / Game Mechanics / phys2d question: why is my gravity backwards... on: 2007-11-28 06:22:58
looking at the phys2d demos, the gravity there is set as positive...

however when i set mine to positive my bodies go upwards~!

what is causing my positive gravity to move the bodies upwards?

hmm well i know i can just set my gravity as negative... but im still wondering why this happens

5  Game Development / Game Mechanics / Re: phys2d question on iterations on: 2007-11-27 05:33:31
hmmm i see~

so i should start with a low number first and then increase it later if necessary...?

thanks  Smiley
6  Game Development / Game Mechanics / phys2d question on iterations on: 2007-11-26 09:48:00
what does changing the number of iterations do...?

should i just use 1 iteration in my program...?
7  Game Development / Game Mechanics / Re: phys2d bug with restitution? *youtube link added* on: 2007-11-26 09:22:27
OMG... i changed my code to 4 iterations and the problem is solved!!!

 Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked

thanks for your help Bonbon-Chan. no one ever told me the number of iterations to use...  Cry

wow it's really fixed now... thanks alot~  Smiley Smiley Smiley
8  Game Development / Game Mechanics / Re: phys2d bug with restitution? on: 2007-11-26 03:03:25
i've posted my problem on youtube. please watch and help me with the problem please~

http://www.youtube.com/watch?v=zl-ZCMFPVCY

about the last part... the ball didnt disappear, but it flew away so fast the webcam could not capture it in time. -_-
9  Game Development / Game Mechanics / Re: phys2d bug with restitution? on: 2007-11-26 02:14:03
Creation of World
1  
2  
3  
4  
5  
World world;
static final float GRAV = -0.98f;
static final int NB_ITERATION = 2000;

world = new World(new net.phys2d.math.Vector2f(0.0f, GRAV), NB_ITERATION);


Creation of Ball
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
Body objbody;
boolean _mv = true;
boolean _rt = true;
float _rd = 0.000001f;
float _re = 0.4f;

public PhysObject(DynamicShape ds, float mass) {
        objbody = new Body(ds, mass);
}
public void setupObj(float xPos, float yPos, float rotation) {
        objbody.setMoveable(_mv);
        objbody.setRotatable(_rt);
        objbody.setRotDamping(_rd);
        objbody.setPosition(xPos, yPos);
        objbody.setRotation(rotation);
        objbody.setRestitution(_re);
}
public void setRestitution(float re) {
        objbody.setRestitution(re);
}

PhysObject tempobj;
playerWidth = 0.09f;

tempobj = new PhysObject(new Circle(playerWidth), 5.0f);
tempobj.setupObj(-0.85f, 0.6f, 0.0f);
tempobj.setRestitution(1.75f);
list.add(tempobj);


Creation of 2 Walls
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
float _rd = 0.000001f;
float _re = 0.4f;

public PhysObject(DynamicShape ds, float mass) {
        objbody = new Body(ds, mass);
}
public void setupObj(float xPos, float yPos, float rotation, boolean moveable, boolean rotatable) {
        objbody.setMoveable(moveable);
        objbody.setRotatable(rotatable);
        objbody.setRotDamping(_rd);
        objbody.setPosition(xPos, yPos);
        objbody.setRotation(rotation);
        objbody.setRestitution(_re);
}

PhysObject tempobj;
net.phys2d.raw.shapes.Box b1 = new net.phys2d.raw.shapes.Box(0.8f, 0.03f);

tempobj = new PhysObject(b1, 5.0f);
tempobj.setupObj(-0.55f, 0.2f, -0.2f, false, false);
list.add(tempobj);

tempobj = new PhysObject(b1, 5.0f);
tempobj.setupObj(0.415f, 0.2f, 0.2f, false, false);
list.add(tempobj);


the problem occurs when a ball drops into a funnel-shaped wall... and is trapped between both sides of the wall. causing the restitution to make the ball bounce erratically.

i used 1.75f restitution for the ball and 0.4f restitution for the wall
10  Java Game APIs & Engines / Tools Discussion / Re: Why is NetBeans trying to act as a server? on: 2007-11-22 05:57:29
App1 is the name of your package...

apparently, your .java file is named Main.java


the empty Main method does nothing... i think u can get rid of it for now


package... im not sure, but i think it works something like a folder or smth
11  Game Development / Newbie & Debugging Questions / Re: Librarys needed for a (2D Graphics + 3D Logic = 2.5D?) Game on: 2007-11-22 05:53:01
hmmm u mean games like silver or FF7 that the background is just an image and there's this 3D character running in it?

those are 3D games with a 2D background...
12  Game Development / Game Mechanics / phys2d bug with restitution? *youtube link added* on: 2007-11-22 05:37:08
ok so i managed to get the restitution thingy working at last (after looking at the demo source)

then i found out something...

if you drop a bouncy ball in between a couple of sloping walls the ball will jump away at an extreme velocity.

\o/   <<< figure of ball in between 2 sloping walls.

can anyone find a way to solve this problem?
13  Games Center / Archived Projects / Re: Basketball Demo, based on Multibody System with Cloth Simulations on: 2007-11-22 04:12:48
dunking the dog was the coolest part of the game~  Grin
14  Game Development / Game Mechanics / Re: kevglass can help me with something? on: 2007-11-21 09:33:51
oh cool so the demos are in there as well? thanks mate~  Grin
15  Game Development / Game Mechanics / kevglass can help me with something? on: 2007-11-21 08:19:23
can you send me the source for your exclusion test demo?

coz i want to learn how to make objects bounce on the floor like that.

 Tongue
16  Game Development / Game Mechanics / Re: can phys2d be used to make a bouncing body? on: 2007-11-21 04:00:22
Make sure the restitution is set properly. If not, then they will act exactly like balls of lead.

- Jon
what should i set the restitution as? i tried changing the restitution to no effect.  Undecided
17  Java Game APIs & Engines / Java 3D / Re: Weird rendering order on: 2007-11-15 08:44:56
I just thought of something to solve my own problem!!!

i just switch off transparency whenever the value of transparency is 0~

i hope it works~  Smiley

edit: ya it works now~  Grin
18  Java Game APIs & Engines / Java 3D / Re: Weird rendering order on: 2007-11-15 02:59:34
i think i figured out the problem. It's because i gave all my geometries a transparencyattributes.

is there any way at all to depth buffer intersecting transparent objects properly? per-geometry doesn't work because my objects are intersecting...  Sad
19  Java Game APIs & Engines / Java 3D / Re: Weird rendering order on: 2007-11-14 08:35:09


hi i am having a problem with depth buffer for objects that are supposed to be intersecting. can anyhow help figure out what is the problem?

i already turned on the depthbuffer and it works fine. just the problem with intersecting objects like shown in the picture above.

help me please it's giving me a headache  Cry
20  Game Development / Game Mechanics / Re: NoClassDefFoundError when running Phys2D in an applet... on: 2007-11-13 06:31:01
oh nvm... i decided to do it in an application instead of an applet...
21  Game Development / Game Mechanics / NoClassDefFoundError when running Phys2D in an applet... on: 2007-11-12 07:40:22
i suspect it has something to do with classpaths or something... can anyone help?  Huh
22  Game Development / Game Mechanics / can phys2d be used to make a bouncing body? on: 2007-10-30 04:07:53
like a ball that can bounce off the floor? is it possible? coz all my bodies seem to be made of lead.  Undecided
23  Game Development / Game Mechanics / Re: would phys2d work with 3d models in a 2d side scroller? on: 2007-10-30 04:01:38
that's what im working on right now as well. 2d based game but drawn in 3d.
24  Game Development / Game Play & Game Design / Re: What do you want in a web game? on: 2007-10-25 06:57:11
people will like to play your game if it has lots of content, like an RPG.

or varied gameplay, i.e. no 2 games are the same.

poor graphics put people off, so quality > quantity
25  Java Game APIs & Engines / Java 3D / Re: Picking not working right in Java3D on: 2007-10-25 06:49:10
I wrote my own class for picking to avoid the problems of obscurity you are encountering. I do something like this to adjust for the projection distortion:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
// mouse click to imageplate coordinates
c3D.getPixelLocationInImagePlate(pickXY.x, pickXY.y, p3d);
// imageplate to world transformation
c3D.getImagePlateToVworld(t3D);
t3D.transform(p3d);
// find vector eye -> target
v3d.sub(p3d, eyeIs);
// set the pickRay
pickRay.set(eyeIs, v3d);
// do the picking
PickInfo pi = sceneBranch.pickClosest(PickInfo.PICK_GEOMETRY, PickInfo.NODE, pickRay);


I think this is as safe as it gets.
and from here what do i do with the PickInfo? sorry if it's a noob question...
26  Game Development / Game Mechanics / Re: Phys2D usage questions: on: 2007-10-22 08:33:14
hi guys can anyone help me with something?

how do i reset the physics? for example, an object in mid-fall will start to fall from rest once more.

coz i wan to make a reset button, but the thing is the physics calculation does not get reset! it's funny but not working as intended. i didn't see anything of use in the documentation so any help here would be greatly appreciated

edit: hmm i created a new instances of body and re-added them to the world... seems to work as intended now~
27  Game Development / Game Mechanics / Re: how to use Phys2D? on: 2007-10-19 09:00:25
hi just wondering what is a good number for the iterations?  Tongue
28  Game Development / Game Mechanics / Re: Phys2D usage questions: on: 2007-10-19 08:17:35
im trying to use phys2D on a 3D rendered game... hope it works

edit: seems to work fine, but since im rendering the 3D images, i can't see the physics circles and boxes. makes it abit hard to sync the 3D stuffs and the "2D bounding box/circle"
29  Game Development / Game Mechanics / Re: how to use Phys2D? on: 2007-10-19 07:29:21
umm cannot find symbol World  Huh

edit: oh wait need to import net.phys2d.(stuff)

k i go try again~
30  Game Development / Game Mechanics / Re: how to use Phys2D? on: 2007-10-19 07:17:58
wow thanks for replying, i'm gonna try it out now~  Grin
Pages: [1] 2
 

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

The first screenshot will be displayed as a thumbnail.

Longarmx (52 views)
2014-10-17 03:59:02

Norakomi (42 views)
2014-10-16 15:22:06

Norakomi (32 views)
2014-10-16 15:20:20

lcass (37 views)
2014-10-15 16:18:58

TehJavaDev (68 views)
2014-10-14 00:39:48

TehJavaDev (66 views)
2014-10-14 00:35:47

TehJavaDev (58 views)
2014-10-14 00:32:37

BurntPizza (73 views)
2014-10-11 23:24:42

BurntPizza (45 views)
2014-10-11 23:10:45

BurntPizza (85 views)
2014-10-11 22:30:10
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

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
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!