Wednesday, July 27, 2005

ClearSpeed co-processor

I'd love to have a play with one of these: it's a 96 element, 25 GFLOP co-processor you can stick in your PC. The company also provides a software development environment for it (for C), as well as ports of several linear algebra libraries (MatLab, BLAS, and so forth). No mention of cost on the site though.

Wednesday, July 20, 2005

Controling Google Earth from JScript

Simon's recent post on controlling Google Earth from C++ got me thinking about doing the same thing in JScript. It turns out it's pretty easy: you just need set up an <object> element with the right class id. As an example, here's a small HTML document that launches Google Earth and then navigates to my house on the click of a button:

(Note that may need to enable ActiveX controls to get this to work. You'll also need to have Google Earth installed too)


<html>
<head>
<script>
function moveToCoordinates(lat, long)
{
try
{
var viewInfo = googleEarth.currentView;
viewInfo.latitude = lat;
viewInfo.longitude = long;
viewInfo.range = 1000;
viewInfo.tilt = 45;
viewInfo.azimuth = 30;
googleEarth.setView(viewInfo, 0.1);
}
catch (e)
{
alert(e.description);
}
}
</script>
</head>
<body>
<object
classid="clsid:AFD07A5E-3E20-4D77-825C-2F6D1A50BE5B"
id="googleEarth"
>
</object>
<button
onclick="moveToCoordinates(51.5256937588635, -3.20453415360346)"
>
Go To Steve's House
</button>
</body>
</html>



(Interestingly, inserting the <object> element into this post causes Google Earth to launch everytime this blog entry loads).