Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat
Rotate a 1st person camera - Gideros Forum

Rotate a 1st person camera

Hi there!
I'm new to Gideros and documentation is way too confusing.

How one is supposed to place a movable and rotatable camera in a 3d environment?
image
I've tried viewports and rotating the root sprite but it took me nowhere.
Movement is not a big deal, but rotation performs weird tricks.
(see attachment)

What I want to know is how to make camera rotate around itself and not around some weird point in 3d world.
It's important to not rotate the "stage" node since the text like coordinates should be available at all times.

Regards!
Tagged:
zip
zip
3dtest.zip
41K
3dtest.png
502 x 375 - 137K

Comments

  • hgy29hgy29 Maintainer
    edited April 3 Accepted Answer
    Hi @4aiman,

    I've rewritten your main.lua so that it does what you want (well I hope thats what you want). The key is to use a Viewport as camera, it has a lookAngle() function to setup the camera position and angles. You should also forget about application:configureFrustum(), as it will apply to everything on stage, even texts or UI. Configure the projection directly in your Viewport, then scale/place the viewport in your 2D stage.

    Likes: keszegh, 4aiman, antix

    lua
    lua
    main.lua
    4K
    +1 -1 (+3 / -0 ) Share on Facebook
  • 4aiman4aiman Member
    Thanks a lot, hgy29! :)
Sign In or Register to comment.