Main Menu
Menu

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.

Show posts Menu

Topics - zammbi

#21
Support / Drawing an advance line
February 28, 2012, 09:54:32 PM
Hi, it's been a while since I've visited here, this time it's for work :)

I'm here in behalf of CricHQ (http://www.crichq.com/) and looking if this library is suited for what they want for it. We are creating an Android version of CricHQ mobile. One of the things needed is a 3d wagon wheel just like the current iPhone version.

Everything has been going well however it seems that Jpct doesn't support primitive line drawing by default which has put a halt in my work and I don't want to use another library if possible.

I basically need one basic method like the iPhone engine 'populateAsLineStripWith', which basically you give it a width and an array of points. And of course allows to colour it with any colour.
Everything else I can port over.

Here is an example of the wagon wheel:
#22
Support / Getting the bounds of the world
October 15, 2010, 08:09:30 AM
How does one get the bounds of the whole world? I want to make it so if a user gets a glitch(fall through a polygon), which they end outside of the map, it warps them back.

So I need to check on the bounds of the whole world. I guess the bounds could change from the character(or any other movable thing) but I'll take a snapshot when the level has loaded.
#23
Feedback / WebP new image type
October 02, 2010, 05:20:55 AM
So Google has made a new open source image type called WebP which seems like a nice option over jpeg. Seems they got a better compression rate (40% or so better) with the same quality.
It would be nice to see this format supported in JPCT or as a separate library. Anyone up for the challenge?  :)

http://code.google.com/speed/webp/
#24
Support / Broken light in software mode
September 26, 2010, 06:51:17 AM
So I was trying out my new obj cave model but when I loaded the textures, things really got messy. But when I used hardware mode everything was fine again. Bug? solutions?

Software mode:


Hardware mode:


#25
Support / Server collision triggers
September 07, 2010, 03:42:12 PM
I'm stuck a little trying to work out how I will do collision triggers on my server.

So a simple example would be someone walking in a door and warping the user.

Another example would be a user walking in through one aka, to open a door.

Then I will also need to support room size triggers aka security or lava. Which I could have many triggers inside that large trigger.

The triggers will only need to fire once, but some cases I'll need to check if I'm still inside one.

I'm quite lost on how I would tackle this problem. So any help on the subject would be great.
#26
Support / Rain effect
September 01, 2010, 09:08:49 AM
Just wondering what everyone else has done for their rain effect? I don't want to reinvent the wheel when I don't have too.
Or any suggestions on creating ok looking rain which is quick enough for the software renderer?
#27
Having a little trouble with blitting.
It's not showing the texture on quality change with software mode. Doesn't matter if its transparent or not, what file type it is, tried different textures, setMipmap to false, etc..
It will only show for 'SAMPLINGMODE_NORMAL'. Nothing else is effected, only blitting. No problems at all when I switch to hardware mode.

Anyone else having this issue?
A forum search didn't show anything. So any help will be great...
#28
Support / A few questions
August 19, 2010, 08:28:48 AM
Finally can post, forum trouble?

1) So I been thinking to use toXML when I get to that stage. Is there any documentation on this? I couldn't find any what exactly it exports.

2)Why does my hardware switcher crash, when going from hardware to software mode.

I get this crash:
QuoteOpenGL renderer disposed
Software renderer (OpenGL mode) initialized
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
   at com.threed.jpct.SoftGLRenderer.drawPolygon(Unknown Source)
   at com.threed.jpct.SoftGLRenderer.drawPolygon(Unknown Source)
   at com.threed.jpct.SoftGLRenderer.drawVertexArray(Unknown Source)
   at com.threed.jpct.World.draw(Unknown Source)
   at com.threed.jpct.World.draw(Unknown Source)
   at com.threed.jpct.World.draw(Unknown Source)
   at base.GameWindow.<init>(GameWindow.java:179)
   at base.GameWindow.main(GameWindow.java:739)


