Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - manumoi

Pages: 1 ... 5 6 [7] 8 9
91
Support / small collision detection problem
« on: December 14, 2005, 04:46:31 am »
hello egon, thanks for answering so quickly...(must be midnight in germany :? )
The direction is the south compared to the first orientation of the model...
I can rotate the model without problem, and this rotation will affect the direction but whether i push forward or backward, the model will always go more or less south (depending on the z axis of the object)...
Here is the constructor. Maybe it can help:

Code: [Select]

public Player(Object3D obj, WorldInterface worldInterface, String playerName){
super(obj); // the md2 object
this.setCollisionMode(Object3D.COLLISION_CHECK_SELF|Object3D.COLLISION_CHECK_OTHERS);
this.setCollisionOptimization(Object3D.COLLISION_DETECTION_OPTIMIZED);
this.rotateY((float)Math.PI*1.5f);
this.rotateMesh();
this.build();
this.setRotationMatrix(new Matrix());

this.worldInterface = worldInterface;
this.playerName = playerName;

this.keyMapper = worldInterface.getKeyMapper();
this.terrain = worldInterface.getTerrain();
this.theWorld = worldInterface.getTheWorld();
theWorld.addObject(this);
this.placeModel();
this.setSelectable(Object3D.MOUSE_SELECTABLE);
SimpleVector v = this.getTransformedCenter();
v.add(lightShift);
this.myLight = theWorld.addLight(v, 0f,0f,0f);
}


And here is the code i call in my game loop to update the model

Code: [Select]

[...]
if (mainPlayer){
   theWorld.setLightIntensity(myLight,50,50,50);
   x = this.getTransformedCenter().x;
   z = this.getTransformedCenter().z;  
   poll();
   moveModel(); // basically it calls the correct function depending on the keys pressed detected in poll()
}
[...]
placeModel(); // in my previous post
[...]

Maybe it is related with getTransformedCenter().z?

Manu

92
Support / small collision detection problem
« on: December 13, 2005, 10:48:45 pm »
Hello, long time i haven t post anything... I m back on my jpct project and try to fix some small bugs.

