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

  • Home
  • SEARCH
  • 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 6120671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:41:43+00:00 2026-05-23T15:41:43+00:00

Im trying to do a Matrix.rotateM(); and i noticed if all the parameters beside

  • 0

Im trying to do a Matrix.rotateM(); and i noticed if all the parameters beside the matrix itself is 0.0f then the Matrix will get messed up with some NaN values.

mModelMatrix = new float[16];
Matrix.setIdentityM(mModelMatrix, 0);
Matrix.rotateM(mModelMatrix, 0, 0.0f, 0.0f, 0.0f, 0.0f);

Results in a Matrix like this.

[NaN, NaN, NaN, 0.0]
[NaN, NaN, NaN, 0.0]
[NaN, NaN, NaN, 0.0]
[NaN, NaN, NaN, 1.0]

Before the rotation the Matrix looks like this

[1.0, 0.0, 0.0, 0.0]
[0.0, 1.0, 0.0, 0.0]
[0.0, 0.0, 1.0, 0.0]
[0.0, 0.0, 0.0, 1.0]

But if my call to Matrix.rotateM() contains values that are not 0.0f then the matrix looks fine. Is that a expected behavior? Or am i doing something wrong?

  • 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-05-23T15:41:43+00:00Added an answer on May 23, 2026 at 3:41 pm

    As stated in the doc :

    Rotates matrix m in place by angle a
    (in degrees) around the axis (x, y, z)

    The axis you are trying to rotate around is null. There’s no way to rotate around a null axis, it just doesn’t know how to rotate, and fails. I generally use 1.0f for either x, y, or z, and 0.0f for the other 2. That gives you a rotation around a given axis.

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

Sidebar

Related Questions

I'm trying to invert a matrix with some symbolic variables, but Matlab just returns
I am trying to simply multiply a matrix to an image an get an
I'm trying to rotate and then scale an image using android.graphics.Matrix. The code is
I was trying to implement a Matrix.class to learn some Java. Right now, I
I am trying to create a simple matrix library in C++ that I will
I'm trying to create a matrix M satisfying: M(i,j) = f(i,j) for some f.
Iam trying to calculate PCA of a matrix. Sometimes the resulting eigen values/vectors are
I am trying to encode a matrix that i have (after calculating frame differences)
I am trying to create a matrix that is 3 x n, with each
I am trying to create the below matrix in my vb.net so during processing

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.