Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Amanda Ghassaei
OrigamiSimulator
Commits
6039dba4
Commit
6039dba4
authored
Feb 24, 2017
by
amandaghassaei
Browse files
small changes
parent
7991dddb
Changes
3
Hide whitespace changes
Inline
Side-by-side
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