Skip to content

Instantly share code, notes, and snippets.

;; Gimp script-fu plugin
;;
;; Draws a sqaure grid with the specified size into a new layer.
;; The lines of the grid are drawn using the current brush & foreground color.
;;
;; Author: Anthony J. Thibault
;; email: [email protected]
;;
;; Copyright (c) 2009 Anthony J. Thibault
;;
;; Gimp script-fu plugin
;;
;; Draws a polygon with the specified number of sides into a new layer.
;; The edges of the polygon are drawn using the current brush & foreground color.
;;
;; Author: Anthony J. Thibault
;; email: [email protected]
;;
;; Copyright (c) 2009 Anthony J. Thibault
;;
@hyperlogic
hyperlogic / glm.natvis
Created July 16, 2015 18:48
Visual Studio Debugger Pretty Print for glm types
<?xml version="1.0" encoding="utf-8"?>
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
<!-- Place this into your "\My Documents\Visual Studio 2012\Visualizers\" folder -->
<Type Name="glm::detail::tvec3&lt;*&gt;">
<DisplayString>({x}, {y}, {z})</DisplayString>
<Expand>
<Item Name="x">x</Item>
<Item Name="y">y</Item>
<Item Name="z">z</Item>
</Expand>
@hyperlogic
hyperlogic / snoopDance.js
Last active August 28, 2018 19:00
High Fidelity script to procedurally manipulate the hands using IK
var handlerId = 0;
var phi = 0.0;
var phi2 = 0.0;
var forward = true;
var RX90 = Quat.angleAxis(90.0, {x: 1, y: 0, z: 0});
function init() {
var t = 0;
var propList = ["leftHandType", "leftHandPosition", "leftHandRotation", "rightHandType", "rightHandPosition", "rightHandPosition"];
handlerId = MyAvatar.addAnimationStateHandler(function (props) {
@hyperlogic
hyperlogic / avatar-thrasher.js
Last active April 28, 2016 20:14
High Fidelity test script that rapidly changes your avatar
var avatarList = [
// art3mis
"https://hifi-metaverse.s3-us-west-1.amazonaws.com/marketplace/contents/e76946cc-c272-4adf-9bb6-02cde0a4b57d/8fd984ea6fe1495147a3303f87fa6e23.fst?1460131758",
// blue dude
"https://hifi-metaverse.s3-us-west-1.amazonaws.com/marketplace/contents/3fa9800e-b4e6-47b7-b6bc-6332a3d3ab9d/d111ef3373868f22cbd6772453e50b8c.fst?1460131911",
// head and hands
"https://hifi-metaverse.s3-us-west-1.amazonaws.com/marketplace/contents/7d2e01bc-735d-49ff-9cc3-b3e14062aa8e/844b0e9a30257eda858a305656be6a64.fst?1459784301",
// simple robot
"https://hifi-metaverse.s3-us-west-1.amazonaws.com/marketplace/contents/1b7e1e7c-6c0b-4f20-9cd0-1d5ccedae620/bb64e937acf86447f6829767e958073c.fst?1460133999",
// will
@hyperlogic
hyperlogic / disableAvatarAnimations.js
Last active April 28, 2016 20:13
High Fidelity script to replace all animations with a static pose
//
// disableAvatarAnimations.js
// examples
//
// Copyright 2016 High Fidelity, Inc.
//
// When launched, it will replace all of the avatars animations with a single frame idle pose.
// full body IK and hand grabbing animations will still continue to function, but all other
// animations will be replaced.
//
@hyperlogic
hyperlogic / softer-idles.json
Last active April 28, 2016 20:13
High Fidelity avatar.json which replaces idle animations with a different set
{
"version": "1.0",
"root": {
"id": "userAnimStateMachine",
"type": "stateMachine",
"data": {
"currentState": "userAnimNone",
"states": [
{
"id": "userAnimNone",
@hyperlogic
hyperlogic / disableFeetIK.js
Last active April 28, 2016 20:12
High Fidelity script to disable foot IK on your avatar.
var ikTypes = {
RotationAndPosition: 0,
RotationOnly: 1,
HmdHead: 2,
HipsRelativeRotationAndPosition: 3,
Off: 4
};
function animStateHandler(props) {
return { leftFootType: ikTypes["Off"],
@hyperlogic
hyperlogic / avatarMover.js
Created April 30, 2016 05:28
Move the avatar in a circle!
var theta = 0;
function update(dt) {
theta += 0.01;
// update
var speed = 3.0;
MyAvatar.motorVelocity = {x: speed * Math.cos(theta), y: 0, z: speed * Math.sin(theta)};
MyAvatar.motorTimescale = 0.25;
@hyperlogic
hyperlogic / kitty.js
Created April 30, 2016 16:49
creates a giant kitty image
var MODEL_URL = "http://hifi-production.s3.amazonaws.com/tutorials/pictureFrame/finalFrame.fbx";
function getPosition() {
// Always put it 5 meters in front of you
var position = MyAvatar.position;
var yaw = MyAvatar.bodyYaw + MyAvatar.getHeadFinalYaw();
var rads = (yaw / 180) * Math.PI;
position.y += 0.5;