I have this one:
When i want to have some gravity effects, I use this lines (more or less taken from one of JPCT demos
Code: [Select]

public void placeModel(){
SimpleVector dropDown = this.getYAxis();
Matrix rotMat = this.getRotationMatrix();
rotMat.setIdentity();
this.setRotationMatrix(rotMat);
this.rotateY(yRot);
distanceToGround = terrain.calcMinDistance(this.getTransformedCenter(), new SimpleVector(0,1,0), 4*30);
if (distanceToGround!= Object3D.COLLISION_NONE){
   dropDown.scalarMul(distanceToGround+LEG_SIZE);
   
}
this.translate(dropDown);
    }


It makes me the model fit perfectly with the ground but  it also affects my movements (i.e. whether i push forward or backward,  i always go in the same direction)

Here are my forward and backward functions :

Code: [Select]

private void moveForward(){
SimpleVector a = this.getZAxis();
a.scalarMul(5f);
a = this.checkForCollisionEllipsoid(a,ELLIPSOID_RADIUS, 5);
this.translate(a);
animating=true;
    }

    private void moveBackward(){
SimpleVector a = this.getZAxis();
a.scalarMul(-3f);
a = this.checkForCollisionEllipsoid(a,ELLIPSOID_RADIUS, 5);
this.translate(a);
animating = true;
    }



When i suppress the following lines from my placeModel function, i have no problem with my movements, but (of course) no gravity. Do you see where my mistake is?

Code: [Select]

terrain.calcMinDistance(this.getTransformedCenter(), new SimpleVector(0,1,0), 4*30);
if (distanceToGround!= Object3D.COLLISION_NONE){
   dropDown.scalarMul(distanceToGround+LEG_SIZE);
   
}

93
Support / about md2 and texture generation
« on: November 11, 2005, 11:26:03 pm »
Does anyone know a good md2 modeler and, more important, a freeware to redesign the texture of a specific md2 model?
I heard about milkshape...

Manu

94
Support / error loading in Linux
« on: November 11, 2005, 10:16:09 am »
hello,
My app runs a AWTGLCanvas... I didn t try with something else... What i suspect is that maybe an openGL driver for the video card is missing. I contacted the administrator of my univ and he was unable to answer me :?
I will check with a friend of mine who frequently deals with MESA on similar computers at my univ. And i will come back to you once i will have the answer.
I think it must be a crappy thing somewhere in my config...

Manu

95
Support / error loading in Linux
« on: November 10, 2005, 10:14:09 pm »
hello, I just tried to load my jpct application on a linux computer (for the first time at my university and i got the following exception. This application works just fine on a windows computer.

Code: [Select]

Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: org.lwjgl.LWJGLException: Could not create a direct GLX context
        at org.lwjgl.opengl.AWTGLCanvas.paint(AWTGLCanvas.java:261)
        at org.lwjgl.opengl.AWTGLCanvas.update(AWTGLCanvas.java:269)
        at sun.awt.RepaintArea.updateComponent(RepaintArea.java:239)
        at sun.awt.X11.XRepaintArea.updateComponent(XRepaintArea.java:43)
        at sun.awt.RepaintArea.paint(RepaintArea.java:216)
        at sun.awt.X11.XComponentPeer.handleEvent(XComponentPeer.java:630)
        at java.awt.Component.dispatchEventImpl(Component.java:4031)
        at java.awt.Component.dispatchEvent(Component.java:3803)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
        at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Caused by: org.lwjgl.LWJGLException: Could not create a direct GLX context
        at org.lwjgl.opengl.LinuxContextImplementation.nCreate(Native Method)
        at org.lwjgl.opengl.LinuxContextImplementation.create(LinuxContextImplementation.java:50)
        at org.lwjgl.opengl.Context.<init>(Context.java:123)
        at org.lwjgl.opengl.AWTGLCanvas.paint(AWTGLCanvas.java:248)
        ... 13 more


I know this is a LWJGL error but do you have any idea?
Thanks

96
Projects / ┐how much pleople still using jpct?
« on: October 21, 2005, 08:29:07 pm »
And i have to say that your project rolz is terrific... In itself it is a proof that jpct is very well done (congratulation Egon)... 2 or 3 years ago, i didn t thought something similar would be so easy to implement in JAVA (well in fact it s not that easy).
I m a graduate student and i m assistant professor for JAVA programming in my university... When I have shown your results (paranoid or technopolis) to my students, that gave a boost of motivation to many of them....
But i think what is really missing for helping the JPCT community to grow is a step by step tutorial whether we have the code of the FPS, or the car example, or the forum...
It appears that sometime some features are difficult to manage and it results in posting 3-4-5 times the same question...
 All of us are busy and have jobs... maybe a thread to discuss about that possibility (which content? how to organize it?) or maybe a wiki could be interesting. Currently i m too busy to launch such activity, but to my level i would gladly participate.
What do you think about that?

97
Projects / ┐how much pleople still using jpct?
« on: October 21, 2005, 01:37:35 am »
I do.... when I have time

98
Feedback / Lights
« on: October 05, 2005, 07:55:48 pm »
Hello, I have noticed in my application that there was a limit to the number of lights I can add in a scene (around 40 if I remember).
I suppose there is a way to redefine this limit but I wasn t able to find it.
How to do that?

Manu

99
Projects / Technopolies
« on: September 28, 2005, 01:45:52 am »
Yep, happy Birthday.... Libra rulez!  :lol:

100
Projects / Dissapointed
« on: September 27, 2005, 04:07:46 am »
hello,

Concerning your collision detection and how to do it in a online multiplayer environment, we already had such discussion with rolz and Egon in the technopolis thread (down of the page):  http://www.jpct.net/forum/viewtopic.php?t=190&postdays=0&postorder=asc&start=120.
(there are also some posts before and after this page)I strongly suggest you to work again with ellipsoid detection, maybe modifying the size of the ellipsoid to fit better to your model.

Concerning your main question, I use prototyping which is more or less what rolz suggests (but I don t trust every recommandations concerning Xtreme programming, that s why I say "more or less"). You begin by doing a simple working system, and then step by step, you improve it and make it more complex.

If you want to do multiplayer online game, you should also look at the nio package of java and how to use channels, creating non blocking servers..., which is very useful for systems with high scalability.

And don't forget, "Never give up, never surrender" (I heard that in a stupid movie).

Good luck,

Manu

101
Projects / aptal karga (foolish crow)
« on: August 08, 2005, 09:19:21 pm »
Very nice! And yes... transparent panels are addictive :lol:

102
Projects / Technopolies
« on: August 02, 2005, 09:44:43 pm »
just to say that your screenshot is amazing Rolz... Very good work

manu

103
Projects / Technopolies
« on: July 29, 2005, 12:17:05 am »
yes it s the algorithm I m using...  
And i suppose i will open my own thread one day but, cause i m doing this stuff for my students researches (it s not a game whereas it looks like it), I can t explain all the objectives of my application. That s why I haven t opened a thread for the moment... And I have to found a name for my project before :P But thanks for all your help anyway.

Manu

104
Projects / Technopolies
« on: July 28, 2005, 11:23:01 pm »
In fact this is the technopolis forum.... so i will stop sending screenshots not related to it
sorry...  :oops:

Manu

105
Projects / Technopolies
« on: July 28, 2005, 10:23:22 pm »
i did a small test today concerning collision detection. I was afraid that if two objects could move to the same position, they could block each other (some kind of "collision deadlock") and when you would like to move them in another position, they would detect a collision and refuse to move...
I have access to many computers. so I logged 2 clients side by side and make the two avatars run on the others.  I did this test many times and they never blocked... So i think i will keep my solution unchanged unless i see a "deadlock"... Maybe if the lag is bigger, it could happen.

ciao

manu

PS : here is a small image of what my project looks like now


Pages: 1 ... 5 6 [7] 8 9