mirror of
https://github.com/processing/processing4.git
synced 2026-01-28 19:01:08 +01:00
New shape examples
This commit is contained in:
32
java/examples/Basics/Shape/LoadDisplayOBJ/LoadDisplayOBJ.pde
Normal file
32
java/examples/Basics/Shape/LoadDisplayOBJ/LoadDisplayOBJ.pde
Normal 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;
|
||||
}
|
||||
@@ -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
|
||||
|
||||
1688
java/examples/Basics/Shape/LoadDisplayOBJ/data/rocket.obj
Normal file
1688
java/examples/Basics/Shape/LoadDisplayOBJ/data/rocket.obj
Normal file
File diff suppressed because it is too large
Load Diff
@@ -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
|
||||
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Reference in New Issue
Block a user