Jump to content

[SOLVED] Strange results from Matrices


Recommended Posts

When trying to achieve a task involving matrices I found I did not get the expected results on my mesh. Exploring further and checking out values using using the console I found I was getting integers not floating point values when displaying individual elements of a matrix. This is the same in Firefox and Chrome. If it is not some sort of console error then the use of individual elements for calculations within BJS could not be right (but BJS works?).

Here is a PG example that shows what I mean http://www.babylonjs-playground.com/#1ST43U#13

After the matrix is computed the first four elements of the matrix are displayed, but always show as 1, 0, 0, 0

The matrix is displaced and the values in this matrix are floats as you would expect.

However cloning the matrix (and matrix.clone() accesses individual matrix elements) and displaying the clone results in displaying the clone as the identity matrix.

I have tries BJS2.3 and BJS2.4 and the results are the same.

Everything I have read on Float32Array seems to suggest that accessing individual elements of such a matrix using array notation, eg [ ] should work

An image of such a set of results is shown below.



What is happening?


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...