Help! Javascript to perform LG-like camera rotations on Google Earth API camera.

29 views
Skip to first unread message

Andrew Leahy

unread,
Feb 25, 2012, 12:37:12 AM2/25/12
to liquid-galaxy
Hi, I have an undergrad CompSci project group at my uni looking at "ViewSync" over WebSockets and Javascript to control GE plugins running in a Liquid Galaxy arrangement. This is the first part of bigger project to build a real time "dogfighting game" in Google Earth between three LG rigs using Kinects as controllers.

The Kinect bit is now mostly working, the inter-rig kml model linking we've got prototypes for.

But we're being stumped by the maths required to rotate the slave cameras in each LG setup.

So we've spent the last two weeks getting headaches with Euler angles, Quaternions and matrix rotations.
Unfortunately they (and I) don't have enough Computer Graphics under our belts. Our CG unit is an elective that runs in parallel to their project unit *doh* I'm sure by the time they finish the unit.. they may have it sorted - but I don't want to have to wait 4 months! Have asked a couple of academics, got an even bigger headache... and no code!


With Google Earth API the camera view is setable with 5 values - latitude, longitude, altitude, heading, tilt, roll.

1. We share the master camera view (lat,long,alt,heading,tilt,roll) with the slaves - same as viewsync.

2. On the slaves we want to apply a yaw, pitch and roll offset (or rotation) to the master camera view. Although just yaw would be a fine start.

3. Calculate the new camera heading, tilt, roll and set the slave camera (lat,long,alt doesn't change).


We have websockets and sync working for the simple cases eg. all mirroring, or when the world is horizontal.

At the end of the day (I think) we want a javascript function we can plug the master camera values into with the offsets and get out the new (heading,tilt,roll).

This is an extension of a project we ran last semester which used GE Plugins in a Liquid Galaxy configuration (using GE ViewSync and drivers.ini) to sync the views. And WebSockets to then synchronise basic GE features between the screens eg. turn on/off layers, UI elements, etc.

The code/functions will be placed into the public domain.

If there are any big brains on the list that can help out that would be great!

Cheers, Andrew
eResearch /  Uni of Western Sydney
Reply all
Reply to author
Forward
0 new messages