New shape examples

This commit is contained in:
Casey Reas
2012-08-31 03:10:12 +00:00
parent 7016010440
commit df3adbe14c
5 changed files with 1730 additions and 3 deletions

View File

@@ -0,0 +1,32 @@
/**
* Load and Display an OBJ Shape.
*
* The loadShape() command is used to read simple SVG (Scalable Vector Graphics)
* files and OBJ (Object) files into a Processing sketch. This example loads an
* OBJ file of a rocket and displays it to the screen.
*/
// The next line is needed if running in JavaScript Mode with Processing.js
/* @pjs preload="rocket.obj"; */
PShape rocket;
float ry;
public void setup() {
size(640, 360, P3D);
rocket = loadShape("rocket.obj");
}
public void draw() {
background(0);
lights();
translate(width/2, height/2 + 100, -200);
rotateZ(PI);
rotateY(ry);
shape(rocket);
ry += 0.02;
}

View File

@@ -0,0 +1,8 @@
newmtl Default
illum 2
Ka 0.698039 0.698039 0.698039
Kd 0.698039 0.698039 0.698039
Ks 0.710000 0.710000 0.710000
Ns 76.109253
map_Kd rocket.png

File diff suppressed because it is too large Load Diff

View File

@@ -3,9 +3,8 @@
* Illustration by George Brower.
*
* The loadShape() command is used to read simple SVG (Scalable Vector Graphics)
* files into a Processing sketch. This library was specifically tested under
* SVG files created from Adobe Illustrator. For now, we can't guarantee that
* it'll work for SVGs created with anything else.
* files and OBJ (Object) files into a Processing sketch. This example loads an
* SVG file of a monster robot face and displays it to the screen.
*/
// The next line is needed if running in JavaScript Mode with Processing.js

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB