Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7918273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T15:26:45+00:00 2026-06-03T15:26:45+00:00

How do I figure out the new angle and rotation vectors for the most

  • 0

How do I figure out the new angle and rotation vectors for the most visible side of the cube?

Why: The user can rotate cube, but when finished I’d like the cube to snap to a side facing the user.

What: I’m currently using CoreAnimation in iOS to do the rotation with CATransform3D. I have the current angle and the rotation vectors so I can do this:

CATransform3DMakeRotation(angle, rotationVector[0], rotationVector[1], rotationVector[2]);

Additional Info: I’m currently using Bill Dudney’s Trackball code to generate movement and calculate angle and rotation vector.

I need the cube to rotate so the purple side is facing user

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T15:26:46+00:00Added an answer on June 3, 2026 at 3:26 pm

    Your camera’s lookAt vector – probably {0, 0, 1} – determines what side is closer to user.

    You need to create normal for every side of the cube. Then rotate them in same way as cube. After that, calculate the angle between every normal vector and the camera lookAt vector using a dot product. Whichever normal has the largest dot product is the side closest to the camera.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey I can't figure out what the equation to find the new angle of
I can't figure out how to produce drawables for the new high-res handhelds like
I'm new to MVC3 and I can't figure out how to use checkboxes in
we're rolling out a new voicemail system, and trying to figure out a way
I'm trying to figure out how my new app should handle data. In previous
I am trying to figure out exactly what these new fangled data stores such
I'm new to Javascript and I was trying to figure out how to move
I'm trying to figure out whether the code located after throw new Exception in
I'm trying to figure out how to load a new image with ajax when
I'm trying to figure out how to redirect to a new page (different application,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.