Results 1 to 1 of 1
Thread: java and graphics 3d
- 02-24-2012, 09:48 PM #1
Member
- Join Date
- Sep 2011
- Posts
- 17
- Rep Power
- 0
java and graphics 3d
So if this code allows me to rotate my camera around the center of a scene
Java Code:Vector3f camPos = new Vector3f(0, 10, 0); Vector3f center = new Vector3f (0,0,0); Quaternion camRot = new Quaternion(); Quaternion tempQuat = new Quaternion(); ...... camPos = cam.getLocation(); tempQuat.fromAngles(0, 0, tpf + 0.05f).multLocal(camPos); camRot.lookAt(center.subtract(camPos), new Vector3f(Vector3f.UNIT_Z)); cam.setLocation(center.add(camPos)); cam.setRotation(camRot);
How can I make my camera rotate around whereever it is looking at so when I am pointing for ex my cam at object x I can rotate around it AS LONG as I am looking at it?
Thanks in advance
Similar Threads
-
Courses on Java and graphics in Java (GUIs, JOGL2) available online
By Manuel in forum Java SoftwareReplies: 1Last Post: 07-12-2011, 10:33 AM -
Java graphics
By AtomicPoop in forum Java GamingReplies: 13Last Post: 04-18-2011, 06:40 PM -
Java Graphics
By cenevz in forum New To JavaReplies: 0Last Post: 01-02-2011, 11:55 PM -
Java Graphics
By keaton1ao in forum New To JavaReplies: 12Last Post: 11-16-2010, 08:19 PM -
Java Graphics
By svaidya in forum New To JavaReplies: 8Last Post: 12-07-2009, 05:11 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks