Skip to content

Instantly share code, notes, and snippets.

View monkstone's full-sized avatar

Martin Prout monkstone

View GitHub Profile
@monkstone
monkstone / test_pov.rb
Created November 17, 2011 20:20
Testing My Povwriter Library in ruby-processing
# Demonstrates how you can use my povwriter libary
# in Ruby-Processing, to export to PovRAY
load_libraries 'povwriter', 'control_panel'
import 'povexport'
DATA = [-1, 0, 1]
attr_reader :exporter, :precord, :pquality, :type, :pview, :memory, :povfile
def setup
@monkstone
monkstone / FTest.ini
Created January 19, 2012 10:44
Exporting TriangleMesh (toxi) as Mesh2 (PovRAY) now uses PrintWriter
; implicit.ini
Input_File_Name=/home/tux/FTest.pov
Output_File_Name=/home/tux/FTest.png
Width=1280
Height=1024
Quality=11 ; high quality output set to say 5 for preview
Antialias=on
Sampling_Method=2
@monkstone
monkstone / HET_Export.java
Created January 22, 2012 21:37
Exporting from processing sketches (using Hemesh library) directly to PovRAY mesh2
/**
* Modified to include ability to export as PovRAY mesh2 by Martin Prout 2012
*/
package wblut.hemesh.tools;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.nio.ByteBuffer;
@monkstone
monkstone / FacadeApp.java
Created February 6, 2012 10:52
Testing my povmesh library with a prelease version of toxiclibs-21
/*
* __ __
* _____ _____/ |___ _ _____________| | __ ______
* / \_/ __ \ __\ \/ \/ / _ \_ __ \ |/ / / ___/
* | Y Y \ ___/| | \ ( <_> ) | \/ < \___ \
* |__|_| /\___ >__| \/\_/ \____/|__| |__|_ \/____ >
* \/ \/ \/ \/
* _____ .___
* _/ ____\____ ____ _____ __| _/____ Processing and
* \ __\\__ \ _/ ___\\__ \ / __ |/ __ \ toxiclibs workshop
@monkstone
monkstone / POVInterface.java
Created February 7, 2012 20:38
Refactored POvRAY export from toxiclibs (as and external library)
/*
* This library adds PovRAY export facility to toxiclibscore
* Copyright (c) 2012 Martin Prout
*
* This library 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.1 of the License, or (at your option)
* any later version.
*
* http://creativecommons.org/licenses/LGPL/2.1/
@monkstone
monkstone / processing.xml
Created October 24, 2012 14:55
A jEdit Commando File for processing
<?xml version="1.0"?>
<!DOCTYPE COMMANDO SYSTEM "commando.dtd"><!-- processing commando -->
<!-- Monkstone, 2012-Nov-2 -->
<COMMANDO>
<UI>
<CAPTION LABEL="Run Processing">
<FILE_ENTRY LABEL="pde file" VARNAME="pde" EVAL="MiscUtilities.getParentOfPath(buffer.getPath())"/>
</CAPTION>
<CAPTION LABEL="Path to processing-java">
@monkstone
monkstone / newSketch.bsh
Created November 6, 2012 06:55
Macro to create new processing sketch in jedit (uses toxis abbreviations)
// This macro creates a new 3d processing file uses abbreviations
Buffer newBuffer = jEdit.newFile(view);
view.goToBuffer(newBuffer);
newBuffer.setMode("processing");
textArea.setSelectedText("setup3d#800#600#");
Abbrevs.expandAbbrev(view,true);
buffer.saveAs(view,true);
@monkstone
monkstone / PYP5.bsh
Created November 24, 2012 10:56
processing.py utils for jedit
// This is a recorded macro. First, check over the
// commands to make sure this is what you intended. Then,
// save this buffer, and the macro should appear in the
// Macros menu.
new console.commando.CommandoDialog(view,"commando.PYP5");
/**
* Create Graphics.
*
* The createGraphics() function creates an object from the PGraphics class
* PGraphics is the main graphics and rendering context for Processing.
* The beginDraw() method is necessary to prepare for drawing and endDraw() is
* necessary to finish. Use this class if you need to draw into an off-screen
* graphics buffer or to maintain two contexts with different properties.
*/
@monkstone
monkstone / Esfera.pde
Created February 16, 2013 08:27
A modified version of a processing example, removal of spurious code, and obey java syntax conventions,
/**
* Esfera
* by David Pena.
*
* Distribucion aleatoria uniforme sobre la superficie de una esfera.
*/
int cuantos = 16000;
Pelo[] lista ;
//float[] z = new float[cuantos]; Completely spurious variable assignment