Control rotation of a 3D object using the touchscreen

by Mac » Thu, 27 Jan 2011 12:32:06 GMT


Sponsored Links
 Hello all, I'm a 4th year computer engineering student and have some
experience with Android dev.

I am working on an application that has a 3D component to it which
requires me to be able to rotate it around. I was looking at the
example at the android resources site.

 http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/TouchRotateActivity.html 

This example does not talk about rotation around the z-axis. I have
already tried using Quaternion for the rotations but I don't
understand how to get rotations around the z-axis

I was wondering if anyone can help me with learning how to just be
able to rotate around an object. like the example above but also
around the z-axis. I have already spend about 24 hours searching and
trying to figure this out.

The bigger issue is that once you rotate 90 degrees around the y-axis
how can you detect that the next rotation (going vertically on the
touchscreen) should be around the z-axis.

Thank you in advance.
Mac

-- 



Other Threads

1. userdata-qemu.img Help

Is it possible to extract the files and data out of userdata-qemu.img
from the emulator? I have tried it with the unyaffs tool, but it does
not seem to work. Thanks.
--~--~---------~--~----~------------~-------~--~----~

2. A problem for arm-eabi-gdb to load sharedlibrary

Dear all,

It seems that Android prebuilt arm-eabi-gdb will have problem to load
some shared library. arm-eabi-gdb will load the shared library to
wrong address, such as 0xfff?????. Then we can't set & trace the
breakpoints of these libraries.

We got the warning message like these:
.dynamic section for "libhardware.so" is not at the expected address
difference appears to be caused by prelink, adjusting expectations

After review the code of android toolchain, I remove some code in
android-toolchain-20081019/gdb-6.6/gdb/solib-svr4.c

          /* If the changes match the alignment requirements, we
             assume we're using a core file that was generated by the
             same binary, just prelinked with a different base offset.
             If it doesn't match, we may have a different binary, the
             same binary with the dynamic table loaded at an unrelated
             location, or anything, really.  To avoid regressions,
             don't adjust the base offset in the latter case, although
             odds are that, if things really changed, debugging won't
             quite work.  */
#if 0
if ((l_addr & align) == 0 && ((dynaddr - l_dynaddr) & align) == 0)
{
    l_addr = l_dynaddr - dynaddr;
    warning (_(".dynamic section for \"%s\" "
        "is not at the expected address"), so->so_name);
    warning (_("difference appears to be caused by prelink, "
        "adjusting expectations"));
}
else
#endif
     warning (_(".dynamic section for \"%s\" "
         "is not at the expected address "
         "(wrong library or version mismatch?)"), so->so_name);

Then it can load sharedlibrary normally. But I'm not sure if it's
right solution to resolve this issue. So post these message. Anyone
can help?

Regards,
Jill
--~--~---------~--~----~------------~-------~--~----~

3. How to set application background image easily?

4. Debugging a service

5. How do i run the emulator?

6. XML and Java/Android

7. Notice: Build brea