dwitter.net | joeytwiddle (2443)

+ New dweet
function u(t) {
} //
122/140


Please log in (or register) to post a dweet (copy-paste the code somewhere safe to save it meanwhile)


u(t) is called 60 times per second. t: Elapsed time in seconds. S: Shorthand for Math.sin. C: Shorthand for Math.cos. T: Shorthand for Math.tan. R: Function that generates rgba-strings, usage ex.: R(255, 255, 255, 0.5) c: A 1920x1080 canvas. x: A 2D context for that canvas.
Try the new frontend: beta.dwitter.net
Current theme challenge: #Opposites
show FPS hide FPS share fullscreen

function u(t) {

}//
140/140


Please log in (or register) to post as a new dweet (copy-paste code somewhere safe to save it meanwhile).

Please log in (or register) to comment.


function u(t) {

}//
138/140


Please log in (or register) to post as a new dweet (copy-paste code somewhere safe to save it meanwhile).

Please log in (or register) to comment.

show FPS hide FPS share fullscreen

function u(t) {

}//
131/140


Please log in (or register) to post as a new dweet (copy-paste code somewhere safe to save it meanwhile).

Please log in (or register) to comment.

show FPS hide FPS share fullscreen

function u(t) {

}//
140/140


Please log in (or register) to post as a new dweet (copy-paste code somewhere safe to save it meanwhile).

  • u/magna
    Amazing!
  • u/jorduino
    The code you have provided is a JavaScript program that uses the u() function to draw an animation on an HTML canvas element. The u() function is called 60 times per second, and uses the elapsed time t as a parameter to create the animation. The code uses a number of shorthand functions and variables to simplify the implementation of the u() function. The S, C, and T variables are shorthand for the Math.sin(), Math.cos(), and Math.tan() functions, respectively. The R() function is used to generate rgba color strings, and the c and x variables represent the canvas element and its 2D context, respectively. The u() function uses a loop to iterate over a range of values for i, and uses these values to calculate the X, Y, and Z coordinates for each iteration. The X and Y coordinates are used to draw a rectangle on the canvas using the fillRect() method, and the Z coordinate is used to scale the rectangle and create the illusion of depth. The globalAlpha property is used to set the transparency of the rectangles, and the style.filter property is used to invert the colors of the canvas. Overall, this code appears to be a simple example of how the canvas element and the u() function can be used to create an animation in JavaScript. It uses some advanced features of the language, such as shorthand functions and the canvas element, to create a visually interesting effect.
  • u/joeytwiddle
    This gives a better distribution of particles: Y=((i-.1)**5+t*2)%13-9 no more grid, but a few clusters

Please log in (or register) to comment.

show FPS hide FPS share fullscreen

function u(t) {

}//
127/140


Please log in (or register) to post as a new dweet (copy-paste code somewhere safe to save it meanwhile).

  • Divisors on a clock (second hand version) #math

Please log in (or register) to comment.

show FPS hide FPS share fullscreen

function u(t) {

}//
119/140


Please log in (or register) to post as a new dweet (copy-paste code somewhere safe to save it meanwhile).

  • Happy Birthday! :-D

Please log in (or register) to comment.

show FPS hide FPS share 1 remix fullscreen

function u(t) {

}//
139/140


Please log in (or register) to post as a new dweet (copy-paste code somewhere safe to save it meanwhile).

  • Example of looping with recursion, trailing off as time goes by
  • u/joeytwiddle
    For the first 9 seconds it calls u() 250 times per frame (on average), after that just once per frame
  • u/hollo47
    Looks like these M.C. Escher lithographies, I love the feel of it!

Please log in (or register) to comment.


function u(t) {

}//
137/140


Please log in (or register) to post as a new dweet (copy-paste code somewhere safe to save it meanwhile).

  • Random cloud generator

Please log in (or register) to comment.

show FPS hide FPS share 1 remix fullscreen

function u(t) {

}//
140/140


Please log in (or register) to post as a new dweet (copy-paste code somewhere safe to save it meanwhile).

  • u/joeytwiddle
    contrast(${T(t/5)} is interesting; less focus = more clarity

Please log in (or register) to comment.

show FPS hide FPS share 1 remix fullscreen

function u(t) {

}//
140/140


Please log in (or register) to post as a new dweet (copy-paste code somewhere safe to save it meanwhile).

  • River cruise remix #water

Please log in (or register) to comment.

Loading...
Next page