Questions tagged [gl-matrix]

Javascript Matrix and Vector library for High Performance WebGL apps.

Resources:

40 questions
0
votes
1 answer

How to understand/use gl-matrix function fromRotationTranslationScale()

I have a cube in GL in this plunkr that looks like this: I would like to scale, rotate and translate the cube from a pivot. to hopefully make it animate like https://www.youtube.com/watch?v=sZeBm8EM3mw&feature=youtu.be For this transformation I'll…
Armeen Moon
  • 18,061
  • 35
  • 120
  • 233
0
votes
1 answer

how to convert world space transform to object space transform?

i'm trying to implement : transform.InverseTransformPoint(Vector3) and transform.InverseTransformDirection(Vector3) using glm library in opengl. i have view ,projection ,model matrices for each object. actually i don't know what i must to do with…
masoud khanlo
  • 189
  • 1
  • 14
0
votes
1 answer

webgl rotate texture on the face of cube does not rotate around itself

i need help with webgl. i draw a simple cube and apply texture on each face of cube,and i am rotating the texture on the each face of the cube but the problem is: the texture does not rotate around itself it rotate's around left bottom corner of the…
sam
  • 335
  • 2
  • 5
  • 19
0
votes
0 answers

How to calculate difference between two spatial rotations

I'm trying to convert physical orientation of a mobile device got from deviceorientation event to a series of camera rotations in my sort of 3D viewer. The problem is that I need to do spatial rotation relative to the first orientation taken from…
hindmost
  • 7,125
  • 3
  • 27
  • 39
0
votes
0 answers

Multiplying not working with with gl-matrix.js's function mat4.multiply

I want to multiply 2 matrices with the gl-matrix.js library gl matrix mat4 The multiplication does work f.e. this : var testMat = mat4.create(); mat4.multiply(testMat, this._transformations[0].transformation,…
greedsin
  • 1,252
  • 1
  • 24
  • 49
0
votes
1 answer

How can I use GLMatrix to do matrix multiplications?

I'm just beginning to try to find/use a matrix operations library for JS. I want to do simple translation, scale, and rotation operations on 2D matrices. The mozilla developer website recommends GLMatrix for its "focus on speed and performance." …
user2441511
  • 11,036
  • 3
  • 25
  • 50
0
votes
1 answer

Adding a Property to the Top-level Object in a Node Module

In a node.js module a variable declaration stays private inside the module: var a = 'x'; Let's say, I want to declare a number of variables in this manner. I cannot use the following code, because like this the variables become really global and…
Anton Harald
  • 5,772
  • 4
  • 27
  • 61
0
votes
1 answer

Quaternion rotation by phi and theta instead of xyz in gl-matrix

gl-matrix's quaternion object has 3 functions rotateX, rotateY and rotateZ which rotates quaternion by the specific axis. Now I want to do the same using phi and theta instead of xyz. How is this possible ? Is it possible to extract some value then…
Mohebifar
  • 3,341
  • 1
  • 24
  • 32
0
votes
2 answers

distance/magnitude between quaternions, but ignore roll

I'm searching for a way to determine if a camera (a) is looking at the same direction than a specific object (b). I'm only working with the rotations because here we don't care about the positions (so we can consider both are located at the…
Sebastien C.
  • 4,649
  • 1
  • 21
  • 32
-1
votes
1 answer

How am I supposed to use glMatrix 2.3.2 in a HTML project?

I am doing a HTML/Javascript project and part of it involves using glMatrix. My problem is that I have no idea how it actually implement it and use it. I tried doing what you'd usually do to use a Javascript file in a HTML page:
1 2
3