Hi all, I am working on a project that involves using an Arduino with the "standard firmata" to receive signals from a joystick. But I also have a standard 16x2 LCD attached to the Arduino, and I want to be able to display text on the LCD while the user plays the game.
I discovered the "Frappuccino" library which seems to offer a way to do this, but I can't figure out how the library works. The Frappuccino example for using a LCD looks like this:
import muvium.processing.*;
import muvium.processing.arduino.LiquidCrystal;
import muvium.sim.virtualbreadboard.ICEShield;
public class HelloWorldApp extends V18OBoard{
LiquidCrystal lcd;
/**
Static Pins are configured in the configureDevice pre-process
But this example does not actually connect to an Arduino, it does not even have the Serial library added! So I am wondering if anyone familiar with the Frappuccino library can offer me a quick explanation of how it works. Am I even using it correctly? What is the Muvium Toolkit?
I have been working on a making a grid of cubes floating in 3d space, all textured with different photos so that the composite ends up looking like a face.
I started with a grid of 10x10 (100 cubes in total). I textured each side of each cube with a different image that corresponded to its place in the grid. That's 600 images total. There were never any performance problems there.
I want to increase the resolution to 20x20 (400 cubes total), but the more images it has to load the more the program slows down. I would think that since the images load at setup(), and the texture of the cubes don't change in the program, the amount of images shouldn't be slowing down the sketch.
If I texture each side of the cubes with the same image, then the Sketch only has to load 400 images, and it runs without a hiccup. Which tells me that the number of *instances* of the Box() object is not the problem here. It's the images being loaded. I used "png-8" file types, so they are very small. A thousand images takes up only a couple MBs of space.
I'm afraid someone is going to respond to this with "are you crazy?" Well, I'm new to Processing and completely self-instructed, so, yes, maybe. I have attached a link to the sketch folder in my dropbox
HERE. Thanks for the insight, guys.
I am new to Processing, and to writing code in general, so forgive me in advance if I don't express myself clearly.
My goal is to make a 10x10 grid of Cubes floating in 3d space. Eventually each cube will be textured with a corresponding piece of an image, so that a composite image is formed.
I have decided to use the Quark Shape3D library, which has a Box() class that allows for all 6 "faces" of the cube to use a different image as texture.
The problem I am having is that I do not really understand how the Box() class receives position and rotation parameters. I have been using
cube[i][j].shapeOrientation(null, new PVector(i*30, j*30, 20));
which positions the cubes into roughly the shape I want, but I don't really understand the what "PVector" is or how it decides the position. 0,0 seems to place the cubes at the center of the image, rather than at the top left as I would expect.
Then in void draw() I have included code to rotate each Cube, but instead of each cube rotating on its own axis, all the cubes end up rotating around a universal axis.
So I wonder if someone can help by explaining how the Shapes3d library actually works. I have been digging through the library "Reference" pages, but I don't understand it much since everything is composed of abbreviations and acronyms. Below is the full code, I have commented out the lines involving Texturing so that you won't have to download dependent files.
import shapes3d.utils.*;
import shapes3d.animation.*;
import shapes3d.*;
Box[][] cube;
int cols = 10;
int rows = 10;
float angleX, angleY, angleZ;
void setup() {
size(400,400, P3D);
background(160, 0, 90);
lights();
cube = new Box[cols][rows];
for (int i = 0; i < cols; i++) {
for (int j = 0; j < rows; j++) {
cube[i][j] = new Box(this);
//String[] faces = new String[] {
// "face_00.png", "face_01.png", "face_02.png",
// "face_03.png", "face_04.png", "face_05.png"
//};
//cube[i][j].setTextures(faces);
cube[i][j].fill(color(255));
cube[i][j].setSize(20,20,20);
cube[i][j].drawMode(S3D.TEXTURE | S3D.SOLID);
cube[i][j].shapeOrientation(null, new PVector(i*30, j*30, 20));