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.


Topics - Windmiller

Pages: [1]
1
Support / jPCT(-AE) origins
« on: December 08, 2021, 10:38:19 pm »
Is it Helge Foerster who made the engine?

I've decided to send a mail to the info address instead with these questions.

Thanks again :)
Seems so... https://www.jpct.net/imprint.html
Most likely also the very person you've been talking with hehe

Thanks a bunch for all the help and support, and the engine is wonderful by the way I think I've never mentioned it before.
Is there somewhere I can read of how, when and why the engine came to be? It would be very interesting to read and know more about the background, there's a lot of information about it to read but I donīt think I've seen anything about that.
Would be interesting to know indeed

Aaaa hehe that's cool, I was uncertain because to me Egon Olsen is a Danish or Norwegian name so I though Egon was from somewhere around up here (Sweden). But apparently he was from the country down beneath instead and it was just a sidekick username then :D

And yes it would be interesting to know more.

2
Support / ShadowHelper and special Textures
« on: December 04, 2021, 01:49:29 pm »
Hi,

The problems seems to be piling up for me now, don't know why.

I added a ShadowHelper and added a Sphere as a receiver and a Primitives.getCube as a caster placed just over the surface of the Sphere, the sphere is made in Blender.

Everything is working and I've made the shadow visible like it should be, but that's only if I'm applying the sphere's texture directly with the following code..

Code: [Select]
sphere.setTexture("entityTexturePlanet");

From there everything is just fine, but if I'm using the following method to add the texture..

Code: [Select]
setTexture(sphere);

Calling the following function..

