Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

A 2D array of numbers, symbols or expressions, arranged in rows and columns. Each row must have the same number of columns. The numbers, symbols or expressions themselves are called elements or entries.

0
votes
0answers
13 views

How to calculate new lower/upper points of a 3D Bounding Box after rotation in Processing?

I have a BoundingBox class that I'll provide below. It works for moving objects, but not rotating ones, meaning that if I rotate the object that utilizes the boundingBox the boundingBox has no way to ...
0
votes
0answers
17 views

Tetris like rotation with a list of points

I have a list of points that I want to rotate around the origin by 90, 180 or 270 degrees. This list can be an arbitrary shape such as: ...
1
vote
3answers
60 views

Rotation of a matrix with unequal rows and columns

I have this simple matrix class which has a char** array for storing the data. The data array gets initialized like this: ...
0
votes
1answer
28 views

OpenGL vector rotation matrix to a given point

I have a sphere with a radius of .5 The sphere is centred at 0,0,0 I am now trying to place items around my sphere based on a given x,y,z on the surface of the sphere. My items have been draw/...
0
votes
1answer
65 views

Sun model matrix

I'm playing with sun implementation in my engine and I correctly built model matrix using below order of matrix operations: Translate to camera position. Calculate x and y axis of rotation matrix ...
0
votes
0answers
33 views

Pseudo 3d roguelike: map representation [duplicate]

I know it's a very common question, so I'll try to be specific. I'm working on a pseudo 3d (like Dwarf Fortress or Cataclysm: Dark Days Ahead) roguelike. How you'd represent a map in a roguelike? Let'...
1
vote
1answer
73 views

Why does a translation matrix need extra row?

Following recommendation of this answer I've recently read the series of articles of Wolfire about linear algebra. I'm somewhat familiar with matrices and I came to a conclusion that vector and a ...
0
votes
0answers
25 views

anything wrong with a spherical camera view matrix?

