arcball | Arcball Rotation Control | Game Engine library

 by   mharrys C++ Version: Current License: Non-SPDX

kandi X-RAY | arcball Summary

kandi X-RAY | arcball Summary

arcball is a C++ library typically used in Gaming, Game Engine applications. arcball has no bugs, it has no vulnerabilities and it has low support. However arcball has a Non-SPDX License. You can download it from GitHub.

dragging along a constraint axis. + Press F1 to toggle helpers. + Press + to increase size of helpers. + Press - to decrease size of helpers. + Press R to reset object orientation. + Hold CTRL to show body constraint axes. + Hold SHIFT to show camera constraint axes. + Hold CTRL and SHIFT to show world constraint axes.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              arcball has a low active ecosystem.
              It has 10 star(s) with 3 fork(s). There are 2 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              arcball has no issues reported. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of arcball is current.

            kandi-Quality Quality

              arcball has no bugs reported.

            kandi-Security Security

              arcball has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              arcball has a Non-SPDX License.
              Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

            kandi-Reuse Reuse

              arcball releases are not available. You will need to build from source code and install.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of arcball
            Get all kandi verified functions for this library.

            arcball Key Features

            No Key Features are available at this moment for arcball.

            arcball Examples and Code Snippets

            No Code Snippets are available at this moment for arcball.

            Community Discussions

            QUESTION

            java-processing floating point rounding error, how to keep radians rational
            Asked 2021-Jan-12 at 03:24

            I have modified this arcball class so that every call to arcball.rollforward(PI/180); rotates a matrix 1 degree. I have tried to set it up so arcball.rollback() is called with the accumulated float rotatebywithincludedfloaterror but it has had the same degree error as rolling back 360 degrees without the float error. this is how far it is off after 1000 full rotations, it should be a 1:1 reflection of the top cube over x

            here is main function with a loop of 1 * 360 degree rotation and framerate for testing (set framerate to 900 for multiple rotations so it dose not take forever)

            ...

            ANSWER

            Answered 2021-Jan-12 at 03:24

            using my idea in the question to reset every 2*PI

            Source https://stackoverflow.com/questions/65670183

            QUESTION

            how to apply lighting to .obj file on pyopengl
            Asked 2020-Sep-12 at 05:17

            i implement arcball with an object from .obj file in the center when i try to implement lighting, the object show strange behaviour

            when i turn the object slightly, the object deconstruct and suddenly show the back side

            this behaviour doesn's come up until i implement lighting based on this How to correctly add a light to make object get a better view with pygame and pyopengl

            this is what i do regarding the lighting impelementation

            ...

            ANSWER

            Answered 2020-Aug-25 at 07:34

            You have to enable the Depth Test. Enable the depth test before the application loop:

            Source https://stackoverflow.com/questions/63573381

            QUESTION

            Issue with Picking (custom unProject() function)
            Asked 2020-Aug-12 at 18:07

            I'm currently working on a STL file viewer. This one use an Arcball camera :

            To provide more features on this viewer (which can handle more than one object) I would like to implement a click select. To achieve it, I have used picking(Pseudo code I have used)

            At this time, my code to check for a any object 3D between 2 points works. However the conversion of mouse position to a correct set of vector is far away from working:

            ...

            ANSWER

            Answered 2020-Aug-12 at 00:32

            I have found what's wrong, the return vec3 should be made by dividing each component by the perspective instead of being multiply by it. Here is the new UnProject function :

            Source https://stackoverflow.com/questions/63367640

            QUESTION

            Get cursor position on Z = 0 plane using glm::unproject()?
            Asked 2019-Nov-25 at 20:11

            I'm trying to get the coordinates (x,y) of the grid (z = 0) using only the cursor coordinates. After a long search I found this way to do that using the glm::unproject.

            First I'm getting the cursor coordinates using the callback:

            ...

            ANSWER

            Answered 2019-Nov-25 at 20:11

            You want to intersect the ray from glm::vec3(this->cursorCoordinate.x, this->cursorCoordinate.y, 0.0) to glm::vec3(this->cursorCoordinate.x, this->cursorCoordinate.y, 1.0) with the grid in world space, rather than model space (of the cuboid). You've to skip this.modelMatrix:

            Source https://stackoverflow.com/questions/58805376

            QUESTION

            How to zoom in/out a 3D image using glumpy?
            Asked 2019-Aug-05 at 16:41

            I'm trying to show a 3D image (a sphere) with a texture that contains some information. I need to rotate and zoom in/out the image.

            I just came up using glumply and I saw some examples that are very helpful (especially the Earth rendering example at https://github.com/glumpy/glumpy/blob/master/examples/earth.py).

            However, so far I haven't been able to find any example at all that zooms in/out the image. Does anybody know whether that's possible or not? I'm starting to think that it is not possible, but that's somehow hard to believe. I would really appreciate any example of how to do it (or somebody who knows about it telling me that it's impossible). I just discovered glumpy yesterday night, so the more complete the example, the better.

            Thanks a lot!

            EDIT: As far as I have seen, both the Trackball and Arcball classes (which I use for the 3D sphere) have an on_mouse_scroll method which should already zoom in/out when the mouse wheel is turned. However, that method is never called when I turn the wheel. I'm not sure whether this has something to do with a message I get in the console when I execute the program:

            ...

            ANSWER

            Answered 2019-Aug-05 at 16:41

            The problem was that I was lacking the GLFW DLL library. I could create the sphere and rotate it, but I couldn't zoom in/out. I didn't pay much attention to a couple of warnings/errors that I got when I executed the application as it somehow seemed to work alright.

            As jdehesa pointed out in his comments, I had not properly followed the installation steps shown in Step-by-step install for x64 bit Windows 7,8, and 10.

            Now it works. Thanks jdehesa!

            Source https://stackoverflow.com/questions/57360016

            QUESTION

            OpenGL ArcBall for rotating mesh
            Asked 2019-Feb-21 at 21:40

            I am using legacy OpenGL to draw a mesh. I am now trying to implement an arcball class to rotate the object with the mouse. However, when i move the mouse, the object either doesn't rotate or rotates by way too big an angle.

            This is the method that is called when the mouse is clicked:

            ...

            ANSWER

            Answered 2019-Feb-03 at 16:40

            I recommend to do store the mouse position at the point where you initially click in the view. Calculate the amount of the mouse movement in window coordinates. The distance of the movement has to be mapped to an angle. The rotation axis is perpendicular (normal) to the direction of the mouse movement. The result is a rotation of an object similar to this WebGL demo.

            Store the current mouse position in startRotation. Note store the coordinates of the position mouse position not normalized vector:

            Source https://stackoverflow.com/questions/54498361

            QUESTION

            PyOpenGL transforming view coordinates into object coordinates for ArcBall navigation
            Asked 2018-Jun-01 at 14:39

            I am following this tutorial for arcball navigation in 3d:

            https://en.wikibooks.org/wiki/OpenGL_Programming/Modern_OpenGL_Tutorial_Arcball

            I managed to perform all the steps and the navigation works but I cant seem to comprehend last step in tutorial:

            An extra trick is converting the rotation axis from camera coordinates to object coordinates. It's useful when the camera and object are placed differently. For instace, if you rotate the object by 90° on the Y axis ("turn its head" to the right), then perform a vertical move with your mouse, you make a rotation on the camera X axis, but it should become a rotation on the Z axis (plane barrel roll) for the object. By converting the axis in object coordinates, the rotation will respect that the user work in camera coordinates (WYSIWYG). To transform from camera to object coordinates, we take the inverse of the MV matrix (from the MVP matrix triplet).

            The problem is that when i turn the model in the first step axis of rotation transform as well and they are not aligned with my "camera view". Of course I would like to keep my rotation axes always aligned with my camera view.

            Can someone please give me an advice how to tackle it? In the tutorial there is a code but not much of explanation on what it is actually doing plus I only speak Python.

            Thank you, Jacob

            My code:

            ...

            ANSWER

            Answered 2018-Feb-01 at 21:46

            The problem is that when i turn the model in the first step axis of rotation transform as well and they are not aligned with my "camera view". Of course I would like to keep my rotation axes always aligned with my camera view.

            In a rendering, each mesh of the scene usually is transformed by the model matrix, the view matrix and the projection matrix.

            • Projection matrix:
              The projection matrix describes the mapping from 3D points of a scene, to 2D points of the viewport.

            • View matrix:
              The view matrix describes the direction and position from which the scene is looked at. The view matrix transforms from the wolrd space to the view (eye) space.

            • Model matrix:
              The model matrix defines the location, oriantation and the relative size of a mesh in the scene. The model matrix transforms the vertex positions from of the mesh to the world space.


            If you want to rotate the szene around an axis in view space, the you have to do the following:

            • Transform the model by all the rotations and translations that you have done before the new rotation operation.

            • Apply the new rotation operation.

            • Apply the view translation

            • Apply the projection matrix


            Size the OpenGL fixed function pipeline has a matrix stack, this operations have to be done in the reverse order.

            e.g. See the documentation of glMultMatrix:

            glMultMatrix multiplies the current matrix with the one specified using m, and replaces the current matrix with the product.

            In OpenGL there is one matrix stack for each matrix mode (See glMatrixMode). The matrix modes are GL_MODELVIEW, GL_PROJECTION, and GL_TEXTURE.

            First you have to setup the projection matrix on the separated projection matrix stack:

            Source https://stackoverflow.com/questions/48337750

            QUESTION

            How glm::perspective() and glm::lookAt() work together?
            Asked 2018-Apr-24 at 13:50

            I am trying to figure out exactly how lookAt and perspective functions work.

            I would like to change the value of glm::lookAt (in particular the z value of the camera position) and I have noticed that If that value is different from the value of near plane in glm::perspective it breaks my object (it looks anormal). Then, I do not know if my problem is related to the arcball (but I don't think so since the problem appears also before moving the object) or to the fact that for some reason I should use the same value for the camera position (z value) in the lookAt function and in the near plane in the perspective function.

            Any suggestions?

            I took the implementation of the arcball from https://en.wikibooks.org/wiki/OpenGL_Programming/Modern_OpenGL_Tutorial_Arcball

            Main.cpp:

            ...

            ANSWER

            Answered 2018-Apr-24 at 12:22

            Update of the question. SOLVED!

            I have just found that was a problem of z-fighting.

            For other users that have my same problem, I suggest that page: https://www.opengl.org/archives/resources/faq/technical/depthbuffer.htm

            Source https://stackoverflow.com/questions/49999138

            QUESTION

            unable to delete an old pointer (segfault)
            Asked 2017-Dec-04 at 00:01

            I'm confused as to why one of these would work and the other would not. I'm trying to enable switching of camera controllers, in both cases the (mostly) copy constructor succeeds, the first branch is segfaulting on the delete though

            ...

            ANSWER

            Answered 2017-Dec-03 at 23:50

            I was not properly shutting down a thread in the FlyCamera, the thread captured this, which is where the eventual segfault was occurring. Thank you @aschepler for pointing out what should have been obvious, the destructors were the the problem which should have been apparent from the fact that one could be deleted, but the other could not!

            Source https://stackoverflow.com/questions/47624535

            QUESTION

            Arcball camera zooming
            Asked 2017-Nov-11 at 07:19

            I am trying to change the camera view with mouse movement and want the camera to move around the origin in an arcball fashion without going under the scene; so sort of a dome-like view.

            The following works satisfactorily for getting the eye coordinates and making this half-arcball view. I hardcoded a condition in order that I would not be able to view underneath the scene. The consequence of this condition is that instead of going under the scene, the camera will zoom into the center instead. I can't wrap my mind around how to impede the camera from doing this 'zoom'. When I get to the lowest part of the dome view, I'd like to only be able to move left or right. Distance is constant. Any guidance?

            ...

            ANSWER

            Answered 2017-Nov-11 at 07:16

            You don't need to constrain the resulting coordinates but the input angle:

            Source https://stackoverflow.com/questions/47235116

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install arcball

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/mharrys/arcball.git

          • CLI

            gh repo clone mharrys/arcball

          • sshUrl

            git@github.com:mharrys/arcball.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Game Engine Libraries

            godot

            by godotengine

            phaser

            by photonstorm

            libgdx

            by libgdx

            aseprite

            by aseprite

            Babylon.js

            by BabylonJS

            Try Top Libraries by mharrys

            fluids-2d

            by mharrysJavaScript

            flask-blog

            by mharrysPython

            gust

            by mharrysC++

            sudoku

            by mharrysPython

            digit-recognition

            by mharrysC++