Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
teinsai
teinsai's Profile
2
Posts
0
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Expanded view
List view
Private Message
Creating Shadows
[0 Replies]
09-Feb-2011 11:20 PM
Forum:
Programming Questions
I am trying to cast a shadow of the line onto the 2 axes that are shown in the following program code, not sure if its possible.
Also, is it possible that after running the code, to change the position of the line without going back to the source code?
Thanks a million!
void setup ()
{
size(600, 500, P3D);
smooth();
frameRate(30);
}
void draw() {
//ortho();
lights();
background(#D6D6D6);
camera(400, -400, 400, // eyeX, eyeY, eyeZ
0, 0, 0.0, // centerX, centerY, centerZ
0.0, 1.0, 0.0); // upX, upY, upZ
float dirY = (mouseY / float(height) - 0.5) * 2;
float dirX = (mouseX / float(width) - 0.5) * 2;
directionalLight(204, 204, 204, -dirX, -dirY, -1);
// Draw the axes
noStroke();
pushMatrix();
translate(300/2,0,0);
box(350, 0, 350);
popMatrix();
pushMatrix();
translate(0,-300/2,0);
box(0, 350, 350);
popMatrix();
// Draw a line
stroke(#000000);
strokeWeight(1);
line(340,-140,240,40,-250,-300);
noStroke();
pushMatrix();
translate(40, -250, -300);
sphere(5);
popMatrix();
pushMatrix();
translate(340, -140, 240);
sphere(5);
popMatrix();
}
Background
[2 Replies]
17-Jan-2011 07:59 PM
Forum:
Programming Questions
May i know how to get a grid background, something like a graph paper?
http://processing.org/learning/transform2d/
i want something similar to the grid shown in the webpage.
also is there a place where there is a list of commands that i can view?
I am using processing for my Thesis and it would be of great help if anyone could help out here.
Thanks a million
«Prev
Next »
Moderate user : teinsai
Forum