Is there anything inherently wrong, if you derive your view matrix from 2 spherical coordinates (say, phi and theta) on the unit sphere? The z-axis vector would be at, say (phi, theta), the y-axis at (...
1
vote
0answers
23 views

OpenAL listener position for isometric camera

I have an isometric camera for an RTS that looks like this: Basically, I don't know how to set the listener's position in OpenAL because I represent the camera's position with only two coordinates. ...
1
vote
0answers
108 views

ANSI C (C11) math libraries? [closed]

I know there are a multitude of C++ math libraries out there, but my current project is C-only (C11). So far I've made due with writing my own matrix/vector functions, but now I need to do the more ...
-1
votes
1answer
27 views

How do i rotate my view on its own center

PROBLEM I am trying to translate and rotate my view, the translation works fine but when rotating the rotation is happening on the center of the world(0,0,0) instead of the view position. EXAMPLE ...
1
vote
1answer
25 views

How can I have more values in array on X axis than Y axis in my tilemap?

Following my old question Array of map data renders the map the opposite way after I got the answer to it and fixed my problem, I got another problem that occurs. If my ...
0
votes
2answers
65 views

Is clipping done before or after projection?

Is clipping applied after projection or before? How can it be applied after projection when a vertex is behind the camera and projected therefore mirrored? At this time I clip the triangle before ...
0
votes
1answer
40 views
0
votes
2answers
45 views

How to keep an object in a certain part of the camera view?

I have a 3d camera that is viewing a character that is moving. As the character is moving i want the camera to adjust itself so as to keep the character in the left third of the camera view. I ...
1
vote
1answer
35 views

Texture does not fit the screen

Hi guys I am really new in OpenGL-ES and I am developing a simple android application with NDK, and I just want to ask why the image is not fit after I set the width and height of it. this is my <...
0
votes
0answers
29 views

FreeGLUT - Making Planets Orbit at their own Speed

I'm currently working on a project for Uni using FreeGLUT to make a simple solar system simulation. I've got to the point where I've implemented all the planets and have used a Scene Graph to link ...
1
vote
1answer
61 views

Camera movement issue with pitch and yaw angles

I'm trying to implement a simple first person camera using pitch and yaw angles (no quaternions, I want a simple camera for debugging purposes). An Input class processes mouse input and translate the ...
0
votes
0answers
28 views

Skinning - Bone Matrices Clarification

I'm trying to create the simplest animation scenario, 12 vertices and 2 bones. Both bones has a 4x4 matrix. When both are set to "Identity", the model looks correct, like in the picture above (...
0
votes
1answer
39 views

Camera rotation is weird when it's a child of another object

I implemented scene graph hierarchy into my 3D game engine, and there seems to be a problem with the camera's rotation when it is a child of another object. It only happens with the camera, not any ...
2
votes
1answer
116 views

Why do these DirectXMath functions seem like they return column-major matrics?

I know these questions have been asked a million times in various formats, but I'm getting weirdly skeptical about some of the row-major vs. column-major claims about the DirectXMath library. If I ...
0
votes
0answers
26 views

Calculating Offset Matrices for 3D Animation

I am experimenting with SkinnedMesh sample in Microsoft DirectX SDK June 2010. I am trying to understand how offset matrices work. The .X format comes with Offset matrices for every bone, but I am ...
0
votes
1answer
23 views

Change center point and size with the help of the Matrix in Unity

Let us suppose I have an array of Vector3, it contains vertices. Now I want to scale the vertices and/or change the center point of the texture (move texture ...
0
votes
1answer
135 views

What is FRotationMatrix in Unreal engine 4?

I am working on FPS shooter example in Unreal engine 4 documentation. One of the lines for forward movement of pawn is ...
0
votes
0answers
28 views

Help, stuck and I don't understand how to create a .bvh file?

I am attempting to write a .bvh exporter from scratch (in c#). I am happy with the hierarchy part but I am at a loss for the "MOTION" section and what each rotation value represents. Motion Section: ...
0
votes
0answers
110 views

Unity's Quaternion to Matrix conversion failure

There's a new error in Unity 2017.2, opened at Unity Issue Tracker here. Here it is: Assertion failed: Quaternion To Matrix ...
-1
votes
1answer
67 views

Get enemy/chaser object to face player object - OpenGL

My chaser object will not face the player object. It simply keeps spinning around and won't face the player. ...
1
vote
2answers
57 views

TRS Matrix between 2 points

I have got 2 Points in 3D Space whose TRS Matrix' from 0.0 to there current place is known. Now I want to change the Matrix of the left point so that the matrix of the right point combined with the ...
0
votes
0answers
23 views

How to set/clear parent and maintain world position/scale/rotation in a transform hierarchy

I am attempting to code a Transform hierarchy similar to Unity's. I am able to successfully combine local position, rotation and scale, as well as to multiply child transforms by their parent ...
4
votes
1answer
68 views

Camera rotation deforms objects

I'm working on a ray-tracer in C++ with an adjustable camera for a university assignment. I'm entirely new with graphics and I'm struggling with one thing. I have a matrix as a mat4 object (4x4 ...
0
votes
0answers
58 views

Combining Rotations C++ Matrix

I'm trying to combine a look at operation with a local rotation operation like this image To rotate my 2d sprite plane to face the sphere, then to rotate around the z axis while point at the sphere. ...
1
vote
1answer
77 views

Split a grid into shapes that can be moved back from 4 directions

Basically I have 4 grids Left, Right, Top, Bottom. Player can choose each of them and move all the blocks on that grid to the Middle grid to fulfill it, like tetris from 4 directions: ...
0
votes
1answer
62 views

LibGDX trying to create a matrix of circles

I am trying to create a circular stage like so: But I can only make a square:
1
vote
0answers
72 views

Setting relative anchor point via matrix

The page at https://webglfundamentals.org/webgl/lessons/webgl-2d-matrices.html provides an example for rotating around the center of the image: ...
2
votes
1answer
1k views

lookAt with orthographic camera (gl-matrix)

Technically this is a webgl question though I think it's generic enough to get some opengl, erm, perspective on it too... If I setup an orthographic camera (perspective matrix) like this: ...
1
vote
1answer
689 views

How to mirror/reflect/flip a 4D transformation matrix

I am importing my animation keyframe joint data from Blender to my game engine. The joint data is a set of 4D matrices. Things are looking good except a remaining issue where the animation is facing ...
0
votes
1answer
129 views

How to Convert a Z Up Matrix to a Y Up Matrix?

My 3D program exports my vertex data and instancing matrixes in Z+ up format. I want to store them in my own data format as Y+ up. If given a Matrix4 describing a position with Z+ being up. How can ...
0
votes
1answer
147 views

Matrix multiplication order for multiple model transformations

I have a problem in terms of what frame of reference, I should construct, scaling (S), rotation (R) and translation (T) for a model matrix (in that order). Let us assume the use of glm (or glsl), i.e. ...
2
votes
1answer
138 views

Prevent tile layout gaps

I'm making a map viewer where you can specify where tiles go in a map and then see it on the screen, translate it, and zoom in and out. Here's a picture showing the tiles used to make my example map ...
1
vote
0answers
234 views

SceneKit-Convert a rotation vector into rotation matrix

I'm very new and I'm studying this ARKit code from RPasecky/CubesInSpace on github where he/she convert the point of view 's rotation vector into a rotation matrix ...
0
votes
1answer
53 views

Matrix transformations vs manipulating vertex data directly

I was wondering whats more efficient to do if you want to transform a mesh. 1) Transforming a matrix and pass that to a shader or 2) Manipulate the meshs vertex data directly I was wondering because ...
0
votes
1answer
650 views

Convert Quaternion to Matrix4x4

I'm trying to set Gizmos.matrix which is a 4x4 by matrix such that the gizmos drawn match the rotation of the object. However, I'm not sure how to convert the ...
0
votes
0answers
307 views

Creating a rotation matrix from an up vector without using trigonometry

I'm looking for someone who really understands vector and matrix algebra. I have a coordinate in 3D space whose origin is the centre of the Earth, and I want the coordinates to be on a flat plane at ...
0
votes
1answer
60 views

Oscillate an object's scale

I am able to scale an object using a scaling function I wrote. Internally it builds matrices that are multiplied by each of the vertices to transform them. The parameters I give the scaling function ...
1
vote
1answer
80 views

Mathematics: matrix-to-quaternion conversion in left-hand coordinate system

I am implementing a typical skeletal animation system, and it requires the usage of quaternion to interpolate rotations between each poses. The asset I import only has a transform matrix for each ...
0
votes
0answers
211 views

Mythbuster: Mirror Operation with Quaternion

Mirror operation : all vertex positions must be reflected by a specific plane (here YZ).Synonyms: FlipHorizontal, SymmetryX, MirrorX, What implementations I already know that work: 1) Multiplying ...
1
vote
2answers
394 views

Applying “zoom to the exact point” transformations to screen positions

I´ve implemented zooming of orthographic camera (just scaling it with its speed value): ...
0
votes
0answers
139 views

How to compose a matrix to perform isometric (dimetric) projection of a world coordinate?

I have a 2D unit vector containing a world coordinate (the player's direction), and I want to convert that to screen coordinates (classic isometric tiles). I'm aware I can achieve this by rotating ...
0
votes
1answer
51 views

Are there any math limitations on the near plane in a perspective matrix?

I've noted that if in the perspective camera I put near plane to a low number like 0.000001 and far plane to 1000 my render has ...
2
votes
2answers
173 views

Convertion from 3D to 2D openGL

Few days ago , we learned about Homogeneous Matrices in OpenGL class. From what I have understood , using these matrices we can convert 3D objects to 2D. However , I am facing some difficulties ...