Cube rotation axis


#1

Hi all,

I have adjusted my cube to the fixed distance from iPad, using this forums post:

When I rotating iPad, axis of cube’s rotation is a top left cube’s side. How to make this axis in the center of the cube ?

Please look at this video:
Video


#2

The reason why the cube is rotating is because I am asumming you are using STCameraPoseInitializerStrategyGravityAlignedAtOrigin.


#3

Yes, Im using STCameraPoseInitializerStrategyGravityAlignedAtOrigin.

But how can I reach the same cube behavior, like in this video ?

Here cube’s rotation axis is exactly in the center of the cube!


#4

What app is that video recorded from?


#5

3D Size Me app by Techmed.
It looks like they are using SDK 0.6.2
How can we adjust Original SDK to have the Bounding Box to be in mid air, parallel to the ground and rotate about Box’s center (not one of the edges of the bounding box as it is in the current SDK when you choose Parallel to the ground)

Thanks a million in advance!


#6

Yes, here is a link to this app:


#7

I would suggest that you take a look at the STCameraPoseInitializerStrategy found in our reference material, specifically STCameraPoseInitializerStrategyGravityAlignedAtVolumeCenter.


#8

So, the 3DSizeMe behavior is a bit puzzling in that even the iPhone camera doesn’t normally rotate in that fashion when the iPhone is rotated! I.E., the real world stays upright independent of portrait v.s. landscape orientation of the phone.

Disregarding that for the moment, what is important for your application? Does the patch I posted in the thread you referenced do most of what you want? I did apply the patch to the 0.8 SDK sample, and I do see that when the iPad is held horizontally, the cube seems to behave exactly as 3DSizeMe. But when the iPad is rotated vertically, I see that the cube slides off to one side of the view. Is that the main issue for your application?

I also wanted to ask if this is a commercial application?

Best regards,

Jim


#9

Jim, Anthony, and everyone who is involved,
Thank you very much for your feedback and help.
We hope one day to be able to call this a commercial application, but for now we are fighting to make a handfull of ipads to work as expected.
If it is indeed confirmed to be a bug when ipad is turned to portrait mode, we will just have to hope that it will be fixed in the future releases of sdk along with other things.

for now will try the patch (since you are confirming that it is the same as it was in 0.6) then will try harder.


#10

I don’t think there’s likely any SDK bug regarding bounding box behavior in portrait mode. Playing with it a bit more is a good idea!

Best regards,

Jim


#11

Have you taken a look at using STCameraPoseInitializerStrategyGravityAlignedAtVolumeCenter? Does this help?


#12

Will try today, thanks for asking.


#13

I tried STCameraPoseInitializerStrategyGravityAlignedAtVolumeCenter, but it behave strange. Looks like with this mode iPad is located inside of the cube (cube is all around you). How to place it on a distance ?


#14

Same behavior here…


#15

I apologize, I was a bit off on my suggestion.

I would try using the other STCameraPoseInitializerStrategy, STCameraPoseInitializerStrategyTableTopCube

To get the cube to float, like in the video you posted before, instead of being grounded to a plane, you need to disable plane detection with the following:

kSTMapperVolumeHasSupportPlaneKey: @NO

I would also recommend that spend a little more time with our reference material and on forums. It definitely helps to spend time experimenting with the options and functions we have available, as there are so many.

For example, a great forum article about allowing the bounding-box to be at a fixed position away from the camera is here: SDK 0.6 Fix the Cube at a certain distance from the user