## dwitter.net | #Torus

+ 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. ```
Theme challenge of the month: #cavern
show FPS hide FPS share

`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).

• Pulsating Torus

`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).

• Torus at the Discoteque

show FPS hide FPS share

`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).

• u/pavel
`(x*x+y*y+z*z+3)**2>16*(x*x+y*y)` is directly from https://en.wikipedia.org/wiki/Torus
• u/pavel
with `R=2` and `r=1`
• u/pavel
This example shoots rays from (0,0,4). In order to rotate the shape you have to move where the rays come from, the camera!
• u/tomxor
Thanks for the explanation 👍

show FPS hide FPS share

`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).

`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).

`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).

• Organic Torus Deformation #torus

show FPS hide FPS share

`function u(t) {`

```}// 132/140 ```

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

• Two-color phong specular shaded torus
• u/pavel
166 `for(j=22;q=C(v=j--/8),r=300+150*q,z=S(v);)for(i=114;u=i--/18;x.fillRect(947+r*C(u),528+r*S(u),25,25))f=2*z*(q*C(u)*S(t)+z*C(t))-C(t),x.fillStyle=R(g=f*f*256,g,g+20*f)`
• u/tomxor
• u/f8f82804

show FPS hide FPS share

`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).

show FPS hide FPS share
remix of d/2564 by u/nystrand

`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).

`function u(t) {`
```}// 134/140 ```