This repository has been archived by the owner on Jun 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
aesthetics: Improve Fluid + sequencing
- Loading branch information
Showing
15 changed files
with
198 additions
and
169 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { GL_LINES } from '../gl/constants'; | ||
import { Geometry } from '../heck/Geometry'; | ||
import { glCreateVertexbuffer } from '../gl/glCreateVertexbuffer'; | ||
import { glVertexArrayBindVertexbuffer } from '../gl/glVertexArrayBindVertexbuffer'; | ||
|
||
export function genWireCube( dimension?: [ number, number, number ] ): Geometry { | ||
const [ x, y, z ] = dimension ?? [ 1, 1, 1 ]; | ||
|
||
const arrayPosition = [ | ||
-x, -y, z, | ||
x, -y, z, | ||
x, -y, z, | ||
x, y, z, | ||
x, y, z, | ||
-x, y, z, | ||
-x, y, z, | ||
-x, -y, z, | ||
|
||
-x, -y, -z, | ||
x, -y, -z, | ||
x, -y, -z, | ||
x, y, -z, | ||
x, y, -z, | ||
-x, y, -z, | ||
-x, y, -z, | ||
-x, -y, -z, | ||
|
||
-x, -y, z, | ||
-x, -y, -z, | ||
x, -y, z, | ||
x, -y, -z, | ||
x, y, z, | ||
x, y, -z, | ||
-x, y, z, | ||
-x, y, -z, | ||
]; | ||
|
||
// -- buffers ------------------------------------------------------------------------------------ | ||
const position = glCreateVertexbuffer( new Float32Array( arrayPosition ) ); | ||
|
||
// -- geometry ----------------------------------------------------------------------------------- | ||
const geometry = new Geometry(); | ||
geometry.count = arrayPosition.length / 3; | ||
geometry.mode = GL_LINES; | ||
|
||
glVertexArrayBindVertexbuffer( geometry.vao, position, 0, 3 ); | ||
|
||
return geometry; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export const GRID_RESO_SQRT = 12; | ||
export const GRID_RESO_SQRT = 10; | ||
export const GRID_RESO = GRID_RESO_SQRT * GRID_RESO_SQRT; | ||
export const BUFFER_RESO = GRID_RESO * GRID_RESO_SQRT; | ||
export const CURL = 4.0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.