Frontal HyperSphere 4D
Frontal HyperSphere 4D
El concepto del Teseracto o Hipercubo siempre es representado ladeado para poder observar su funcionamiento.
El concepto del Teseracto o Hipercubo siempre es representado ladeado para poder observar su funcionamiento.
No obstante el reto se vuelve mas intenso e interesante cuando lo que queremos es intentar plasmar el flujo que seguiria dicho hipercubo.
Hemos de reconocer que, ya de por si, la idea inicial ya posee un nivel de reto interesante. Pero no lo suficiente para ser considerado digno de todos los “pecincoforistas” (seguidores de este increible nuestro Laboratorio de Arte Generativo con P5.js).
We must recognize that, in itself, the initial idea already has an interesting level of challenge. But not enough to be considered worthy of all the “Pfivefollowersists” (followers of this incredible our Generative Art Laboratory with P5.js).
Asi que para hacerlo mucho más increiblemente dificil de conseguir (un reto digno de nuestra creatividad e imaginacion), decidi incorporar dos dificultades extra:
- La primera era realizarlo con una esfera, es decir, en lugar de tratarse de un cubo dentro de otro cubo que fuera una esfera dentro de otra esfera.
- La segunda dificultad residia principalmente es realizar una visualizacion frontal del mismo, en lugar de ladeada.
So to make it much more incredibly difficult to achieve (a challenge worthy of our creativity and imagination), I decided to incorporate two extra difficulties:
- The first was to do it with a sphere, that is, instead of being a cube within another cube, it was a sphere within another sphere.
- The second difficulty resided mainly in making a frontal visualization of it, instead of from one side.
El resultado ha sido un autentico exito. Podemos observar como los circulos creados (pertenecientes a los bordes de las esferas) son creados desde el centro (desde la parte mas alejada) y se van haciendo mas grandes para luego curvarse e ir decreciendo al alejarse para conformar (una vez alcanzado su parte mas alejada) un nuevo circulo).
Dado que queriamos representar dicho flujo (partiendo de una programación 2D), podemos observar dos tipos de direcciones de las lineas representadas:
- Una desde el centro hacia afuera representando la esfera que se acerca (aquella que viaja en el interior de la esfera exterior).
- Y un segundo movimiento desde fuera hacia el centro (que representa el movimiento de la esfera exterior) mucho mas deforme y estriada y que representa el viaje hacia la cara posterior donde, alcanzado su posicion mas alejada, formará una nueva esfera que repetirá su ciclo.
The result has been a real success. We can observe how the circles created (belonging to the edges of the spheres) are created from the center (from the furthest part) and become larger and then curve and decrease as they move away to form (once reaching their furthest part). distant) a new circle).
Since we wanted to represent this flow (starting from a 2D programming), we can observe two types of directions of the represented lines:
- One from the center outwards representing the approaching sphere (the one that travels inside the outer sphere).
- And a second movement from the outside towards the center (which represents the movement of the outer sphere) much more deformed and striated and which represents the journey towards the rear face where, having reached its furthest position, it will form a new sphere that will repeat its cycle. .
CÓDIGO
//(C)Sergio Salazar Latorre
//Frontal HyperSphere4D
let l=600
let epl=55
let D = l/epl
let r = D/2
let hs = Array(epl)
function setup() {
createCanvas(l,l);
cargarHS()
angleMode(DEGREES)
}
function draw() {
background(0);
noFill()
//fill(255,0,0,1)
stroke(255)
visualizaHS()
Firma()
}
function Firma(){
push()
fill(255,0,0)
strokeWeight(4)
stroke(0)
text("(C)Sergio Salazar Latorre",10,l-20)
text("Frontal HyperSphere4D",10,l-5)
pop()
}
function cargarHS(){
let ind = 0
for(let i=0; i<epl; i++){
for(let j=0; j<epl; j++){
hs[ind] = new HiperSphere(r+D*i, r+D*j, D)
ind++
}
}
}
function visualizaHS(){
let ind = 0
for(let i=0; i<epl; i++){
for(let j=0; j<epl; j++){
hs[ind].show()
ind++
}
}
}
class HiperSphere{
constructor(x,y,D){
this.x = x
this.y = y
this.D = D
this.mD
this.V = 0.4
this.no = 2
}
show(){
this.calcularModuladorDiametro(1)
this.dibujarHiperSphere4D(1)
}
calcularModuladorDiametro(cV){
if(cV==1){ //frontal circulo
this.mD = sin(frameCount*this.V-this.no*dist(l/2,l/2,this.x, this.y))*10
} else if(cV==2){
this.mD = sin(frameCount*this.V-this.no*dist(l/2,l/2,this.x, this.y))*5
}
}
dibujarHiperSphere4D(cF){
if(cF==1){
circle(this.x, this.y, this.D*this.mD)
} else if(cF==2){
square(this.x, this.y, this.D*this.mD)
} else if(cF==3){
stroke(255,50)
rectMode(CENTER)
square(this.x, this.y, this.D*this.mD)
}
}
}
Comentarios
Publicar un comentario