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

#1
Support / Re: Problem with AWTGLCanvas
September 02, 2025, 09:14:57 PM
Although I should reiterate that I usually use it on the entire frame. I'm making a sometimes-2d sometimes 3d game and it would be available there.
#2
Support / Re: Problem with AWTGLCanvas
September 01, 2025, 09:13:01 AM
I've tried everything. Test it out as an actual UI and let me know, please.
#3
Support / Problem with AWTGLCanvas
August 26, 2025, 11:58:45 PM
Egon, have you ever run into the problem with AWTGLCanvas in which the entire rendering is out of place on the canvas that I did about a decade ago and ever since on every computer I've ever run my stuff on? I'd love to have that fixed (most likely by switching to lwjgl 3 and convincing them to add AWTGLCanvas back). What do you think?
#4
Support / Re: Is there any magic to compile(true)?
April 06, 2025, 09:25:41 AM
To elaborate, I get a List<Channel> for the entire animation set from my importer. But without knowing what's what, I don't know how to create the individual clips of the different animations.
#5
Support / Re: Is there any magic to compile(true)?
April 05, 2025, 09:04:39 AM
I will make a minimalist demo. Would you also help me parse the animations? Because that's basically the one thing that I haven't yet added to the glb thing. At some point I'll go back to the cloth simulation, too. I want to have all of these toys in jpct.
#6
Support / Re: Is there any magic to compile(true)?
March 05, 2025, 09:31:30 AM
GenericVertexController. Is there another way? Anyway, what values should I plug in for compile()?
#7
Support / Re: Is there any magic to compile(true)?
February 26, 2025, 08:46:00 PM
I just tried, since I don't know what to put in for batchSize, the following. Still breaks the animation.

obj.compile(true, true, true, false, -1);
#8
Support / Re: Software Render Color Depth
February 26, 2025, 02:38:36 AM
Now I want the same code to also work with OpenGL. But I'm getting:
QuoteException in thread "main" java.lang.NullPointerException: Cannot read the array length because "this.texels" is null
#9
Support / Is there any magic to compile(true)?
February 24, 2025, 08:52:34 PM
I can do compile(true) and not lose animations on Raft's bones. But it breaks the animations on my GLB models with my own bone structure. Is there anything that I should be overriding and adding? If not, would you have a clue as to what's doing this?
#10
Support / Re: Software Render Color Depth
February 16, 2025, 09:52:21 PM
Thanks a lot. It is unnecessarily complicated, though, isn't it?
#11
Support / Re: Software Render Color Depth
February 12, 2025, 07:21:56 AM
I tried texture.setAlpha(). Even tried replacing the texture in the texture manager. It doesn't change the object's opacity in any way.
#12
Support / Re: Software Render Color Depth
February 09, 2025, 08:47:48 PM
So is there no way to do a proper fadeout?
#13
Support / Re: Software Render Color Depth
February 08, 2025, 10:06:59 PM
I thought that it was a color thing that nothing I do makes an object fade in or out with the software render. This is a basic test I wrote (several different attempts in there, none of which work):


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

public class Transparency extends Frame implements WindowListener {
    private World theWorld;
    private FrameBuffer buffer;
    private Camera cam;
    private Object3D obj;
    private boolean keepGoing, turnRight, turnLeft;
    private com.threed.jpct.util.KeyMapper keyMapper;
    private Texture boxMap;
    private int transparency = 0;
    private FadeoutEffect effect;

