Author Topic: Camera rotation.  (Read 2831 times)

Offline JakubBaku

  • byte
  • *
  • Posts: 4
    • View Profile
Camera rotation.
« on: May 13, 2018, 12:06:32 pm »
Hi, I'm starting with jPCT and I'm trying to make a moving camera but every single method in camera class just increments the already set angle and what I want to do is to SET angle, not INCREMENT it. Any thought on that one? Thanks in advance :P

Offline JakubBaku

  • byte
  • *
  • Posts: 4
    • View Profile
Re: Camera rotation.
« Reply #1 on: May 13, 2018, 12:20:48 pm »
Okay I figured it out:
Code: [Select]
Matrix m = new Matrix();
m.rotateY(new angle);

camera.setBack(m);

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Camera rotation.
« Reply #2 on: May 14, 2018, 07:53:46 am »
Code: [Select]
camera.getBack().setIdentity();

might be a little more efficient.