{"id":13830697,"url":"https://github.com/vaiorabbit/rmath3d","last_synced_at":"2025-05-07T12:45:55.629Z","repository":{"id":9523312,"uuid":"11422397","full_name":"vaiorabbit/rmath3d","owner":"vaiorabbit","description":"Ruby Math Module for 3D Applications","archived":false,"fork":false,"pushed_at":"2020-07-23T15:16:01.000Z","size":118,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T14:39:15.278Z","etag":null,"topics":["3d","math","matrix","ruby","vector"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vaiorabbit.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-07-15T12:15:49.000Z","updated_at":"2024-12-23T14:04:01.000Z","dependencies_parsed_at":"2022-09-13T18:13:15.977Z","dependency_job_id":null,"html_url":"https://github.com/vaiorabbit/rmath3d","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaiorabbit%2Frmath3d","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaiorabbit%2Frmath3d/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaiorabbit%2Frmath3d/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaiorabbit%2Frmath3d/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vaiorabbit","download_url":"https://codeload.github.com/vaiorabbit/rmath3d/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251729793,"owners_count":21634290,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["3d","math","matrix","ruby","vector"],"created_at":"2024-08-04T10:01:06.031Z","updated_at":"2025-05-07T12:45:55.609Z","avatar_url":"https://github.com/vaiorabbit.png","language":"C","readme":"\u003c!-- -*- mode:markdown; coding:utf-8; -*- --\u003e\r\n\r\n# rmath3d : Ruby Math Module for 3D Applications #\r\n\r\nrmath3d is a math module for 3D game programming and computer graphics.\r\n\r\n*   Last Update: Jul 23, 2020\r\n*   Since: Jul 20, 2008\r\n\r\n* rmath3d (C Extension Library Implementation) [![Gem Version](https://badge.fury.io/rb/rmath3d.svg)](https://badge.fury.io/rb/rmath3d) [![Gem](https://img.shields.io/gem/dt/rmath3d.svg)](https://rubygems.org/gems/rmath3d)\r\n* rmath3d_plain (Pure Ruby Implementation) [![Gem Version](https://badge.fury.io/rb/rmath3d_plain.svg)](https://badge.fury.io/rb/rmath3d_plain) [![Gem](https://img.shields.io/gem/dt/rmath3d_plain.svg)](https://rubygems.org/gems/rmath3d_plain)\r\n\r\n## Features ##\r\n\r\n### Supports frequently-used vector and matrix classes ###\r\n\r\n*   RMtx2 (2x2 matrix)\r\n*   RMtx3 (3x3 matrix)\r\n*   RMtx4 (4x4 matrix)\r\n*   RQuat (Quaternion)\r\n*   RVec2 (2-element vector)\r\n*   RVec3 (3-element vector)\r\n*   RVec4 (4-element vector)\r\n\r\n### Two implementations that are interchangeable with each other ###\r\n\r\n1. rmath3d.{so|bundle} : Ruby extension library for faster execution.\r\n2. rmath3d_plain.rb    : Ruby implemantation for debugging use.\r\n\r\n\r\n## Tested Environment ##\r\n\r\nNotice: This library provides native extension. You must setup develop environment (or DevKit) before installation.\r\n\r\n*   Ruby\r\n    *   ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x64-mingw32]\r\n    *   Ruby 2.3 and prior versions are no longer supported.\r\n\r\n## Building rmath3d.{so|bundle} ##\r\n\r\nVia RubyGems ( https://rubygems.org/gems/rmath3d ):\r\n\r\n    $ gem install rmath3d\r\n\r\nfor pure ruby version:\r\n\r\n    $ gem install rmath3d_plain\r\n\r\n### From source package ###\r\n\r\n    $ rake install\r\n\r\n### For mkmf users ###\r\n\r\n    $ ruby extconf.rb\r\n    $ make\r\n\r\nFor Windows users, type commands below via the \"Visual Studio 200{5|8}\r\nCommand Prompt\". This process requires \"cl.exe\", \"link.exe and\r\n\"mt.exe\" to be exist in the program PATH:\r\n\r\n    X:\\\u003e ruby extconf.rb\r\n    X:\\\u003e nmake\r\n\r\nYou might encounter the \"MSC version unmatch: _MSC_VER: XXXX is\r\nexpected.\" error at the time compiling \"rmath3d.c\". See the\r\ninstruction in the extconf.rb to avoid this error.\r\n\r\n\r\n### Embedding manifest file (For Windows users) ###\r\n\r\nMake sure that your rmath3d.so has \"rmath3d.so.manifest\" embedded into itself.\r\nOtherwise, while using rmath3d.so in your application, you might come\r\nacross an error dialog saying:\r\n\r\n    ---------------------------\r\n    Microsoft Visual C++ Runtime Library\r\n    ---------------------------\r\n    Runtime Error!\r\n    \r\n    Program: d:\\ruby\\bin\\ruby.exe\r\n    \r\n    R6034\r\n    An application has made an attempt to load the C runtime library incorrectly.\r\n    Please contact the application's support team for more information.\r\n    \r\n    ---------------------------\r\n    OK   \r\n    ---------------------------\r\n\r\nTo ensure the file status, try checking if the string \"manifest\" can\r\nbe found in the file:\r\n\r\n    X:\\\u003e strings rmath3d.so | grep manifest\r\n\r\nIf you don't see any outputs, it's time to embed \"rmath3d.so.manifest\". \r\n\r\n    X:\\\u003e mt -manifest rmath3d.so.manifest -outputresource:rmath3d.so;2\r\n\r\nor run the \"embed_manifest.bat\" instead. Then check again the status.\r\n\r\n    X:\\\u003e strings rmath3d.so | grep manifest\r\n    \u003cassembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\"\u003e\r\n    \r\n    X:\\\u003e \r\n\r\nIf you see some similar output like that, the manifest file\r\n\"rmath3d.so.manifest\" is successfully embedded.\r\n\r\n\r\n## About rmath3d_plain.rb ##\r\n\r\nrmath3d_plain.rb is a pure Ruby version of rmath3d.so: all the functionality of\r\nrmath3d.so is implemented with plain Ruby code.\r\nIt is possible to trace the bugs caused by rmath3d.so by replacing the code\r\n\r\n    gem 'rmath3d'\r\n    require 'rmath3d/rmath3d'\r\n\r\nwith\r\n\r\n    gem 'rmath3d'\r\n    require 'rmath3d/rmath3d_plain'\r\n\r\nrmath3d_plain.rb performs more strict type checking, that might be some burden\r\nfor its execution speed. So don't expect the performance efficiency\r\nwhen you use rmath3d_plain.rb instead of rmath3d.so.\r\n\r\n\r\n## Notes ##\r\n\r\n### Collaboration with ruby-opengl ###\r\n\r\nThe instances of RMtx4 can be used directly as the arguments of the\r\nruby-opengl functions that accept matrices.\r\n\r\nFor example, this code snippet using RMath:\r\n\r\n    eye = RVec3.new(0.0, 15.0, 15.0)\r\n    at  = RVec3.new(0.0,  0.0,  0.0)\r\n    up  = RVec3.new(0.0,  1.0,  0.0)\r\n    mtxLookAt = RMtx4.new.lookAtRH( eye, at, up )\r\n    glMatrixMode( GL_PROJECTION )\r\n    glLoadMatrix( @mtxProj )\r\n    \r\n    mtxProj = RMtx4.new.perspectiveFovRH( 30.0*Math::PI/180.0, WINDOW_WIDTH/WINDOW_HEIGHT, 0.1, 1000.0 )\r\n    glMatrixMode( GL_MODELVIEW )\r\n    glLoadMatrix( @mtxLookAt )\r\n\r\nhas the same transformation effect with the OpenGL fixed pipeline:\r\n\r\n    glMatrixMode( GL_PROJECTION )\r\n    gluPerspective( 30.0*Math::PI/180.0, WINDOW_WIDTH/WINDOW_HEIGHT, 0.1, 1000.0 )\r\n    \r\n    glMatrixMode( GL_MODELVIEW )\r\n    gluLookAt( 0.0,15.0,15.0, 0.0,0.0,0.0, 0.0,1.0,0.0 )\r\n\r\n\r\n### Compatibility with matrix.rb ###\r\n\r\nCurrently, there is no combenient way to convert between matrix.rb's\r\n+Matrix+ and +RMtx{3|4}\".\r\n\r\n(The matrix.rb is a standard Ruby library that provides N-dimensional\r\n+Vector+ class and \"N x M\" +Matrix+ class.)\r\n\r\n\r\n\r\n## Information ##\r\n\r\n*   RubyGems\r\n\t*   https://rubygems.org/gems/rmath3d\r\n*   Github\r\n\t*   https://github.com/vaiorabbit/rmath3d\r\n\r\n \r\n## License ##\r\n\r\nAll source codes are available under the terms of the zlib/libpng license\r\n(see LICENSE.txt).\r\n","funding_links":[],"categories":["C"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaiorabbit%2Frmath3d","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvaiorabbit%2Frmath3d","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaiorabbit%2Frmath3d/lists"}