Code: [Select]
private static void setTexture(Object3D obj) {
        TextureManager tm = TextureManager.getInstance();

        obj.calcBoundingBox();

        float[] bb = obj.getMesh().getBoundingBox();

        float minX = bb[0];
        float maxX = bb[1];
        float minY = bb[2];
        float maxY = bb[3];
        float dx = maxX - minX;
        float dy = maxY - minY;

        float dxs = dx;
        float dys = dy;

        dx /= 20f;
        dy /= 20f;

        float dxd = dx;
        float dyd = dy;

        int tid = tm.getTextureID("entityTexturePlanet");
        int bid = tm.getTextureID("ice");

        PolygonManager pm = obj.getPolygonManager();
        for (int i = 0; i < pm.getMaxPolygonID(); i++) {

            SimpleVector v0 = pm.getTransformedVertex(i, 0);
            SimpleVector v1 = pm.getTransformedVertex(i, 1);
            SimpleVector v2 = pm.getTransformedVertex(i, 2);

            // Assign textures for the first three layers (the "normal"
            // textures)...
            TextureInfo ti = new TextureInfo(tid, v0.x / dx, v0.y / dy, v1.x / dx, v1.y / dy, v2.x / dx, v2.y / dy);

            // Assign the splatting texture...
            ti.add(bid, -(v0.x - minX) / dxs, (v0.y - minY) / dys, -(v1.x - minX) / dxs, (v1.y - minY) / dys, -(v2.x - minX) / dxs, (v2.y - minY) / dys, TextureInfo.MODE_ADD);
            pm.setPolygonTexture(i, ti);
        }

Then the shadow totally disappears, this also happens if I'm using the bump map example that I've previously found..

Code: [Select]
TextureManager tm = TextureManager.getInstance();

                    Texture face = new Texture(res.openRawResource(R.raw.face2));
                    Texture normals = new Texture(res.openRawResource(R.raw.face_norm), true);
                    Texture heighty = new Texture(res.openRawResource(R.raw.face_height2));

                    TexelGrabber grabber = new TexelGrabber();
                    heighty.setEffect(grabber);
                    heighty.applyEffect();
                    int[] heighties = grabber.getAlpha();

                    AlphaMerger setter = new AlphaMerger(heighties);
                    normals.setEffect(setter);
                    normals.applyEffect();

                    tm.addTexture("face", face);
                    tm.addTexture("normals", normals);

                    TextureInfo ti = new TextureInfo(TextureManager.getInstance().getTextureID("face"));
                    ti.add(TextureManager.getInstance().getTextureID("normals"), TextureInfo.MODE_BLEND);

                    // Calculate for texturing..
                    sphere.calcTextureWrapSpherical();

                    sphere.setTexture(ti);

                    sphere.compile();
                    sphere.build();

Must be something that I'm not thinking of here? :/
Is these two later methods overwriting the shadow map? What is going on here?

Regards,

3
Hi!

I was thinking about different approaches to load low res textures to apply on a 3D object that is far away and load and apply high res when getting closer, but how to know what size of texture the device can handle before getting out of memory or something like that?
Someone who has an idea, and would like to think me in the right direction.
Should I use and count on the different resolution "res" folders in Android or is there a better solution?

Regards..

4
Support / Are JPCT going to be updated to meet the LWJGL V3.* ??
« on: December 29, 2020, 03:36:10 pm »
Hi!

Is JPCT going to be updated to meet the LWJGL V3.X ??
Because some functions that the desktop version of JPCT is using have been lifted out of the LWJGL since V2.* like the Display (and other functions).

JPCT is not working because of the functions that were in LWJGL V2.X are not included anymore and have been changed into newer better ones, more efficient in LWJGL V3.X.

So my question is, are JPCT not going to continue to live?

Anybody?

Regards,

Morgan

5
Hi

I have some difficulties setting a child of a parent object when parent is rotated.

I have a custom sphere object class name TheSphere that extends Object3D and implements CollisionListener
with the following overridden functions..

Code: [Select]
public void collision(CollisionEvent collisionEvent) {

        this.mPickedCoordinate = collisionEvent.getFirstContact();
    }

    @Override
    public boolean requiresPolygonIDs() {
        return true;
    }

And from the Graphics thread I'm taking the value stored in this.mPickedCoordinate to add a Primitives.getCube() at that coordinate with the following code.

Code: [Select]
SimpleVector touchPoint = Interact2D.reproject2D3DWS(cam, fB, (int) x, (int) y);
float distance = theSphere.calcMinDistance(camPos, touchPoint, 1000);

SimpleVector pickedCoordinate = theSphere.mPickedCoordinate;
pickedCoordinate.sub(SimpleVector.create(theSphere.getPosX(), theSphere.getPosY(), theSphere.getPosZ()));

Object3D cube = Primitives.getCube(5f);
theSphere.addChild(cube);
cube.translate(pickedCoordinate);
world.addObject(cube);

So when I'm touching the sphere it places a cube at the right point, but if I rotate the sphere and touch it again then a new cube will be added to the rotated side and not where I've put my finger.

How can I add a cube to the point where I've touched the sphere even when the sphere has been rotated up or down side to side doesn't matter as long as it places the cube where my finger where.

getFirstContact will always return the (not) rotated point :(

I'm lost here, please help me.

Regards, M

6
Hello

Some objects (Randomly) are turning into black after screen orientation change or powering up from standby,
they do not come back from that black state.
Completely black, no light reflections or anything. It doesn't matter how many objects I'm loading or whether they have textures or not even if I'm just using Primitives getCube. This happens on both my devises that I'm testing on (a Nexus 7 and a Samsung Galaxy 8)

I don't understand why this happens, my project is the HelloWorld that I've changed a bit but not much.
Anyone who can recognize the behavior and give me a light pointing in the right direction?

Edit: seems to be something with that I'm using..

Code: [Select]
shareCompiledData(mObj);
shareTextureData(mObj);

Edit 2: Actually it seems to be in combination with this line..

Code: [Select]
.setEnvmapped(Object3D.ENVMAP_ENABLED);

If I remove the  environment mapping for the object the problem goes away!? Why??

Regards, M

7
Support / Rotate object according to forward and downward vectors
« on: April 17, 2020, 12:01:52 am »
Hello

I'm trying to rotate a cube in object's space (local) based on a forward and a downward vector.
I want one of the object's side faces to point in a forward vector, while the cube's down face is pointing in the downward vector's direction.

How can this be done with Jpct-AE? I now how to do it in Monogame, but I can't make it happen with Jpct

I can make one of the directions with the following code, here the forward as an example..

Code: [Select]
cube.setRotationMatrix(forwardVector.getRotationMatrix());
But How do I combine this with the downward vector??


Regads, M


Pages: [1]