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

Pages: 1 [2] 3 4 ... 102
16
Code: [Select]
     private void loop() {
....
     buffer.clear(java.awt.Color.black);
     theWorld.renderScene(buffer);
     theWorld.draw(buffer);
     buffer.displayGLOnly();
     canvas.repaint();
     Thread.yield();
}
buffer.dispose();//CAUSES THE PROBLEM
this.dispose();
buffer.disableRenderer(IRenderer.RENDERER_OPENGL);
System.exit(0);

17
Same thread as the gameloop and just before Frame.dispose().

18
No. Do you know what I'm almost certain to be one of the causes? FrameBuffer.dispose().

19
I've tried replicating it during the game. Invariably, I will get it as I close it. Often during, but I can't seem to  cause it to happen while running. But whenever I close, there it is.

20
Support / ERROR: Texture '--*--BlittingWrapper_internal--*--' not found!
« on: October 04, 2017, 03:30:02 am »
Is this a jpct error? If so, what is it? I'm using the software renderer here.

21
Support / Re: Polyline.setLineLength?
« on: September 23, 2017, 09:12:54 pm »
That's true. What about a getPoints() method so at least we don't have to hold the array ourselves.

And the lwjgl thing? Obviously, 2.9x won't work forever so there has to be a plan forward lest jpct's hardware renderer die. I'm just asking you what your plan is.

22
Support / Polyline.setLineLength?
« on: September 23, 2017, 01:12:44 am »
I'm writing the following for my son (sorry about the captured frame-rate). The thing about Polyline.update(...) is that it's expensive to always create a new array (I suppose that I could store it, then edit it but that's quirky), and it's inconvenient. Also, the following is the code that increases the length of my laser (deltaTime*10f breaks the numbers by being making them too large):

Code: [Select]
SimpleVector pos = bridge.getTransformedCenter();
pos.y -= 160f;
SimpleVector forward = bridge.getZAxis();
laserLength *= (1f+(deltaTime*6f));
laser.update(new SimpleVector[]{pos, pos.calcAdd(new SimpleVector(forward.x*laserLength, forward.y*laserLength, forward.z*laserLength))});

https://www.youtube.com/watch?v=ui6R1ZDcEqI

23
Support / LWJGL 3+
« on: September 19, 2017, 06:09:52 am »
I've found no AWTGLCanvas in my brief exploration of its docs. I have, however, found this:
Code: [Select]
https://javadoc.lwjgl.org/org/lwjgl/system/jawt/JAWT.html It's kind of funny the notion of someone going, "do you know what Java needs? Malloc. I miss malloc." LOL

Anyway, is there any chance that you might implement your own AWTGLCanvas from that? At some point, you have to recognize the need to update (either to the newer LWJGL or otherwise to jOGL or a third--to me unknown--wrapper). Right?

24
Bones / Re: Scale Problem?
« on: September 19, 2017, 06:02:45 am »
I assume you mean that only the post-animateSkin values don't have vertices. Raft, any clue as to how animateSkin could destroy the model's vertices?

25
You just have to add the textures to the Texture Manager BEFORE loading the model. But I suspect that if you call merge() you will break the texture references.

26
Bones / Re: Scale Problem?
« on: September 05, 2017, 06:41:13 am »
Before animateSkin:
Quote
*****Object-space bounds: *****
-0.328329
0.343511
-0.159473
0.230658
0.00242225
2.12075
***** ****** *****
*****World-space bounds: *****
-0.328329
0.343511
-0.159473
0.230658
0.00242225
2.12075
***** ****** *****

After animateSkin:
Quote
*****Object-space bounds: *****
9.9999998E10
-9.9999998E10
9.9999998E10
-9.9999998E10
9.9999998E10
-9.9999998E10
***** ****** *****
*****World-space bounds: *****
-9.9999998E10
9.9999998E10
-9.9999998E10
9.9999998E10
-9.9999998E10
9.9999998E10
***** ****** *****

Any clues?

27
Bones / Re: Scale Problem?
« on: September 01, 2017, 10:46:16 pm »
Before animateSkin() ever gets called, I get the following bounding box: -0.328329, 0.343511, -0.159473, 0.230658, 0.00242225, 2.12075.

Afterwards, it becomes: -9.9999998E10, 9.9999998E10, -9.9999998E10, 9.9999998E10, -9.9999998E10, 9.9999998E10

The following is the method with which I print the world-space bounding box:

Code: [Select]
    public float[] getWorldSpaceBounds(Object3D obj) {
        float[] objectSpaceBounds = obj.getMesh().getBoundingBox();
       
        SimpleVector mins = new SimpleVector(objectSpaceBounds[0], objectSpaceBounds[2], objectSpaceBounds[4]);
        SimpleVector maxs = new SimpleVector(objectSpaceBounds[1], objectSpaceBounds[3], objectSpaceBounds[5]);

        SimpleVector[] p = new SimpleVector[8];
        p[0] = new SimpleVector(mins.x, mins.y, maxs.z);
        p[1] = new SimpleVector(mins.x, mins.y, mins.z);
        p[2] = new SimpleVector(maxs.x, mins.y, mins.z);
        p[3] = new SimpleVector(maxs.x, mins.y, maxs.z);
        p[4] = new SimpleVector(maxs.x, maxs.y, mins.z);
        p[5] = new SimpleVector(maxs.x, maxs.y, maxs.z);
        p[6] = new SimpleVector(mins.x, maxs.y, mins.z);
        p[7] = new SimpleVector(mins.x, maxs.y, maxs.z);

        float minX = Float.MAX_VALUE;
        float minY = Float.MAX_VALUE;
        float minZ = Float.MAX_VALUE;
        float maxX = -Float.MAX_VALUE;
        float maxY = -Float.MAX_VALUE;
        float maxZ = -Float.MAX_VALUE;

        for (int i = 0; i < 8; i++)  {
            p[i].matMul(obj.getWorldTransformation());

            if (p[i].x < minX) { minX = p[i].x; }
            if (p[i].y < minY) { minY = p[i].y; }
            if (p[i].z < minZ) { minZ = p[i].z; }
            if (p[i].x > maxX) { maxX = p[i].x; }
            if (p[i].y > maxY) { maxY = p[i].y; }
            if (p[i].z > maxZ) { maxZ = p[i].z; }
        }

        float[] worldSpaceBounds = new float[6];
        worldSpaceBounds[0] = minX;
        worldSpaceBounds[1] = maxX;
        worldSpaceBounds[2] = minY;
        worldSpaceBounds[3] = maxY;
        worldSpaceBounds[4] = minZ;
        worldSpaceBounds[5] = maxZ;

        return worldSpaceBounds;
    }

28
Bones / Re: Scale Problem?
« on: September 01, 2017, 04:29:31 pm »
If this isn't Bones-related, I don't know what is. Especially since the vertex animations all work perfectly.

29
Bones / Re: SkeletonDebugger Auto-Scale Feature?
« on: September 01, 2017, 04:28:33 pm »
I meant Debugger, but obviously I would take it in Helper. ; )

30
Bones / Re: Scale Problem?
« on: August 31, 2017, 03:07:27 pm »
Sorry, I hadn't realized that you replied.

No, they were both attempts to fix the incomprehensible problem. scaleBones looks like this (where SCALE is currently set to 1.00f):

Code: [Select]
    private static void scaleBones(ArrayList<Bone> bones) {
        for (int i = 0; i < bones.size(); i++) {
            Bone aBone = bones.get(i);
            scaleBonePosition(aBone);
            scaleBoneMatrix(aBone);
        }
    }
    private static void scaleBonePosition(Bone aBone) {
        aBone.position.x *= SCALE;
        aBone.position.y *= SCALE;
        aBone.position.z *= SCALE;
    }
   
    private static void scaleBoneMatrix(Bone aBone) {
        aBone.transform.scalarMul(SCALE);
    }

invertBones just multiplies all values by -1. Neither attempts at solutions either help or hurt the problem.

Pages: 1 [2] 3 4 ... 102