    public Transparency() {
       this.setTitle("BR's");
       theWorld = new World();
       buffer = new FrameBuffer(1440, 900, FrameBuffer.SAMPLINGMODE_NORMAL);
       obj = com.threed.jpct.util.ExtendedPrimitives.createBox(new SimpleVector(2f, 2f, 2f));//Primitives.getCube(1f);
       TextureManager.getInstance().addTexture("boxMap", (boxMap=new Texture("BoxMap.png", true)));
       boxMap.setEffect((effect=new FadeoutEffect()));
       obj.setTexture("boxMap");
       obj.build();
       obj.setTransparencyMode(Object3D.TRANSPARENCY_MODE_DEFAULT);
       obj.setTransparency(transparency);
       Object3D backgroundPlane = Primitives.getPlane(1, 4f);
       backgroundPlane.build();
       backgroundPlane.translate(0f, -2f, 0f);
       theWorld.addObject(backgroundPlane);
       cam = theWorld.getCamera();
       cam.moveCamera(Camera.CAMERA_MOVEOUT, 8f);
       theWorld.addObject(obj);
       obj.setLighting( Object3D.LIGHTING_NO_LIGHTS );
       keyMapper = new com.threed.jpct.util.KeyMapper(this);
       this.addWindowListener(this);
       this.setSize(buffer.getWidth(), buffer.getHeight());
       this.setVisible(true);
       loop();
    }

    public void loop() {
       keepGoing = true;
       while (keepGoing) {
           buffer.clear();
           com.threed.jpct.util.KeyState keyState = keyMapper.poll();
           if (keyState.getState() == com.threed.jpct.util.KeyState.PRESSED)
              keyPressed(keyState.getKeyCode());
           else if (keyState.getState() == com.threed.jpct.util.KeyState.RELEASED)
              keyReleased(keyState.getKeyCode());
           if (turnRight)
              obj.rotateY(-.01f);
           if (turnLeft)
              obj.rotateY(.01f);
           theWorld.renderScene(buffer);
           theWorld.draw(buffer);
           //theWorld.drawWireframe(buffer, Color.yellow);
           buffer.display(this.getGraphics());
           Thread.yield();
       }
       buffer.dispose();
       this.dispose();
       System.exit(0);
    }

    private void keyPressed(int keyCode) {
       if (keyCode == KeyEvent.VK_RIGHT)
           turnRight = true;
       if (keyCode == KeyEvent.VK_LEFT)
           turnLeft = true;
    }
    private void keyReleased(int keyCode) {
       if (keyCode == KeyEvent.VK_RIGHT)
           turnRight = false;
       if (keyCode == KeyEvent.VK_LEFT)
           turnLeft = false;
       if (keyCode == KeyEvent.VK_T) {
           float fade = 1.00f;
           if (transparency < 255)
              fade = (float)((transparency+=8)/255f);
           effect.transparency = 255-transparency;
           obj.setTransparency(255-transparency);
           //boxMap.setAlpha(255-transparency);
           TextureManager.getInstance().replaceTexture("boxMap", boxMap);
           //obj.setAdditionalColor(intensity(boxColor, fade));
           //boxMap.applyEffect();
           Logger.log("Transparency: "+transparency, Logger.MESSAGE);
       }
    }
    public void windowClosing(WindowEvent e) {
       keepGoing = false;
    }
    public void windowClosed(WindowEvent e) {}
    public void windowOpened(WindowEvent e) {}
    public void windowActivated(WindowEvent e) {}
    public void windowDeactivated(WindowEvent e) {}
    public void windowIconified(WindowEvent e) {}
    public void windowDeiconified(WindowEvent e) {}

    public static void main(String[] args) {
       new Transparency();
    }
}
class FadeoutEffect implements ITextureEffect {
    public int transparency;
    private Texture tex;
    public FadeoutEffect() {
    }

    public void init(Texture texture) {
       this.tex = texture;
    }

    public void apply(int[] dest, int[] src) {
       /*for (int y =0; y < 512;y++) {
              for (int x = 0; x < 512; x++) {
                     dest[y*x] = transparency;
              }
       }*/
       tex.setAlpha(transparency);
    }

    public boolean containsAlpha() {
       return false;
    }
}
#14
Support / Software Render Color Depth
February 07, 2025, 11:08:25 PM
If I'm not mistaken, the software renderer works with 16 bits for color (and a third byte for transparency?). Is it trivial giving it all 24 bits (plus a byte for transparency). If so, would you?
#15
News / Re: Forum upgraded to 2.1.4
January 31, 2025, 09:52:55 PM
Please try to search for a topic. It doesn't fail sometimes, it fails every time.