Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
computergraphics
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
표 영종
computergraphics
Commits
854dc80d
Commit
854dc80d
authored
11 months ago
by
pyjong1999
Browse files
Options
Downloads
Patches
Plain Diff
Amimation Implement
parent
1bcb5506
Branches
master
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
example/project.js
+7
-44
7 additions, 44 deletions
example/project.js
with
7 additions
and
44 deletions
example/project.js
+
7
−
44
View file @
854dc80d
...
...
@@ -69,7 +69,7 @@ var numNodes = 13;
var
numAngles
=
15
;
var
angle
=
0
;
var
posVec
=
[
0
,
0
,
0
];
var
posVec
=
[
-
1
0
,
0
,
-
5
];
var
theta
=
[
70
,
0
,
210
,
-
60
,
210
,
-
60
,
210
,
-
60
,
210
,
-
60
,
-
60
,
150
,
0
,
0
,
0
];
var
directionVec
=
[
0
,
0
,
0
];
...
...
@@ -524,48 +524,6 @@ window.onload = function init() {
initNodes
(
torsoId
);
return
;
};
// document.getElementById("slider1").onchange = function(event) {
// theta[head1Id] = event.target.value;
// initNodes(head1Id);
// };
// document.getElementById("slider2").onchange = function(event) {
// theta[leftUpperArmId] = event.target.value;
// initNodes(leftUpperArmId);
// };
// document.getElementById("slider3").onchange = function(event) {
// theta[leftLowerArmId] = event.target.value;
// initNodes(leftLowerArmId);
// };
// document.getElementById("slider4").onchange = function(event) {
// theta[rightUpperArmId] = event.target.value;
// initNodes(rightUpperArmId);
// };
// document.getElementById("slider5").onchange = function(event) {
// theta[rightLowerArmId] = event.target.value;
// initNodes(rightLowerArmId);
// };
// document.getElementById("slider6").onchange = function(event) {
// theta[leftUpperLegId] = event.target.value;
// initNodes(leftUpperLegId);
// };
// document.getElementById("slider7").onchange = function(event) {
// theta[leftLowerLegId] = event.target.value;
// initNodes(leftLowerLegId);
// };
// document.getElementById("slider8").onchange = function(event) {
// theta[rightUpperLegId] = event.target.value;
// initNodes(rightUpperLegId);
// };
// document.getElementById("slider9").onchange = function(event) {
// theta[rightLowerLegId] = event.target.value;
// initNodes(rightLowerLegId);
// };
// document.getElementById("slider10").onchange = function(event) {
// theta[head2Id] = event.target.value;
// initNodes(head2Id);
// };
document
.
getElementById
(
"
slider11
"
).
onchange
=
function
(
event
)
{
lightposVector
[
xAxis
]
=
event
.
target
.
value
;
...
...
@@ -816,6 +774,9 @@ function walk(){
if
(
animationState
<
18
||
animationState
>
26
)
return
;
var
pstate
=
[
0
,
0
,
0
];
const
parray
=
pstate
.
map
((
value
,
index
)
=>
value
+
directionVec
[
index
]
*
0.1
);
const
tstate1
=
[
90
,
0
,
210
,
-
60
,
210
,
-
60
,
210
,
-
60
,
210
,
-
60
,
-
60
,
150
,
0
,
0
,
0
];
const
tstate2
=
[
95
,
0
,
230
,
-
110
,
210
,
-
60
,
210
,
-
60
,
230
,
-
110
,
-
60
,
151
,
1
,
0
,
2
];
const
tstate3
=
[
100
,
0
,
190
,
-
70
,
230
,
-
60
,
230
,
-
60
,
190
,
-
70
,
-
60
,
149
,
-
1
,
0
,
0
];
...
...
@@ -838,6 +799,8 @@ function walk(){
const
tarray5
=
divideArrays
(
tstate6
,
tstate5
,
frame5
);
const
tarray6
=
divideArrays
(
tstate7
,
tstate6
,
frame6
);
posVec
=
updatepos
(
posVec
,
parray
);
if
(
animationState
===
18
)
{
({
theta
,
frameCount
}
=
updateTheta
(
theta
,
tarray1
,
frameCount
,
frame1
,
19
));
}
else
if
(
animationState
===
19
)
{
...
...
@@ -847,7 +810,7 @@ function walk(){
}
else
if
(
animationState
===
21
)
{
({
theta
,
frameCount
}
=
updateTheta
(
theta
,
tarray4
,
frameCount
,
frame4
,
22
));
}
else
if
(
animationState
===
22
)
{
if
(
walking
<
50
){
if
(
walking
<
16
){
({
theta
,
frameCount
}
=
updateTheta
(
theta
,
tarray5
,
frameCount
,
frame5
,
19
));
walking
++
;
}
else
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment