Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OrigamiSimulator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Amanda Ghassaei
OrigamiSimulator
Commits
6039dba4
Commit
6039dba4
authored
Feb 24, 2017
by
amandaghassaei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
small changes
parent
7991dddb
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
3 deletions
+6
-3
index.html
index.html
+1
-1
js/GPUMath.js
js/GPUMath.js
+4
-1
js/dynamicModel.js
js/dynamicModel.js
+1
-1
No files found.
index.html
View file @
6039dba4
...
@@ -142,7 +142,7 @@
...
@@ -142,7 +142,7 @@
vec3
nominalDist
=
neighborOriginalPosition
-
originalPosition
;
vec3
nominalDist
=
neighborOriginalPosition
-
originalPosition
;
vec3
deltaP
=
neighborLastPosition
-
lastPosition
+
nominalDist
;
vec3
deltaP
=
neighborLastPosition
-
lastPosition
+
nominalDist
;
deltaP
-=
normalize
(
deltaP
)
*
length
(
nominalDist
)
;
deltaP
-=
normalize
(
deltaP
)
*
beamMeta
[
2
]
;
vec3
deltaV
=
neighborLastVelocity
-
lastVelocity
;
vec3
deltaV
=
neighborLastVelocity
-
lastVelocity
;
vec3
_force
=
deltaP
*
beamMeta
[
0
]
+
deltaV
*
beamMeta
[
1
];
vec3
_force
=
deltaP
*
beamMeta
[
0
]
+
deltaV
*
beamMeta
[
1
];
...
...
js/GPUMath.js
View file @
6039dba4
...
@@ -9,7 +9,10 @@ function initGPUMath(){
...
@@ -9,7 +9,10 @@ function initGPUMath(){
var
canvas
=
document
.
getElementById
(
"
gpuMathCanvas
"
);
var
canvas
=
document
.
getElementById
(
"
gpuMathCanvas
"
);
var
gl
=
canvas
.
getContext
(
"
webgl
"
,
{
antialias
:
false
})
||
canvas
.
getContext
(
"
experimental-webgl
"
,
{
antialias
:
false
});
var
gl
=
canvas
.
getContext
(
"
webgl
"
,
{
antialias
:
false
})
||
canvas
.
getContext
(
"
experimental-webgl
"
,
{
antialias
:
false
});
gl
.
getExtension
(
'
OES_texture_float
'
);
var
floatTextures
=
gl
.
getExtension
(
'
OES_texture_float
'
);
if
(
!
floatTextures
)
{
console
.
warn
(
'
no floating point texture support
'
);
}
gl
.
disable
(
gl
.
DEPTH_TEST
);
gl
.
disable
(
gl
.
DEPTH_TEST
);
var
maxTexturesInFragmentShader
=
gl
.
getParameter
(
gl
.
MAX_TEXTURE_IMAGE_UNITS
);
var
maxTexturesInFragmentShader
=
gl
.
getParameter
(
gl
.
MAX_TEXTURE_IMAGE_UNITS
);
...
...
js/dynamicModel.js
View file @
6039dba4
...
@@ -285,7 +285,7 @@ function initDynamicModel(globals){
...
@@ -285,7 +285,7 @@ function initDynamicModel(globals){
lastVelocity
=
new
Float32Array
(
textureDim
*
textureDim
*
4
);
lastVelocity
=
new
Float32Array
(
textureDim
*
textureDim
*
4
);
externalForces
=
new
Float32Array
(
textureDim
*
textureDim
*
4
);
externalForces
=
new
Float32Array
(
textureDim
*
textureDim
*
4
);
mass
=
new
Float32Array
(
textureDim
*
textureDim
*
4
);
mass
=
new
Float32Array
(
textureDim
*
textureDim
*
4
);
meta
=
new
Float32Array
(
textureDim
*
textureDim
*
4
);
//todo uint16
meta
=
new
Float32Array
(
textureDim
*
textureDim
*
4
);
beamMeta
=
new
Float32Array
(
textureDimEdges
*
textureDimEdges
*
4
);
beamMeta
=
new
Float32Array
(
textureDimEdges
*
textureDimEdges
*
4
);
for
(
var
i
=
0
;
i
<
textureDim
*
textureDim
;
i
++
){
for
(
var
i
=
0
;
i
<
textureDim
*
textureDim
;
i
++
){
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment