Thursday, December 03, 2020

Terrain Generation in Processing

I have finally gotten deeper into programming with Processing and recently watched a video on terrain generation by Daniel Shiffman (The Coding Train) on 3D Terrain Generation with Perlin Noise in Processing .

Daniel is an excellent teacher and provides complete source code for all his presentations.

This is a little recorded sample of my attempt to implement it and add some Minecraft-like coloring.

Here is my Processing code, based heavily on Daniel’s.

// Terrain Generation and Flyby using Processing
// Douglas E. Welch After Daniel Schiffman - TechIQ.welchwrite.com



int cols, rows;
int scl = 20;
int w = 2200;
int h = 2200;



float flying=0;



float [][] terrain;



void setup() {
size(1280, 720, P3D);



cols = w /scl;
rows = h/scl;



terrain= new float[cols][rows];
}




void draw() {



flying += - .1;



float yoff = flying;



for (int y = 0; y< rows; y++) {
float xoff=0;
for (int x=0; x < cols; x++) {
terrain[x][y] = map(noise(xoff, yoff), 0, 1, -150, 150);
xoff+=0.1;
}
yoff +=0.1;
}



background(0);
//noStroke();
stroke(75);
fill(175);
//noFill();




translate(width/2, height/2);
rotateX(PI/3);



translate(-w/2, -h/2);



for (int y = 0; y< rows-1; y++) {
beginShape(TRIANGLE_STRIP);
for (int x=0; x < cols; x++) {



//rect(x*scl, y*scl, scl, scl);
vertex(x*scl, y*scl, terrain[x][y]);
vertex(x*scl, (y+1)*scl, terrain[x][y+1]);

// Water
if (terrain[x][y] <= -60) {
fill(0, 0, 150);
stroke(0,0,150);
}
//Plains
if (terrain[x][y] >= -59 && terrain[x][y] <=0) {
stroke(0,100,0);
fill(0, 100, 0);
}

//Stone
if (terrain[x][y] >= 0 && terrain[x][y] <=50) {
stroke(51);
fill(51);
}

// Snow
if (terrain[x][y] > 50) {
stroke(255);
fill(255, 255, 255);
}
}



endShape();
}
saveFrame("output/ter-#####.png");
}

Historical Technology Books - 71 in a series - The Inventions Researches And Writings Of Nikola Tesla (1894)

Historical Technology Books - 70 in a series - The Edison Papers, Folder 45

 

Wednesday, December 02, 2020

Get a Snapshot of your day with Google Assistant via The Official Google Blog

Two years ago, we introduced Google Assistant Snapshot, a new way to stay on top of your day with Google Assistant. Now, we're adding a few updates to make Snapshot more helpful, and proactive, in keeping you ahead of your upcoming tasks while also providing you with recommended activities and more, all in one place on Android or iOS devices.

See a summary of your most important tasks 

In addition to the essential information you’ve grown to rely on like your agenda, commute times and reminders to pay your credit card, you’ll now start to see a summary of other important tasks right at the top—things like reminders for upcoming birthdays and holidays. Your Snapshot will adjust based on the time of day and your interactions with Google Assistant. For example, in the morning you will see a card about your commute, weather, to-dos and top headlines.

Read Get a Snapshot of your day with Google Assistant via The Official Google Blog


An interesting link found among my daily reading

Monday, November 30, 2020

12 great gift ideas for Raspberry Pi fans in 2020 via TechRepublic

The Raspberry Pi has been a runaway success since its launch in 2012, and each year since then has brought us a new Pi board or Pi-related piece of kit to tinker with. In fact, the number of accessories now available for the Raspberry Pi is vast – which is great for Raspberry Pi fans, but less so for the unfortunate journalists tasked with putting together Pi-related gift guides each year.

While the Raspberry Pi makes a pretty good gift by itself – the latest Pi 4 Model B comes in at a very respectable $35 – a new piece of Raspberry Pi kit for the Pi lovers already in your life could make the perfect stocking filler for the coming festive season. Read on for our favorites.

Read 12 great gift ideas for Raspberry Pi fans in 2020 via TechRepublic



An interesting link found among my daily reading

Thursday, November 26, 2020

Historical Technology Books - 70 in a series - The Edison Papers, Folder 45

Historical Technology Books - 70 in a series - The Edison Papers, Folder 45

