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

#1
Okey, its only converting from 3x3 array to 4x4 matrix:

private Matrix getRotationMatrix(float[] data) {
            Matrix ret = new Matrix();

            for (int i = 0; i < 3; i++) {
                for (int j = 0; j < 3; j++) {
                    ret.set(i, j, data[i * 3 + j]);
                }
            }
            ret.setRow(3, 0, 0, 0, 1);
            ret.setColumn(3, 0, 0, 0, 1);
            return ret;
       }
#2
Here is code for my transformation:

            cam = world.getCamera();
            Matrix r = getRotationMatrix(rotationMatrix);
            r.transformToGL();
            cam.setBack(r);


where rotationMatrix is matrix from gyroscope. Method getRotationMatrix is just converting between different data types for matrices. Do you think that I should do some extra transformation? I thought that its not necessary when all three rotations are in the right direction.
#3
Support / Re: Move object by touch in x and y axis
September 09, 2014, 01:44:10 PM
Well I am basically trying to achieve the same effect as with "picking" but I dont want to actually need to pick object. Just everywhere when i touch screen, object should appear on that position. With that code i posted in first post, i was positioning that model on some plane that was parallel with X axis .. and i dont want that, i want to move it on the plane that is parallel with Y axis in some distance that will be constant.
#4
Support / Different camera rotation than device rotation
September 09, 2014, 01:32:06 PM
Hi, Ok i have another silly question. I am implementing some kind of augmented reality application. I am displaying camera preview and overlaying it with 3D object. I am getting data from gyroscope and rotating camera of jpct so object is rotated corresponding with device rotation. My problem is that model is moving quicker than "real world" at camera preview. I thought that it has something to do with FOV so i took that "FOV" code from vuforia sample, but it didnt solve that problem, model was streched and problem with rotation was not solved.

Is there any way how I can "normalize" this movements?
#5
Support / Re: Move object by touch in x and y axis
September 09, 2014, 09:17:44 AM
Thanks for reply .. I am not saying that i dont want to set depth, only that i dont want to change it .. I would like to have that z coordinate always the same and change only x and y.
#6
Support / Move object by touch in x and y axis
September 08, 2014, 02:24:14 PM
Hi, I want to move my finger on the screen and move the object with it. I found here http://www.jpct.net/forum2/index.php?topic=2418.0  example that remap 2D coordinates of touch to 3D coordinates in plane .. but it is not what i want .. i dont want to change "depth" of object, just x and y coordinates. Can I use some of that remapping methods that are in Interact2D class? Or is it somehow easy? Thanks for some hint
#7
Hi, I am trying to make a simple app when user tilt device and model in screen is rotated .. I've found some demos here in forum but I cannot make it work so i started from scratch. I have sucessfully implemented it, object is rotating but I have problem with coordinate system. I cannot find the right way how to convert between android one and jPCT one .. I am using sensor for Rotation vector and its returning quaternion describing rotation .. Then I am using built-in function to create rotation matrix from this quaternion .. and i am trying this matrix remap and use on my model.

Here is my code: http://pastebin.com/Z7cVVXER and here is apk demo of my app: https://www.dropbox.com/s/srcdb1j4idpyzls/app-debug.apk (large size is because of models and other stuff in app)


I tried to use only gyroscope data.. I swapped rotation angle around y and z axes and it was working fine with remap from y to z. But if i tried to compute quaternion manually by integrating as here http://developer.android.com/guide/topics/sensors/sensors_motion.html#sensors-motion-gyro it works but if I shake device or rotate very quickly it made a huge error. Approach with rotation sensor doesnt have this kind of error, but i cant simply swap axes.

If someone of you have any idea how to make it work, I will be very happy. Thanks
#8
Support / Re: Weird texture rendering on OBJ model
July 31, 2014, 11:04:32 AM
Thanks! It was exactly this kind of issue
#9
Support / Weird texture rendering on OBJ model
July 31, 2014, 10:04:30 AM
I am using vuforia with jPCT and i have weird problem with rendering texture on my model. When I try to load model in HelloWorld sample and replace cube with model, everything works fine but when I use exact same code in my app, this problem happened. In the attachment is screen with my problem. My guess is that Vuforia renderer is setting something in openGL but i dont know what because i dont have so much experience with it. If anyone have some idea please share your thoughts.

Attachment - https://www.dropbox.com/s/56lqp290bknn8a9/screenshot_2014-07-30-14-44-09.png
#10
Support / Re: Vuforia Java API integrated with jPCT
July 31, 2014, 08:52:07 AM
I could send you my Example project with some steps I've made. I was using this project that successfuly integrated your tutorial from wiki about vuforia and jPCT - https://github.com/sidneibjunior/vuforia-jpct . Maybe you could add this link to that tutorial either.
#11
Support / Re: Vuforia Java API integrated with jPCT
July 30, 2014, 12:35:32 PM
Well, I figure it out, I have tried to port renderFrame method from C++ to Java and it works .. here is my ImageTargetRenderer class: http://pastebin.com/hCVFik5A
#12
Support / Vuforia Java API integrated with jPCT
July 30, 2014, 11:26:30 AM
Hi, I have seen tutorials and many forum posts about integrating vuforia with jpct but all these posts were about native vufori api based on ImageTargetNative example. Is it possible to use only Vuforia Java API with no need to write C++ code and if it is, is there some kind of example how to do this?

Thanks