Recent Posts

Pages: 1 2 [3] 4 5 ... 10
21
Support / Re: Box sides action
« Last post by EgonOlsen on February 07, 2019, 06:04:21 pm »
Yes, I got that. And picking is the way to do just that. Actually, the wiki page contains everything that you have to know to get at least the picking itself working. What exactly does "it doesn't pick" mean in this context? Have you checked that your picking coordinates correct?
22
Support / Re: Box sides action
« Last post by itsmeveno on February 06, 2019, 11:56:24 am »
Thank you for that but when i try the codes it doesn't pick the faces/sides of a box.
What i want to do if to make every action of the sides of my box.
23
No, not out of the box.
24
Support / Re: TextureManager getNames truncates filenames after 3DS import from Blender
« Last post by rbj on February 05, 2019, 10:45:56 am »
AH, good to know, thanks.

From what I read the DAE/Collada import is not supported for jpct-ae, right?
25
Support / Re: Box sides action
« Last post by EgonOlsen on February 05, 2019, 07:59:45 am »
You can implement picking like so: http://www.jpct.net/wiki/index.php?title=Picking

In addition (to get the polygon that's affected by picking), you have to add a CollisionListener implementation of your own to the picked object, that returns true on requiresPolygonIDs. You can then ask the collision event for the polygon's id and armed with that, you can "guess" which side has been picked. The mapping between ID and your side has to be done by youself, but it in case of a cube, it shouldn't be too hard to figure it out.
26
The 3ds format does that, not the importer.
27
Support / Re: Scale X and Y axis
« Last post by itsmeveno on February 05, 2019, 04:25:57 am »
Thanks for this.
28
Support / Box sides action
« Last post by itsmeveno on February 05, 2019, 12:13:35 am »
Good day any idea on how to give an action of the sides of a box. By clicking or dragging the sides.
Like for example i drag the top sides. going up. it scale the box vertically.

Thanks :) :) :)
29
Support / TextureManager getNames truncates filenames after 3DS import from Blender
« Last post by rbj on February 01, 2019, 11:08:38 am »
Hi all!

I am importing *.3ds files from Blender to JPCT-AE
Using the code below to get the textures names I see that the textures can not be loaded because the filenames are truncated:
-> Texture file not found: alienmat1.jp
-> Texture file not found: flagtexture.
These should be alienmat1.jpg and flagtexture.jpg
The names are truncated at 12 characters (old DOS 8.3 file names?)

Code:
        private void checkTextures() {
            int texCnt = TextureManager.getInstance().getTextureCount();
            Log.d(TAG, ">> Have " + texCnt + " textures");
            if (texCnt > 0) {
                Set<String> texNames = TextureManager.getInstance().getNames();
                Iterator itr = texNames.iterator();
                while (itr.hasNext()) {
                    String tex = itr.next().toString();
                    Log.d(TAG, "Texture " + tex);
                    try {
                        TextureManager.getInstance().replaceTexture(tex, new Texture(mContext.getAssets().open(tex.toLowerCase())));
                    } catch (java.io.FileNotFoundException e ) {
                        Log.d(TAG,"-> Texture file not found: "+tex);
                    } catch (java.io.IOException e) {
                        e.printStackTrace();
                    }
                }
            }
        }

Why? Anyone also experiencing this?

Robert
30
Support / Re: Scale X and Y axis
« Last post by EgonOlsen on February 01, 2019, 08:30:14 am »
Apart from that: We are talking about Android/jPCT-AE here? In that case, you can't do it this way unless some more setup work which might not be worth it. There's another way, though. You can tweak the rotation matrix directly. This has some drawbacks as well, in particular it might increase a light source's brightness on the scaled object when it shouldn't and it doesn't work well together with the build-in scale methods. Anyway, this is how it works:

Code: [Select]
Matrix scale=new Matrix();
scale.set(0, 0, 2); // 0,0 for x-axis scaling, 1,1 for y, 2,2 for z
obj.getRotationMatrix().matMul(scale);

If you otherwise don't change the rotation matrix, you only have to apply this once. If you set it to a new anyway in each frame (or even sometimes), you have to apply this afterwards. Also keep in mind that scaling is cumulative. That means that doing this by 2 and then by 3 will result in a scaling of 6.
Pages: 1 2 [3] 4 5 ... 10