"The editors of the Edison Papers produced descriptions for each of the folders listed below. These folders can be found in the Thomas A. Edison Papers Digital Edition. They generally include the names of companies, persons, technologies, publications, countries, and other subjects that are important or of particular interest in that group of documents (although some folder descriptions in the early years are quite spare). They also often reveal background information about or relationships between people, companies, governments, and other institutions."

 

Wednesday, November 25, 2020

Vacuum Dragster Uses Syringes For Propulsion via HackADay

Vacuum Dragster Uses Syringes For Propulsion via HackADay

Atmospheric pressure is all around us, and capable of providing a great deal of force when used properly. As Otto Von Guericke demonstrated with his Magdeburg hemispheres over 350 years ago, simply removing air from a chamber to create a vacuum can have astounding results. More recently, [Tom Stanton] has used vacuum to power a small 3D-printed dragster.

In the dragster build, a typical plunger syringe is plugged at the end, and the plunger pulled back. Atmospheric pressure acts against the vacuum, wanting to push the plunger back towards its original position. To make use of this, a string is attached to the plunger, causing it to turn a gear as it moves forward, driving the rear wheels through a belt drive. With the correct gear ratio on the belt drive, the dragster is capable of spinning its tires and shooting forwards at a quick pace.

Read Vacuum Dragster Uses Syringes For Propulsion via HackADay

Monday, November 23, 2020

Autopilot for Sailing Boats (Automatic Steering System) via Arduino.cc [Arduino]

What Autopilot can do for you:

A sailing boat does not have an engine and cannot go along a programmed path from harbour to the beach, then to the fishing spot, turn around the Lighthouse and back, all itself, it cannot.

Whole work is done by the Sailor, we have to understand it at this point: trimming sails, take under control weather and the wind source/speed, harden or release ropes, mind other boats, decide direction and steering... When the Sailor decide for a break, let say just 10 seconds or up a few minutes (the famous "tea time"), he switches Autopilot on. In a cup of seconds its GPS acquire position, speed and direction of the boat and is able to mantain the direction (route). The steering system, a stick connected to the rudder, usually moved by the expert Sailor hands, now is under control by Autopilot through the Stepper Motor connected to it by pulleys and ropes.

Read Autopilot for Sailing Boats (Automatic Steering System) via Arduino.cc



An interesting link found among my daily reading

Thursday, November 19, 2020

Historical Technology Books - 69 in a series - Coloring Book "A metamorphosis of creative copying" - Xerox

Historical Technology Books - 69 in a series - Coloring Book "A metamorphosis of creative copying" - Xerox

 

Wednesday, November 18, 2020

These Are Some of the Best Citizen Science Projects You Can Join With Just Your Phone or Laptop via Gizmodo

These Are Some of the Best Citizen Science Projects You Can Join With Just Your Phone or Laptop

Maybe you’ve never noticed, because they don’t get a lot of hype but there are hundreds and hundreds of citizen science projects that you can get involved in. These projects range from tagging space observatory photos to transcribing documents that are centuries old. You don’t need any special skills or qualifications to help advance the cause of science, just a laptop or a phone.

We’re indebted to a number of citizen science websites for collecting these projects—check out Zooniverse, SciStarter, AnecData, CitizenScience.gov, and Wikipedia (of course) for some more inspiration. There are hundreds of projects you can get involved with at any time, all contributing to worthy causes across the planet.

We’ve collected some of our current favorites below.

Read These Are Some of the Best Citizen Science Projects You Can Join With Just Your Phone or Laptop

Monday, November 16, 2020

Internet Connected E-Paper Message Board via HackADay [Raspberry Pi]

Are you still writing notes on paper and sticking them to the fridge like it’s the ’80s? Well, if you are, and you read this site, you’d probably like to upgrade to something a bit more 21st century. And, thanks to robot maker [James Bruton], you can leave your old, last century, message taking behind as he has a tutorial up showing you how to build an internet connected e-paper message display board. And, if you have a Raspberry Pi, an e-paper display and adapters just lying around doing nothing, then this project will cost you less than the buck that paper and a magnet will cost you.

Sarcasm aside, this is a pretty nice project. As mentioned, the base of this is a Raspberry Pi – [James] uses a Pi 4, but you could get away with an older, lower powered model as well. This powers the cheap(-ish) e-paper display he found online, which comes with the necessary adapters for the Pi, as well as a python library to write to the display. [James] uses a Google Sheet as the cloud storage for the message board, and there is some python code to access the cells in the Sheet and print them on the display if anything has changed. A cron job runs the script every 5 minutes to catch changes in the messages.

Read Internet Connected E-Paper Message Board via HackADay