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

Messages - hytparadisee

#1
Bugs / FrameBuffer.blit() - int[] version
October 16, 2007, 04:20:47 AM
I highly doubt that the FrameBuffer.blit() - int[] contains bug. For the Texture version is ok, but if i use the int[] version, no matter how I do it, I always get java.lang.ArrayIndexOutOfBoundsException: 9 saying that no such item at index 9. But obviously I'm passing an image with a length of 307200. If you can help, the following program will reproduce the error.


import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import com.threed.jpct.*;
import com.threed.jpct.util.*;

public class Blitting {
private int width = 640, height = 480, granularity = (1000 / 40), numOfUpdates;
private long now, justNow = System.currentTimeMillis(), start, offset;
private boolean running = true;

private World world;
private KeyMapper keyMapper;
private Object3D box;
private FrameBuffer buf;
private KeyState keyState;
private Image fpsImage = new BufferedImage(200, 100, BufferedImage.TYPE_INT_ARGB);

public Blitting() {
Config.glFullscreen = false;

world = new World();
keyMapper = new KeyMapper();
box = Primitives.getBox(1, 1);
buf = new FrameBuffer(width, height, FrameBuffer.SAMPLINGMODE_NORMAL);

world.setAmbientLight(50, 50, 50);
box.translate(0, 0, 5);
world.addObject(box);
world.buildAllObjects();

buf.enableRenderer(IRenderer.RENDERER_OPENGL);
buf.disableRenderer(IRenderer.RENDERER_SOFTWARE);
buf.optimizeBufferAccess();

World.setDefaultThread(Thread.currentThread());
while (running) {
now = System.currentTimeMillis();
offset = now - justNow;
numOfUpdates = 0;
if (offset >= granularity) {
justNow = now - (offset % granularity);
numOfUpdates = (int )(offset / granularity);
}

for (int i = 0; i < numOfUpdates; i++) {
update(System.currentTimeMillis() - start);
}

while ((keyState = keyMapper.poll()) != KeyState.NONE) {
poll(keyState);
}

buf.clear();
world.renderScene(buf);
world.draw(buf);
buf.update();
blit(buf);
buf.displayGLOnly();
}
System.exit(0);
}

protected void update(long elapsed) {
// TODO: update here
box.rotateY(0.01f);
}

protected void poll(KeyState keyState) {
if (keyState.getKeyCode() == KeyEvent.VK_ESCAPE) {
running = false;
}
// TODO: process your other key ere
}

protected void blit(FrameBuffer buffer) {
// TODO: make your additional 2D drawing here
Graphics g = fpsImage.getGraphics();
g.setColor(new Color(0.9f, 0.9f, 0.9f, 0.9f));
g.fillRect(0, 0, 200, 100);
fpsImage.flush();
PixelGrabber grabber = new PixelGrabber(fpsImage, 0, 0, -1, -1, false);
try {
if (grabber.grabPixels()) {
int[] data = buffer.getPixels();
System.out.println(data.length);
buffer.blit(data, 200, 100, 0, 0, 0, 0, 200, 100, FrameBuffer.TRANSPARENT_BLITTING);
}
} catch (Exception ex) {
throw new RuntimeException(ex);
}
}

public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
new Blitting();
}
});
}
}
#2
News / Re: Beta of 1.15 released!
July 24, 2007, 05:56:52 PM
Awwww, no wonder mine can't work ----> Intel 852 :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'(
#3
News / Re: Happy birthday!
July 20, 2007, 07:29:50 AM
Persistence makes perfect :o Te honest, any five-year-period in life is a duration where it begin to strongly affect some group of people, and jPCT is affecting the world. We are all the kind that don't give things up easily, that's something I am proud of jPCT (of course and of all of you)
#4
News / Re: Beta of 1.15 released!
July 19, 2007, 05:10:41 AM
Thanks in advance, though I can't help much. (My damn shitty intel chip :'()
#5
Support / Re: UV Texturing
July 11, 2007, 07:31:22 PM
Quote from: EgonOlsen on July 11, 2007, 07:20:34 PMI'll update the documention accordingly.

This is well known as "Professionalism"! :D
#6
Feedback / Re: using JPCT for cartography!
July 10, 2007, 04:53:56 AM
Just on the news section yesterday from www.java.net

This one might be what you are looking for.

java world wind SDK from NASA

http://worldwind.arc.nasa.gov/java/
#7
Feedback / jPCT getting popular?
July 08, 2007, 03:59:56 PM
Today I saw a soar in the number of users online, the number actually doubled.

QuoteMost Online Today: 48. Most Online Ever: 48 (Today at 07:03:30 pm)

That's quite impressive, but Egon will get busy lol.
#8
Support / Re: Skeletal API
July 06, 2007, 04:11:23 PM
Quote from: AGP on July 06, 2007, 08:08:39 AM
so I don't expect you to be as anxious...
;D ;D ;D ;D ;D ;D ;D ;D ;D ;D
#9
News / Re: Currently working on...
July 05, 2007, 04:09:42 AM
Hey Egon, the grass texture and the tree models are from TurboSquid right? And the tree models are actually some planes crossed together with alpha right?

Edit1: It's looking really ace now. Just wondering whether this new thing can bring something new, perhaps ?sunlight?

Edit2: How is it exposed in the API. A post processor?

Edit3: At first i considered bloom and shadow the same, now i see the difference. (but somehow I cannot tell the difference ???)
#10
I will most like jar them lol ;D.
#11
Thanks! The answers are more than enough. ;D
#12
Support / (Urgent) Switching to 3DS for animation
July 03, 2007, 01:18:00 PM
For those of you who've done the animation using concatenated 3DS files, I have questions that need to be confirmed.

1. Each 3DS file is used for/as a keyframe right?

2. Once animation keyframe is added and built correctly, the interpolation is done automatically by jpct right?

3. For each of the keyframe 3ds file exported, do i have to set keyframes in 3ds max? Or all i need is just make a pose, export it, then it will be used as a keyframe?

I need urgent answers thanks.
#13
News / Re: Currently working on...
June 30, 2007, 05:17:33 AM
QuoteThe possibilities are endless.

Me, combining with jorbis for sound and with jspeex for speech now ;), plus what I hate the most -> networks.
#14
Ya ur right. Unix based never accepts "\"
#15
Do you mind giving the stack trace? (or at least what exceptions)