Skip to main content
Filter by
Sorted by
Tagged with
-2 votes
1 answer
84 views

i am developing a web app that will be able to do some image transformations one of them is image rotation, the problem is: as long as the canvas is square ( width = height ) every thing is ok, but ...
Andrew Naem's user avatar
1 vote
2 answers
396 views

I draw a unit sphere of objects (stars, sprites etc), which all have 3D coordinates on the "surface" of that sphere. The camera is at the center of it and I use perspective projection to ...
1valdis's user avatar
  • 1,144
0 votes
0 answers
44 views

I use glmatrix 3.4.0 . Any suggestion ! mat4.identity(object.mvMatrix); this.mvPushMatrix(object.mvMatrix, this.mvMatrixStack); mat4.translate(object.mvMatrix, object.mvMatrix, object.position....
Nikola Lukic's user avatar
  • 4,274
2 votes
0 answers
255 views

EDIT3: Hi, The question might not be super clear, that is because I'm not sure I completely understand the problem myself. I think it seems to be "negative w" causing the issue. Other posts ...
user1643428's user avatar
0 votes
1 answer
44 views

I use gl-matrix JS library to transform points in 3d. When I use model-view matrix (lookAt), the transformed points make sense. But when I add perspective projection on top of that, the resulting ...
Jakub M.'s user avatar
  • 34.1k
1 vote
1 answer
366 views

I'm a beginner in WebGL and graphics programming in general. I'm trying to render procedurally generated terrain. My first stab at this seemed to work and I get the following result. I want to add ...
Andrew Lubrino's user avatar
1 vote
1 answer
3k views

I wanna add dir and amb light to the cubeMap sampler. Any sugestion? FS // shader for opengles native 'uniform samplerCube' CubeMap canvas2d textures. precision mediump float; precision ...
Nikola Lukic's user avatar
  • 4,274
1 vote
1 answer
171 views

I am trying to create a zooming image tool and for this I am using matrix3d with glMAtrix https://glmatrix.net/ I have the following components: canvas (black) which represents the final view smaller ...
V. Sambor's user avatar
  • 13.4k
1 vote
1 answer
1k views

I am building a 2d graphics engine using webgl, JavaScript and HTML, I wanted the gl-Matrix.js graphics library to do transformations so, I downloaded the lg-Matrix library zip file from their website ...
equaidell's user avatar
1 vote
1 answer
1k views

I'm trying to understand quaternions and am having a lot of trouble converting it into something actually useful. I've watched some 3blue1brown videos and read some tutorials, but I can't seem to ...
Jason Goemaat's user avatar
1 vote
1 answer
407 views

everyone. I am using DLNM in R to analyze to lag-effect of climatic conditions on the prevalence of the disease. I followed somebody else's program strictly , and it worked in avg.temp and max.speed, ...
smallskink's user avatar
1 vote
1 answer
3k views

I am new to 3d graphics, and I am trying to figure out how to use the lookAt and perspective matrices in the glMatrix math library. Not trying to do anything fancy at this point, but I believe I am ...
user1763510's user avatar
  • 1,310
0 votes
0 answers
170 views

I'm building a simple particle system using javascript, webgl2, and gl-matrix. I have a circle mesh, some colors, some positions, a camera view matrix and a projection matrix. I can render un-rotated ...
whiterook6's user avatar
  • 3,574
4 votes
3 answers
5k views

Hi, I downloaded toji-gl-matrix-21b745f. I copied the file dist/gl-matrix-min.js inside the web-root folder. In index.html i have: <script src="gl-matrix-min.js"></script> <...
FF84's user avatar
  • 51
2 votes
1 answer
1k views

I'm trying to learn the basics of webgl and following the MDN tutorial here. However, my rendering script (render.js) does not recognize the included gl-matrix script. Running index.html in Chrome(...
makenzin's user avatar
3 votes
1 answer
2k views

I have a custom .d.ts file for an external module that looks like declare module 'vertices-bounding-box' { export default function boundingBox(positions: [number,number,number][]): [number, number] }...
kevzettler's user avatar
  • 5,241
2 votes
0 answers
323 views

I am trying to create a portal rendering engine in WebGL 2.0 (so far I am trying to port this C++ project: https://github.com/HackerPoet/NonEuclidean), and am trying to implement oblique projection in ...
K. Russell Smith's user avatar
1 vote
1 answer
1k views

I'm trying to setup a basic demo of WebGL + TypeScript, rendering a simple rectangle on the screen, adjusted for aspect ratio. I am trying to use gl-matrix to calculate the model-view-projection ...
tonayy's user avatar
  • 313
1 vote
1 answer
328 views

Code: https://plnkr.co/edit/QNA31hMYnIJwotwbaDhT?p=preview Question: How can I interpolate all properties of fromRotationTranslationScaleOrigin from gl-matrixin draw function of this cube? Let's ...
John Abraham's user avatar
  • 18.9k
0 votes
1 answer
362 views

I'm having problem transforming device acceleration values to earth coordinate system in a web app using pure javascript (most questions with solutions are Android or iOS specific). I'm using the gl-...
Robert Kling's user avatar
1 vote
1 answer
1k views

I am using the gl-matrix library. For linear algebra calculations I have a view and projection matrix that I used for my camera in a 3d engine. The view is a lookat matrix. const view = mat4.lookAt(...
kevzettler's user avatar
  • 5,241
1 vote
1 answer
1k views

I am simply trying to create a triangle in the center and rotate the camera around the center. (0,0,0). the code is whipped from multiple tutorial sources and i suspect the problem could be somewhere ...
Sadern Alwis's user avatar
5 votes
2 answers
3k views

I'm trying to create a 2D graph visualization using WebGL (regl, to be more specific). With my current implementation I can already see the force layout being applied to each node, which is good. The ...
Lucas Cardozo's user avatar
2 votes
1 answer
1k views

I'm trying to translate object by using mat4 here.. I know how to rotate the object but I failed to translate the object. I will be very thankful to everyone who helps me because I'm tired of trying ...
Ali jamal's user avatar
1 vote
1 answer
290 views

I haven't been able to update these functions from an old application using glMatrix 1.2 to glMatrix 2.7: calculateNormal() { mat4.identity(this.normalMatrix); mat4.set(this.modelViewMatrix, ...
Detuned's user avatar
  • 3,790
0 votes
1 answer
535 views

I use the glMatrix's method: mat4.lookAt(out, eye, center, up) to set a camera view when a WebGL model is rendering. After the model is rendered, I need to retrieve the center attribute from view/...
pronngo's user avatar
  • 840
1 vote
1 answer
2k views

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=...
John Abraham's user avatar
  • 18.9k
2 votes
2 answers
923 views

I'm writing a library using gl-matrix as a dependency. I'm using webpack to output the src and want to exclude gl-matrix part from my code but list it as a dependency. But turns out I can only packed ...
shrekshao's user avatar
  • 518
-1 votes
1 answer
654 views

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 ...
Galbenshire's user avatar
1 vote
1 answer
11k views

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 ...
masoud khanlo's user avatar
0 votes
1 answer
1k views

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 ...
sam's user avatar
  • 335
1 vote
0 answers
900 views

I have implemented a simple version of a camera. It's only purpose is to look around the scene (which means only rotation). Every frame I update then the mat4.lookAt and mat4.perspective (javascript ...
greedsin's user avatar
  • 1,272
0 votes
0 answers
416 views

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 ...
hindmost's user avatar
  • 7,171
0 votes
0 answers
1k views

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[...
greedsin's user avatar
  • 1,272
0 votes
1 answer
2k views

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 ...
user2441511's user avatar
  • 11.1k
15 votes
3 answers
4k views

In both scenes the transformations have to be swapped in glMatrix. i.e. to achieve 1) in glMatrix: mat4.translate(modelViewMatrix, modelViewMatrix, [0.6, 0.0, 0.0]); mat4.rotateZ(modelViewMatrix, ...
dmr's user avatar
  • 173
0 votes
1 answer
571 views

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 ...
Anton Harald's user avatar
  • 6,014
14 votes
1 answer
2k views

I am rendering a simple torus in WebGL. Rotating the vertices works fine but I have a problem with the normals. When rotated around a single axis, they keep the correct direction but when the rotation ...
Jave's user avatar
  • 31.9k
1 vote
0 answers
2k views

Can anyone explain to me why this doesn't work as I would expect. Using a quaternion to rotate a vec3 [5,0,0] 180degree/Math.PI radians around the z axis. I would think the result would be [-5,0,0]; ...
user155595's user avatar
2 votes
1 answer
2k views

I'm having trouble finding the final bone matrices for my skeleton. I know my bind pose matrices work, and I know my transform matrices work, but I figured multiplying them (which I'm calling the ...
scott_r_howell's user avatar
0 votes
1 answer
413 views

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 ...
Mohebifar's user avatar
  • 3,411
0 votes
2 answers
928 views

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 (...
Sebastien C.'s user avatar
  • 4,860