which is at this line:



if(switchHardware)
switchHardwareMode();
for (int i = 0; i < numOfUpdates; i++) {
updateEntities();
moveCamera();
}
state = null;
while (!talkfield.isActive() && (state = keyMapper.poll()) != KeyState.NONE) {
processKeyEvent(state); // Process key events here using the 'state' object
}
processMouseEvent();

window.evaluateInput(mouse, keyMapper);
buf.clear();
world.renderScene(buf);
world.draw(buf); <-----crashes here.
window.draw(buf);
if(wireframe)
world.drawWireframe(buf, Color.WHITE);


My switcher code is:

private void switchHardwareMode(){
switchHardware = false;
Config.glFullscreen = fullscreen;


if (!hardware) { //hardware mode
hardware = true;
buf.disableRenderer(IRenderer.RENDERER_SOFTWARE);
buf.enableRenderer(IRenderer.RENDERER_OPENGL, IRenderer.MODE_OPENGL);
world.setFoggingMode(World.FOGGING_PER_PIXEL);

cleanUpWindow();
mouse = new MouseMapper(height);
keyMapper = new KeyMapper();
} else { //software mode
hardware = false;
       if (fullscreen) {
           device.setFullScreenWindow(null);
       }
       buf.disableRenderer(IRenderer.RENDERER_OPENGL);
buf.enableRenderer(IRenderer.RENDERER_SOFTWARE, IRenderer.MODE_OPENGL);
world.setFoggingMode(World.FOGGING_PER_VERTEX);

cleanUpWindow();
createSoftwareAWTWindow();
mouse = new MouseMapper(frame);
keyMapper = new KeyMapper(frame);

}
}


3) How can I have child lights to a object? I want to have a light follow a object but not worry about this myself as I'll be tracking a lot of of lights. Is this possible? or will be possible?  ;)

#29
Support / Optimising for headless mode
July 29, 2010, 06:18:10 AM
What would be the best options to setup JPCT for headless mode to be the most optimised? Going to be running JPCT on a server.
#30
Support / Polygons flipped the wrong way
March 04, 2010, 10:59:16 AM
I'm currently loading a 3ds landscape and it seems to have flipped the polygons(water is on top of the hills). I have never seen this problem before.
When I load it in blender it appears correctly. I don't know what's causing this, maybe some silly error on my part.

Anyone else get the same issue? http://www.2shared.com/file/11834275/23195093/Models.html
#31
Support / Breaking maps into zones
September 12, 2008, 11:42:22 AM
I'm trying to figure out how to break up a map into zones for the server so it can work out when to send positions of players to another.
I need the map to be broken into equal squares on all maps. But since there is no kind of get width method of a world/object3D, how am I meant to do this?
#32
Support / Sync the server position
September 06, 2008, 05:12:04 PM
I'm a totally stuck on the maths trying to sync the movement on the server with the client. Before this I had it so the client sync with the server but that caused annoying warp backs, so I'm trying to make it so the server syncs to the client.
Hopefully I'm too confusing trying to explain this.

The server holds the current client position(CC), current server position (CS), old client position(OC).
The server on every cycle sync as much as it can to the client.

This is done by creating a guess position(G) which the CS goes towards that direction to N (The new position).
G is worked out by the angle of OC and CC, then translate CC with this new angle.
N is worked out by the angle of CS and G, then translate CS with this new angle.

This is my current code but doesn't work as expected, just moves in one direction. Hopefully someone understands this and able to tell me whats wrong.


float differenceAngle = oldrotation - rotation; //has the player turned since last cycle.

final Object3D guessPos = new Object3D(0), charObj = new Object3D(0), newPos = new Object3D(0);

guessPos.translate(clientX, y, clientZ);
guessPos.rotateY(calcAngle(new SimpleVector(oldClientX,y,oldClientZ),new SimpleVector(clientX,y,clientZ)) + differenceAngle);

