# The Visual-Cortex, a powerful graphics-engine? Expensive compute–

## 3D

Programming 3D environments without many high level libraries makes clear why the visual-cortex is so large! [expensive it is to compute graphics?] Below are some excerpts of the low level of objects written to build from the ground up, everything. From vertex to triples, to triangles, and beyond– not recommended for anything besides painful learning. Especially with the verbosity of Java, here’s part of a triple class.

import java.nio.FloatBuffer;
import java.util.Scanner;

public class Triple
public double x, y, z;
public Triple( double a, double b, double c ) {
x = a; y = b; z = c;
}
public Triple( Scanner input ) {
x = input.nextDouble();
y = input.nextDouble();
z = input.nextDouble();
input.nextLine();
}

public void sendData( FloatBuffer buff ) {
buff.put( (float) x );
buff.put( (float) y );
buff.put( (float) z );
}

Which is then a part of a single vertex, like below; then with three vertices of 2 triple’s…. *drum roll* we can create a single shaded triangle.

import java.nio.FloatBuffer;
import java.util.Scanner;

public class Vertex {
private Triple position;
private Triple color;
public Vertex( Triple p, Triple c ) {
position = p;
color = c;
}
public Vertex( Scanner input ) {
position = new Triple( input );
color = new Triple( input );
}
public void sendData( FloatBuffer pb, FloatBuffer cb ) {
position.sendData( pb );
color.sendData( cb );
}
}

What is a world? What does it mean to have a world space and a horizon, Res Extensa. It turns out its not really that complicated or difficult to simulate a world, depending on resolution and complexity it can be computationally extensive.

Intimating the major elements involved in rendering a world and a 3-dimensional view point from within that space.

## 2D

How about simulating many individual agents, each acting according to their own internal rules based on the limited knowledge they have from their perspective [keeping this a bit simpler than game theory with humans]. Two dimensions is plenty, below demonstrates some interesting, beautiful behavior emerging from just 3 simple rules.

This is a python variation I wrote of Craig Reynolds, ‘boids’ algorithm from 1986. The behavior is determined by just 3 rules which each of the boids, or particles in this case, follows for itself. I ran this on my iPad and the compute slowed it to barely a crawl, I sped up the screen recording for this high action production.

There is actually one more rule here, a 4th force helping to keep them on the screen

• separation: steer to avoid crowding local flock
• alignment: steer towards the average heading of local flock
• cohesion: steer to move towards the average position (center of mass) of local flock

Some simple programs like these [even simpler], are turing complete and some sets of rules even create seemingly never ending complexity. If that sounds totally insane then you need to visit Stephen Wolfram’s work.

https://demonstrations.wolfram.com/CobwebDiagramsOfElementaryCellularAutomata/

This is a short little clip from recording the p5js program I uploaded onto a page of my blog on the left side. It allows for the variables controlling length of joining and acceleration/deceleration to be adjusted.

https://larsenclose.com/autopoeticcomplexity/

The following ones are also boids variants, these inspired by some of Daniel Shiffman’s work in his book on simulation nature . It has two flocks with different ranges of starting characteristics, also interactively, tapping the screen adds to each flock. A long screen press toggles what I call visualized entropic mode, were the history of the biods movements is retained. Then shaking the device will clear the screen. I built an APK for Nethunter and one for the Graphene android I had been been working on.

Clearly they behave in some very interesting ways despite being incredibly simple.

Another beautiful visual, the data for this was passively collected from all wireless signals within range.

The local neighborhood, in terms of wireless access points and clients, explored in 3D.