Skip to content

Instantly share code, notes, and snippets.

View jasonbeverage's full-sized avatar

Jason Beverage jasonbeverage

View GitHub Profile
@jasonbeverage
jasonbeverage / Clustering Callbacks.html
Last active September 29, 2017 21:20
Cesium Triangulation Clustering
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<meta name="description" content="Cluster labels, billboards and points.">
<meta name="cesium-sandcastle-labels" content="Tutorials,Showcases">
<title>Cesium Demo</title>
<script type="text/javascript" src="../Sandcastle-header.js"></script>
@jasonbeverage
jasonbeverage / future.cpp
Created March 8, 2017 15:18
Test of using Futures/Promise to do async things with osg.
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2010 Robert Osfield
*
* This application is open source and may be redistributed and/or modified
* freely and without restriction, both in commercial and non commercial applications,
* as long as this copyright notice is maintained.
*
* This application is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
@jasonbeverage
jasonbeverage / newparticles.cpp
Created February 22, 2017 17:40
new particles
/* OpenSceneGraph example, osgdrawinstanced.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
if ( image.valid() )
{
mosaic.getImages().push_back( TileImage(image.getImage(), *k) );
}
else
{
mosaic.getImages().push_back( TileImage(ImageUtils::createEmptyImage(getTileSize(), getTileSize()), *k));
}
@jasonbeverage
jasonbeverage / cesium_polyline_modify
Created December 12, 2016 18:32
Modify positions of a cesium polyline programatically.
var viewer = new Cesium.Viewer('cesiumContainer');
var positions = Cesium.Cartesian3.fromDegreesArray([-75, 37,
-85, 37]);
var redLine = viewer.entities.add({
name : 'Red line on the surface',
polyline : {
positions : positions,
width : 5,
@jasonbeverage
jasonbeverage / osg_tilerasterizer.cpp
Created November 18, 2016 16:37
Test of a TileRasterizerClass that reuses osg::Camera's as a service to render to textures
#include <osgDB/ReadFile>
#include <osgUtil/Optimizer>
#include <osg/CoordinateSystemNode>
#include <osg/Switch>
#include <osg/Types>
#include <osgText/Text>
#include <osgViewer/Viewer>
#include <osgViewer/ViewerEventHandlers>
@jasonbeverage
jasonbeverage / osgearth_rtt.cpp
Created November 18, 2016 15:38
Test of queued RTT rendering in osgearth.
#include <osgDB/ReadFile>
#include <osgUtil/Optimizer>
#include <osg/CoordinateSystemNode>
#include <osg/Switch>
#include <osg/Types>
#include <osgText/Text>
#include <osgViewer/Viewer>
#include <osgViewer/ViewerEventHandlers>
@jasonbeverage
jasonbeverage / gdal_datum.py
Created June 30, 2016 21:08
Transforms a file with a vert datum crs to the wgs84 ellipsoid.
from osgeo import gdal
from osgeo import gdal_array
from osgeo import osr
import numpy as np
import blocks
ds = gdal.Open("n39_egm96.tif")
srs = ds.GetProjectionRef()
source = osr.SpatialReference()
@jasonbeverage
jasonbeverage / osgearth_placemarks.cpp
Created June 29, 2016 19:08
Example of modifying PlaceNodes style at runtime in osgEarth
/* -*-c++-*- */
/* osgEarth - Dynamic map generation toolkit for OpenSceneGraph
* Copyright 2015 Pelican Mapping
* http://osgearth.org
*
* osgEarth is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
@jasonbeverage
jasonbeverage / quantized_heightfield.cpp
Created June 2, 2016 19:40
Test for zig zag encoding a heightfield.
/* -*-c++-*- */
/* osgEarth - Dynamic map generation toolkit for OpenSceneGraph
* Copyright 2015 Pelican Mapping
* http://osgearth.org
*
* osgEarth is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*