matrix

  1. Freddie The Potato

    3D Finding Camera to World Matrix

    Heya! I've been struggling trying to create a function that converts 2d screen coordinates into a 3d raycast. I think I've found a good way to do it, but it involves transforming a directional vector from camera-space to world-space. I understand that in order to convert world-space...
  2. Binsk

    Asset - Scripts UBG Math [vectors, quats, and matrices]

    I don't know about you but I really get tired of re-implementing vector and matrix math for every 3D project started. This extension is my solution. I decided to make a professional library that integrates well as if included in the engine by default. You can purchase the extension via the...
  3. jtmx

    3D 3D Camera Yaw, Pitch, Roll

    Hello all, I'm trying to create a 3D Camera in GMS2 that has Yaw, Pitch and Roll. I managed to get the Yaw and Pitch working however I can't seem to get the Roll working properly. Any help with this would be greatly appreciated. Code: if keyboard_check(ord("A")) cam_yaw -= 10; if...
  4. FrostyCat

    Asset - Extension GMLinear: Easy matrix and vector operations for GMS 2.x and 1.4

    GMLinear Easy matrix and vector operations for GMS 2.x and 1.4 Overview GMLinear is an implementation of matrix and vector operations in pure GML. You can use it to simplify many common calculations in 2D and 3D geometry and implement algorithms/formulas involving linear algebra. Features...
  5. F

    vine swing

    So I am making pitfall and need to be able to have a player object swing on the vine that hangs from the ceiling of the room the vine starts in image angle at 315 and swings to 225 then reverses my teacher mentioned transformation/rotation matrices but I'm not sure how to enter/use them.
  6. Carbiner

    GML Matrix Multiplication Optimizations? [Solved]

    Hello! I've found myself in the position of needing to multiply two very large matrices to get the result I want. Because GMS 2 does not (as of yet) support true matrix functions, I am using two ds_grids to represent my matrices. The problem is speed. I've done some questionable things to make...
  7. Rukola

    3D Enter the Matrix: How to check current rotation?

    Hi, While working on a 3d project, I've used matrix_multiply to rotate a character and based his movement of his rotation. In other words, the character changes direction by rotating: var _r = matrix_build(move,0,0, rotate,0,0, 1,1,1); m = matrix_multiply(_r,m); While trying to find the current...
  8. Adrien Dittrick

    HTML5 Gun Kata game: Bullet flow

    https://gamejolt.com/games/buletflowproto/348279 This game is sort of a mechanical engine to test a few thngs for a possible future project which would feature actual graphics and nice bullet-time animations. The system itself is heavily inspired by XCOM cover mechanics, and will be...
  9. bsabiston

    rotation matrix?

    If I want to draw a vertex buffer object at say 90 degrees rotated, do I have to build my own rotation matrix? I don't see any simple matrix manipulation functions, like rotate, scale, translate. And it says 'd3d_transform_set_rotation_z' is no longer recognized. Am I missing the regular...
  10. Octopus_Tophat

    GMS 2 Sprites culling when manually manipulating matrices

    Hi, I'm not using cameras in my game for complicated reasons that I don't really feel like explaining. I basically have my own draw pipeline, where the main game control object handles all the drawing for my custom cameras. So my custom cameras are manipulating the matrices while setting...
  11. TheOnlyWRT

    Rotating a matrix

    Is there a way to rotate a matrix in GMS2? Here is an example: If not, is there an extension or a script that exists to do so?
  12. J

    GMS 2 GML Camera move

    hey! when i use: camera_set_view_pos(view_camera[0], 110, 510); to move around the room, it works fine. but then i make my own camera: camera = camera_create(); var pm = matrix_build_projection_ortho(1920, 1080, 1, 5000); var vm = matrix_build_lookat(960, 540, -10, 960, 540...
  13. Rayleed

    GMS 2 Having trouble in drawing 3D graphics

    In GMS2, all d3d functions are obsolete. I know how to use matrices to transform a 3D vector, but I don't know how to draw an image in 3D space. What is world/view/projection matrix? How does camera_set_view/proj_mat work? What can I do to draw as d3d_primitive_begin_texture? Thank you :)
  14. S

    GMS 2 [Solved] Testing on a 2d array for 0

    Evening all, I am using an array for managing my velocity, like so: currVelocity = [0,0] // x,y At times I want to test if one or both elements is at 0, i.e. we are not moving. However, it never returns 0, even when not moving. I am sure I am missing something simple but the debug was no help...
  15. Kaliam

    GMS 2 3D: drawing a vertex buffer at different coordinates/location?

    Hello, I'm just curious if anyone knows of a way to draw a frozen vertex buffer at a different location on screen? I've checked through the documentation for a way to do this and so far the only thing I could find is: matrix_transform_vertex(matrix, x,y,z,) However, since i'm pretty sure a...
  16. H

    GML [VERIFY] Set shader uniform, what is current transform matrix?

    From the documentation shader_set_uniform_matrix, what is the "current transform matrix" referred to? Is it the top of the matrix stack?
  17. H

    GML [SOLVED] Matrix rotation applied after invisible translation?

    I'm having trouble with basic matrix transforms. Please understand, I've done my research, I'm coming here as a last resort. As a simple test, I am trying to render a triangle in rotation about the y-axis. I expect a stationary triangle that rotates, but this is what I'm seeing (in orthographic...
  18. Juju

    Discussion Quaternion library

    Whilst the current beta has some pretty extreme limitations, it's still possible to build and test in it. To demonstrate the new array literals, as well as to experiment a bit with the matrix functions, I've built a quaternion library. It doesn't have particularly fancy features but it does the...
  19. Binsk

    [SOLVED] World-space to Screen-space conversion?

    SOLVED: Oops... I should have been dividing by W rather than attempting to normalize the vector. Face-palm moment. Hello, I am attempting to convert a point in 3D world-space into 2D screen-space on the window. I thought that I had all the math right, but the results I get for the 2D point are...
  20. B

    3-D Third Person Camera Tutorial

    3-d-third-person-camera-tutorial GM Version: Studio Target Platform: Windows Download Editable Example:https://drive.google.com/open?id=0B2TkWVm2bJT0ZE9Zd1hTU2NuQ2M Controls :" WASD - to move camera, Q and E to roll camera" Links: http://planning.cs.uiuc.edu/node102.html...
Top