www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: JakubBaku on May 13, 2018, 12:06:32 pm

Title: Camera rotation.
Post by: JakubBaku 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
Title: Re: Camera rotation.
Post by: JakubBaku 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);
Title: Re: Camera rotation.
Post by: EgonOlsen on May 14, 2018, 07:53:46 am
Code: [Select]
camera.getBack().setIdentity();

might be a little more efficient.