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 7914465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:07:30+00:00 2026-06-03T14:07:30+00:00

I am doing an assignment for my course where I need to rotate a

  • 0

I am doing an assignment for my course where I need to rotate a cube about a given axis. I can not use MATLAB functions, so I need to do it manually.

This is my attempt that is to no avail.
`

function [ CV ] = rotateCubeX( CV, degrees )
    %CV = input vertices/Return val
    %degrees = amount of degrees to rotate
    alpha = degrees * pi/180;
    rotate = zeros(3,3);
    rotate(1,1) = 1;
    rotate(2,2) = cos(alpha);
    rotate(2,3) = -sin(alpha);
    rotate(3,2) = sin(alpha);
    rotate(3,3) = cos(alpha);
    CV = CV * rotate;
    end

Before:

25.2000 5.9000 2.5000 
25.7000 5.9000 2.5000 
25.7000 7.9000 2.5000 
25.2000 7.9000 2.5000 
25.2000 5.9000 2.8000 
25.7000 5.9000 2.8000 
25.7000 7.9000 2.8000 
25.2000 7.9000 2.8000 

After:

-10.3544 -23.7200 2.5000 
-10.6536 -24.1205 2.5000 
-9.0513 -25.3175 2.5000 
-8.7521 -24.9169 2.5000 
-10.3544 -23.7200 2.8000 
-10.6536 -24.1205 2.8000 
-9.0513 -25.3175 2.8000 
-8.7521 -24.9169 2.8000 

No change in image.

I am sure I am forgetting something silly.

  • 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-03T14:07:32+00:00Added an answer on June 3, 2026 at 2:07 pm

    What is the axis you expect to rotate about? How have you accounted for that in your code?

    If you are trying to rotate about an arbitrary axis, then the general formula for rotation about an arbitrary axis is here. (look under Other Ways to Build a Rotation Matrix). Pay attention to handedness and whether you are using row-major or column major matrices!

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

Sidebar

Related Questions

I am doing an assignment where I need to use pthreads or semaphores to
I am doing an assignment in a university course and I am using Git
I'm doing a homework assignment for my course in C (first programming course). Part
I'm doing the fourth assignment on the Stanford Iphone Dev Course. - (void)applicationDidFinishLaunching:(UIApplication *)application
While doing an assignment for a course and learning C++ while doing it, I
I'm doing an assignment about planning for tower of Hanoi problem using linear planning
I am doing a assignment about this. For Eaxmple: I have a message (String),
I'm doing an assignment for my Data Structures class. we were asked to to
I was doing an assignment, tried simplifying code with same results. unsigned char x=5;
so we're doing this assignment at Uni and i have a serious craving to

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.