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

Pages: [1] 2 3 ... 6
1
Bugs / FrameBuffer.blit() - int[] version
« on: 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.

Code: [Select]
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!
« on: July 24, 2007, 05:56:52 pm »
Awwww, no wonder mine can't work ----> Intel 852 :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'( :'(

3
News / Re: Happy birthday!
« on: 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!
« on: 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
« on: July 11, 2007, 07:31:22 pm »
I'll update the documention accordingly.

This is well known as "Professionalism"! :D

6
Feedback / Re: using JPCT for cartography!
« on: 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?
« on: July 08, 2007, 03:59:56 pm »
Today I saw a soar in the number of users online, the number actually doubled.

Quote
Most 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
« on: July 06, 2007, 04:11:23 pm »
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...
« 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
Support / Re: (Urgent) Switching to 3DS for animation
« on: July 05, 2007, 04:03:41 am »
I will most like jar them lol ;D.

11
Support / Re: (Urgent) Switching to 3DS for animation
« on: July 03, 2007, 02:21:40 pm »
Thanks! The answers are more than enough. ;D

12
Support / (Urgent) Switching to 3DS for animation
« on: 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...
« on: June 30, 2007, 05:17:33 am »
Quote
The possibilities are endless.

Me, combining with jorbis for sound and with jspeex for speech now ;), plus what I hate the most -> networks.

14
Support / Re: How to get demo programs running on Mac
« on: June 30, 2007, 05:11:56 am »
Ya ur right. Unix based never accepts "\"

15
Support / Re: How to get demo programs running on Mac
« on: June 29, 2007, 04:42:25 pm »
Do you mind giving the stack trace? (or at least what exceptions)

Pages: [1] 2 3 ... 6