charObj.translate(x, y, z);
charObj.rotateY(rotation);

final SimpleVector charPos = charObj.getTranslation();

SimpleVector a = guessPos.getZAxis();
a.scalarMul(xSpeed);

newPos.translate(x, y, z);
newPos.rotateY(calcAngle(new SimpleVector(charPos.x,charPos.y,charPos.z),new SimpleVector(a.x,a.y,a.z)));

clientX = a.x;
clientZ = a.y;
clientRotation = a.z;

a = newPos.getZAxis();
a.scalarMul(xSpeed);

               a = m.getWorld().checkCollisionEllipsoid(charPos, a, Zone.ELLIPSOID_RADIUS, 2);

charObj.translate(a);
a = charObj.getTranslation();

x = a.x;
y = a.y;
z = a.z;

oldClientX = clientX;
oldClientZ = clientZ;
oldClientRotation = clientRotation;
oldrotation = rotation;


#33
Support / Grab y rotation from matrix
September 01, 2008, 11:15:27 AM
I'm having a little trouble with grabbing the y rotation from a matrix. I found a nice example for 3x3 matrix but I'm totally lost with jpct matrix.
#34
Projects / Casters of Fate
August 29, 2008, 04:34:21 PM
Currently I'm working on a 3d online medieval RPG browser(light download) game called Casters of Fate built by the wonderful Jpct  8)
This is my current blog on what I have done, for those who wish to know about the project.
I haven't been working on this long, only learnt project darkside last week, and then built the current server and client this week, so not much to show off atm.
Here's the sshot:
#35
Support / Need help on the feud Gui
August 29, 2008, 06:50:54 AM
I have been using the feud gui for my game but having a little trouble.
Window prints/moves fine but I'm unable to setup labels or text boxes right, no text is printing. I have imported all needed files and I am using the needed font.gif image.
Heres my setup method, I don't see any problems here.

    private void setupGui(){
   
        SimpleStream ss = new SimpleStream("Models/chatgui.png");
        Texture backDrop = new Texture(ss.getStream());
        try {
ss.close();
} catch (IOException e) {}
TextField field = new TextField(1, 100, 100, 10);
field.setVisible(true);
Label chatlabel = new Label(1,1);

        try {
window = new Window(backDrop, 50, 50);
window.add(field);
window.add(chatlabel);
window.setVisible(true);

} catch (Exception e) {
e.printStackTrace();
}
field.setText("Chat");
chatlabel.setText("Welcome to Casters of Fate");
    }


Also another problem is when I'm in window mode using frames Window isn't printed right. Its about 15 pixels out of place in the y direction, which also messes up when trying to move it, since you can only move 15 pixels below the gui image.
If I wanted to fix this problem where in the code this change needs to happen.
#36
Support / Need example with jpct and project darkside.
August 20, 2008, 06:59:02 AM
Hey I been learning project darkside for a little while, I wanted to know if anyone has examples using it with jpct?
It would help a lot if someone could post an example using both for a basic server. So I know how to set it up right.
#37
Support / Animation help for md2
July 08, 2008, 12:09:14 PM
I have basic animation working, but have a problem with some frame names.
I'm using models which name there frames like so for walking:
WB01, WB02, WB03F, WB04....
F meaning play the footstep sound.
Is there a way to get the animation name?
Also the above example jpct splits that up into 3 seq, how would I play this smoothly?
#38
Support / My animation isn't working
July 03, 2008, 03:40:56 PM
I have started learning jpct and finding it great. So far haven't had much trouble though wish there were tutorials to help.
Anyway one trouble I've had is my animation.
I am using md2 and animating like so:


if(walkframe >1){
walkframe = 0;
}
walkframe += .1f;
character.animate(walkframe,18);


If I change my sub-sequence I can see the model changing but if I change the index the model doesn't change at all. Even with a sub-sequence of 0.