GithubHelp home page GithubHelp logo

Various issues with the camera about grrlib HOT 2 CLOSED

grrlib avatar grrlib commented on May 29, 2024
Various issues with the camera

from grrlib.

Comments (2)

Crayon2000 avatar Crayon2000 commented on May 29, 2024

Hello, the GRRLIB_Camera3dSettings function is used to set values that are used by the guLookAt function in libogc. Here is the documentation in case it can help you:

/*!
 * \fn void guLookAt(Mtx mt,guVector *camPos,guVector *camUp,guVector *target)
 * \brief Sets a world-space to camera-space transformation matrix.
 *
 * \details Create the matrix \a m by specifying a camera position (\a camPos), a camera "up" direction (\a camUp), and a target
 * position (\a target).
 *
 * The camera's reference viewing direction is the -z axis. The camera's reference 'up' direction is the +y axis.
 *
 * This function is especially convenient for creating a tethered camera, aiming at an object, panning, or specifying an
 * arbitrary view.
 *
 * \param[out] mt New viewing matrix.
 * \param[in] camPos Vector giving 3D camera position in world space.
 * \param[in] camUp Vector containing camera "up" vector; does not have to be a unit vector.
 * \param[in] target Vector giving 3D target position in world space.
 *
 * \return none
 */

So nothing mentions rotation.

I think I will need to change the documentation for GRRLIB_Camera3dSettings because it is wrong since 2009:

 * @param posx x position of the camera.
 * @param posy y position of the camera.
 * @param posz z position of the camera.
 * @param upx Alpha component.
 * @param upy Alpha component.
 * @param upz Alpha component.
 * @param lookx x up position of the camera.
 * @param looky y up position of the camera.
 * @param lookz z up position of the camera.

I guess it should be replaced by something like this:

 * @param posx x position of the camera.
 * @param posy y position of the camera.
 * @param posz z position of the camera.
 * @param upx x up position of the camera.
 * @param upy y up position of the camera.
 * @param upz z up position of the camera.
 * @param lookx x position of the target.
 * @param looky y position of the target.
 * @param lookz z position of the target.

from grrlib.

hexadecimal-chocolate avatar hexadecimal-chocolate commented on May 29, 2024

Thanks, I was wondering what the alpha component was. Changing upx, upy, and upz still didn't have the desired effect, so to rotate the camera do I have to set lookx, looky, and lookz to a point relative to the camera in the direction I want, or is there an easier way?

from grrlib.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.