Final move due to size and piracy
3
.gitignore
vendored
|
@ -4,5 +4,4 @@ node_modules
|
|||
.gitattributes
|
||||
.well-known
|
||||
package-lock.json
|
||||
/views/archive/gfiles/rarch/roms
|
||||
/views/archive/g
|
||||
/views/archive/gfiles/rarch/roms
|
45
views/archive/dino/.gitignore
vendored
|
@ -1,45 +0,0 @@
|
|||
# Log file
|
||||
*.log
|
||||
|
||||
# Package Files #
|
||||
*.jar
|
||||
*.war
|
||||
*.ear
|
||||
*.zip
|
||||
*.tar.gz
|
||||
*.rar
|
||||
*.7z
|
||||
|
||||
# Windows thumbnail cache files
|
||||
Thumbs.db
|
||||
ehthumbs.db
|
||||
ehthumbs_vista.db
|
||||
|
||||
# Dump file
|
||||
*.stackdump
|
||||
|
||||
# Folder config file
|
||||
[Dd]esktop.ini
|
||||
|
||||
# Recycle Bin used on file shares
|
||||
$RECYCLE.BIN/
|
||||
|
||||
# Windows Installer files
|
||||
*.cab
|
||||
*.msi
|
||||
*.msix
|
||||
*.msm
|
||||
*.msp
|
||||
|
||||
# Windows shortcuts
|
||||
*.lnk
|
||||
|
||||
# macOS
|
||||
.DS_Store
|
||||
|
||||
# Visual Studio Code
|
||||
.vscode/*
|
||||
!.vscode/settings.json
|
||||
!.vscode/tasks.json
|
||||
!.vscode/launch.json
|
||||
!.vscode/extensions.json
|
|
@ -1,16 +0,0 @@
|
|||
# T-Rex Runner
|
||||
|
||||
T-Rex Runner is an Easter Egg in Google Chrome which appears when you suddenly lose internet access. [Here](https://www.blog.google/products/chrome/chrome-dino/) is the origin of this game.
|
||||
|
||||
The dino game is extracted from the Chromium [source code](https://cs.chromium.org/chromium/src/components/neterror/resources/offline.js) in commit `24d8c44`
|
||||
|
||||
## Controls
|
||||
|
||||
* Press the space bar to jump and to start the game
|
||||
* Use the down arrow key to duck
|
||||
|
||||
## How to play
|
||||
|
||||
You can click [here](https://congerh.github.io/dino/) to play online.
|
||||
|
||||
You can also play the origin Chrome dino game without turning off your network connections. Just open `chrome://dino` in your web browser, and you’ll be taken to an "arcade mode" where you can practice in a full-window environment.
|
|
@ -1,549 +0,0 @@
|
|||
/* Copyright 2017 The Chromium Authors. All rights reserved.
|
||||
* Use of this source code is governed by a BSD-style license that can be
|
||||
* found in the LICENSE file.
|
||||
* Extract source code from chromium by congerh. */
|
||||
|
||||
body {
|
||||
--google-blue-600: rgb(26, 115, 232);
|
||||
--google-blue-700: rgb(25, 103, 210);
|
||||
--google-gray-50: rgb(248, 249, 250);
|
||||
--google-gray-500: rgb(154, 160, 166);
|
||||
--google-gray-600: rgb(128, 134, 139);
|
||||
--google-gray-700: rgb(95, 99, 105);
|
||||
background-color: #fff;
|
||||
color: var(--google-gray-700);
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
html {
|
||||
-webkit-text-size-adjust: 100%;
|
||||
font-size: 125%;
|
||||
}
|
||||
|
||||
.icon {
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100%;
|
||||
}
|
||||
|
||||
/* Copyright 2014 The Chromium Authors. All rights reserved.
|
||||
* Use of this source code is governed by a BSD-style license that can be
|
||||
* found in the LICENSE file. */
|
||||
|
||||
.bad-clock button,
|
||||
.captive-portal button,
|
||||
.main-frame-blocked button,
|
||||
.neterror button,
|
||||
.offline button,
|
||||
.pdf button,
|
||||
.ssl button,
|
||||
.safe-browsing-billing button {
|
||||
background: var(--google-blue-600);
|
||||
}
|
||||
|
||||
.error-code {
|
||||
color: #646464;
|
||||
font-size: .86667em;
|
||||
text-transform: uppercase;
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: var(--google-gray-900);
|
||||
font-size: 1.6em;
|
||||
font-weight: normal;
|
||||
line-height: 1.25em;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 1.2em;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.icon {
|
||||
height: 72px;
|
||||
margin: 0 0 40px;
|
||||
width: 72px;
|
||||
}
|
||||
|
||||
.interstitial-wrapper {
|
||||
box-sizing: border-box;
|
||||
font-size: 1em;
|
||||
line-height: 1.6em;
|
||||
margin: 14vh auto 0;
|
||||
max-width: 600px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#main-message > p {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
@media (max-width: 700px) {
|
||||
.interstitial-wrapper {
|
||||
padding: 0 10%;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 420px) {
|
||||
.interstitial-wrapper {
|
||||
padding: 0 5%;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Mobile specific styling.
|
||||
* Navigation buttons are anchored to the bottom of the screen.
|
||||
* Details message replaces the top content in its own scrollable area.
|
||||
*/
|
||||
|
||||
/* Fixed nav. */
|
||||
@media (min-width: 240px) and (max-width: 420px) and (min-height: 401px),
|
||||
(min-width: 421px) and (min-height: 240px) and (max-height: 560px) {
|
||||
body .nav-wrapper {
|
||||
background: #fff;
|
||||
bottom: 0;
|
||||
box-shadow: 0 -22px 40px #fff;
|
||||
left: 0;
|
||||
margin: 0 auto;
|
||||
max-width: 736px;
|
||||
padding-left: 24px;
|
||||
padding-right: 24px;
|
||||
position: fixed;
|
||||
right: 0;
|
||||
width: 100%;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.interstitial-wrapper {
|
||||
max-width: 736px;
|
||||
}
|
||||
|
||||
#details,
|
||||
#main-content {
|
||||
padding-bottom: 40px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 420px) and (orientation: portrait),
|
||||
(max-height: 560px) {
|
||||
body {
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
#details.hidden,
|
||||
#main-content.hidden {
|
||||
display: block;
|
||||
height: 0;
|
||||
opacity: 0;
|
||||
overflow: hidden;
|
||||
padding-bottom: 0;
|
||||
transition: none;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 1.5em;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.icon {
|
||||
margin-bottom: 5.69vh;
|
||||
}
|
||||
|
||||
.interstitial-wrapper {
|
||||
box-sizing: border-box;
|
||||
margin: 7vh auto 12px;
|
||||
padding: 0 24px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.interstitial-wrapper p {
|
||||
font-size: .95em;
|
||||
line-height: 1.61em;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
#main-content {
|
||||
margin: 0;
|
||||
transition: opacity 100ms cubic-bezier(0.4, 0, 0.2, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 421px) and (min-height: 500px) and (max-height: 560px) {
|
||||
.interstitial-wrapper {
|
||||
margin-top: 10vh;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-height: 400px) and (orientation:portrait) {
|
||||
.interstitial-wrapper {
|
||||
margin-bottom: 145px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@media (min-height: 500px) and (max-height: 650px) and (max-width: 414px) and
|
||||
(orientation: portrait) {
|
||||
.interstitial-wrapper {
|
||||
margin-top: 7vh;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-height: 650px) and (max-width: 414px) and (orientation: portrait) {
|
||||
.interstitial-wrapper {
|
||||
margin-top: 10vh;
|
||||
}
|
||||
}
|
||||
|
||||
/* Small mobile screens. No fixed nav. */
|
||||
@media (max-height: 400px) and (orientation: portrait),
|
||||
(max-height: 239px) and (orientation: landscape),
|
||||
(max-width: 419px) and (max-height: 399px) {
|
||||
.interstitial-wrapper {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
#main-content {
|
||||
flex: 1 1 auto;
|
||||
order: 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Copyright 2013 The Chromium Authors. All rights reserved.
|
||||
* Use of this source code is governed by a BSD-style license that can be
|
||||
* found in the LICENSE file. */
|
||||
|
||||
/* Don't use the main frame div when the error is in a subframe. */
|
||||
html[subframe] #main-frame-error {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Don't use the subframe error div when the error is in a main frame. */
|
||||
html:not([subframe]) #sub-frame-error {
|
||||
display: none;
|
||||
}
|
||||
|
||||
h1 {
|
||||
margin-top: 0;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
h1 span {
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
h2 {
|
||||
color: #666;
|
||||
font-size: 1.2em;
|
||||
font-weight: normal;
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
||||
a {
|
||||
color: rgb(17, 85, 204);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.icon {
|
||||
-webkit-user-select: none;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.icon-offline {
|
||||
content: -webkit-image-set(
|
||||
url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABIAQMAAABvIyEEAAAABlBMVEUAAABTU1OoaSf/AAAAAXRSTlMAQObYZgAAAGxJREFUeF7tyMEJwkAQRuFf5ipMKxYQiJ3Z2nSwrWwBA0+DQZcdxEOueaePp9+dQZFB7GpUcURSVU66yVNFj6LFICatThZB6r/ko/pbRpUgilY0Cbw5sNmb9txGXUKyuH7eV25x39DtJXUNPQGJtWFV+BT/QAAAAABJRU5ErkJggg==) 1x,
|
||||
url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQBAMAAAAVaP+LAAAAGFBMVEUAAABTU1NNTU1TU1NPT09SUlJSUlJTU1O8B7DEAAAAB3RSTlMAoArVKvVgBuEdKgAAAJ1JREFUeF7t1TEOwyAMQNG0Q6/UE+RMXD9d/tC6womIFSL9P+MnAYOXeTIzMzMzMzMzaz8J9Ri6HoITmuHXhISE8nEh9yxDh55aCEUoTGbbQwjqHwIkRAEiIaG0+0AA9VBMaE89Rogeoww936MQrWdBr4GN/z0IAdQ6nQ/FIpRXDwHcA+JIJcQowQAlFUA0MfQpXLlVQfkzR4igS6ENjknm/wiaGhsAAAAASUVORK5CYII=) 2x);
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.icon-disabled {
|
||||
content: -webkit-image-set(
|
||||
url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHAAAABICAMAAAAZF4G5AAAABlBMVEVMaXFTU1OXUj8tAAAAAXRSTlMAQObYZgAAASZJREFUeAHd11Fq7jAMRGGf/W/6PoWB67YMqv5DybwG/CFjRuR8JBw3+ByiRjgV9W/TJ31P0tBfC6+cj1haUFXKHmVJo5wP98WwQ0ZCbfUc6LQ6VuUBz31ikADkLMkDrfUC4rR6QGW+gF6rx7NaHWCj1Y/W6lf4L7utvgBSt3rBFSS/XBMPUILcJINHCBWYUfpWn4NBi1ZfudIc3rf6/NGEvEA+AsYTJozmXemjXeLZAov+mnkN2HfzXpMSVQDnGw++57qNJ4D1xitA2sJ+VAWMygSEaYf2mYPTjZfk2K8wmP7HLIH5Mg4/pP+PEcDzUvDMvYbs/2NWwPO5vBdMZE4EE5UTQLiBFDaUlTDPBRoJ9HdAYIkIo06og3BNXtCzy7zA1aXk5x+tJARq63eAygAAAABJRU5ErkJggg==) 1x,
|
||||
url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOAAAACQAQMAAAArwfVjAAAABlBMVEVMaXFTU1OXUj8tAAAAAXRSTlMAQObYZgAAAYdJREFUeF7F1EFqwzAUBNARAmVj0FZe5QoBH6BX+dn4GlY2PYNzGx/A0CvkCIJuvIraKJKbgBvzf2g62weDGD7CYggpfFReis4J0ey9EGFIiEQQojFSlA9kSIiqd0KkFjKsewgRbStEN19mxUPTtmW9HQ/h6tyqNQ8NlSMZdzyE6qkoE0trVYGFm0n1WYeBhduzwbwBC7voS+vIxfeMjeaiLxsMMtQNwMPtuew+DjzcTHk8YMfDknEcIUOtf2lVfgVH3K4Xv5PRYAXRVMtItIJ3rfaCIVn9DsTH2NxisAVRex2Hh3hX+/mRUR08bAwPEYsI51ZxWH4Q0SpicQRXeyEaIug48FEdegARfMz/tADVsRciwTAxW308ehmC2gLraC+YCbV3QoTZexa+zegAEW5PhhgYfmbvJgcRqngGByOSXdFJcLk2JeDPEN0kxe1JhIt5FiFA+w+ItMELsUyPF2IaJ4aILqb4FbxPwhImwj6JauKgDUCYaxmYIsd4KXdMjIC9ItB5Bn4BNRwsG0XM2nwAAAAASUVORK5CYII=) 2x);
|
||||
width: 112px;
|
||||
}
|
||||
|
||||
.error-code {
|
||||
display: block;
|
||||
font-size: .8em;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#suggestions-list p {
|
||||
margin-block-end: 0;
|
||||
}
|
||||
|
||||
#suggestions-list ul {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.snackbar {
|
||||
background: #323232;
|
||||
border-radius: 2px;
|
||||
bottom: 24px;
|
||||
box-sizing: border-box;
|
||||
color: #fff;
|
||||
font-size: .87em;
|
||||
left: 24px;
|
||||
max-width: 568px;
|
||||
min-width: 288px;
|
||||
opacity: 0;
|
||||
padding: 16px 24px 12px;
|
||||
position: fixed;
|
||||
transform: translateY(90px);
|
||||
will-change: opacity, transform;
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
.snackbar-show {
|
||||
-webkit-animation:
|
||||
show-snackbar .25s cubic-bezier(0.0, 0.0, 0.2, 1) forwards,
|
||||
hide-snackbar .25s cubic-bezier(0.4, 0.0, 1, 1) forwards 5s;
|
||||
}
|
||||
|
||||
@-webkit-keyframes show-snackbar {
|
||||
100% {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
@-webkit-keyframes hide-snackbar {
|
||||
0% {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
100% {
|
||||
opacity: 0;
|
||||
transform: translateY(90px);
|
||||
}
|
||||
}
|
||||
|
||||
/* Decrease padding at low sizes. */
|
||||
@media (max-width: 640px), (max-height: 640px) {
|
||||
h1 {
|
||||
margin: 0 0 15px;
|
||||
}
|
||||
#content-top {
|
||||
margin: 15px;
|
||||
}
|
||||
}
|
||||
|
||||
/* Don't allow overflow when in a subframe. */
|
||||
html[subframe] body {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#sub-frame-error {
|
||||
-webkit-align-items: center;
|
||||
background-color: #DDD;
|
||||
display: -webkit-flex;
|
||||
-webkit-flex-flow: column;
|
||||
height: 100%;
|
||||
-webkit-justify-content: center;
|
||||
left: 0;
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
top: 0;
|
||||
transition: background-color .2s ease-in-out;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#sub-frame-error:hover {
|
||||
background-color: #EEE;
|
||||
}
|
||||
|
||||
#sub-frame-error .icon-generic {
|
||||
margin: 0 0 16px;
|
||||
}
|
||||
|
||||
#sub-frame-error-details {
|
||||
margin: 0 10px;
|
||||
text-align: center;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
/* Show details only when hovering. */
|
||||
#sub-frame-error:hover #sub-frame-error-details {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
/* If the iframe is too small, always hide the error code. */
|
||||
/* TODO(mmenke): See if overflow: no-display works better, once supported. */
|
||||
@media (max-width: 200px), (max-height: 95px) {
|
||||
#sub-frame-error-details {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* Adjust icon for small embedded frames in apps. */
|
||||
@media (max-height: 100px) {
|
||||
#sub-frame-error .icon-generic {
|
||||
height: auto;
|
||||
margin: 0;
|
||||
padding-top: 0;
|
||||
width: 25px;
|
||||
}
|
||||
}
|
||||
|
||||
/* Offline page */
|
||||
.offline {
|
||||
transition: -webkit-filter 1.5s cubic-bezier(0.65, 0.05, 0.36, 1),
|
||||
background-color 1.5s cubic-bezier(0.65, 0.05, 0.36, 1);
|
||||
will-change: -webkit-filter, background-color;
|
||||
}
|
||||
|
||||
.offline #main-message > p {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.offline.inverted {
|
||||
-webkit-filter: invert(100%);
|
||||
background-color: #000;
|
||||
}
|
||||
|
||||
.offline .interstitial-wrapper {
|
||||
color: #2b2b2b;
|
||||
font-size: 1em;
|
||||
line-height: 1.55;
|
||||
margin: 0 auto;
|
||||
max-width: 600px;
|
||||
padding-top: 100px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.offline .runner-container {
|
||||
direction: ltr;
|
||||
height: 150px;
|
||||
max-width: 600px;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
top: 35px;
|
||||
width: 44px;
|
||||
}
|
||||
|
||||
.offline .runner-canvas {
|
||||
height: 150px;
|
||||
max-width: 600px;
|
||||
opacity: 1;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.offline .controller {
|
||||
background: rgba(247,247,247, .1);
|
||||
height: 100vh;
|
||||
left: 0;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
width: 100vw;
|
||||
z-index: 9;
|
||||
}
|
||||
|
||||
#offline-resources {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@media (max-width: 420px) {
|
||||
.snackbar {
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
border-radius: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-height: 350px) {
|
||||
h1 {
|
||||
margin: 0 0 15px;
|
||||
}
|
||||
|
||||
.icon-offline {
|
||||
margin: 0 0 10px;
|
||||
}
|
||||
|
||||
.interstitial-wrapper {
|
||||
margin-top: 5%;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 420px) and (max-width: 736px) and
|
||||
(min-height: 240px) and (max-height: 420px) and
|
||||
(orientation:landscape) {
|
||||
.interstitial-wrapper {
|
||||
margin-bottom: 100px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 360px) and (max-height: 480px) {
|
||||
.offline .interstitial-wrapper {
|
||||
padding-top: 60px;
|
||||
}
|
||||
|
||||
.offline .runner-container {
|
||||
top: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-height: 240px) and (orientation: landscape) {
|
||||
.offline .interstitial-wrapper {
|
||||
margin-bottom: 90px;
|
||||
}
|
||||
|
||||
.icon-offline {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-height: 320px) and (orientation: landscape) {
|
||||
.icon-offline {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.offline .runner-container {
|
||||
top: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 240px) {
|
||||
.interstitial-wrapper {
|
||||
overflow: inherit;
|
||||
padding: 0 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.arcade-mode,
|
||||
.arcade-mode .runner-container,
|
||||
.arcade-mode .runner-canvas {
|
||||
image-rendering: pixelated;
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.arcade-mode #buttons,
|
||||
.arcade-mode #main-content {
|
||||
opacity: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.arcade-mode .interstitial-wrapper {
|
||||
height: 100vh;
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.arcade-mode .runner-container {
|
||||
left: 0;
|
||||
margin: auto;
|
||||
right: 0;
|
||||
transform-origin: top center;
|
||||
transition: transform 250ms cubic-bezier(0.4, 0.0, 1, 1) .4s;
|
||||
z-index: 2;
|
||||
}
|
2
views/archive/dino/dino.min.css
vendored
65
views/archive/dino/dino.min.js
vendored
|
@ -1,65 +0,0 @@
|
|||
/*! Copyright (c) 2014 The Chromium Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. Extract source code from chromium by congerh. */
|
||||
(function(){function c(a,b){if(c.instance_)return c.instance_;c.instance_=this;this.outerContainerEl=document.querySelector(a);this.touchController=this.snackbarEl=this.containerEl=null;this.config=b||c.config;this.dimensions=c.defaultDimensions;this.distanceMeter=this.tRex=this.canvasCtx=this.canvas=null;this.runningTime=this.time=this.highestScore=this.distanceRan=0;this.msPerFrame=1E3/60;this.currentSpeed=this.config.SPEED;this.obstacles=[];this.inverted=this.paused=this.crashed=this.playing=this.activated=
|
||||
!1;this.invertTimer=0;this.resizeTimerId_=null;this.playCount=0;this.audioBuffer=null;this.soundFx={};this.audioContext=null;this.images={};this.imagesLoaded=0;this.isDisabled()?this.setupDisabledRunner():this.loadImages()}function q(a,b){return Math.floor(Math.random()*(b-a+1))+a}function B(a){var b=a.length/4*3;a=atob(a);var d=new ArrayBuffer(b);d=new Uint8Array(d);for(var c=0;c<b;c++)d[c]=a.charCodeAt(c);return d.buffer}function r(){return w?(new Date).getTime():performance.now()}function u(a,
|
||||
b,d,c){this.canvas=a;this.canvasCtx=a.getContext("2d");this.canvasDimensions=c;this.textImgPos=b;this.restartImgPos=d;this.draw()}function z(a,b){return new g(a.x+b.x,a.y+b.y,a.width,a.height)}function A(a,b){var d=!1,c=b.x;a.x<c+b.width&&a.x+a.width>c&&a.y<b.y+b.height&&a.height+a.y>b.y&&(d=!0);return d}function g(a,b,d,c){this.x=a;this.y=b;this.width=d;this.height=c}function m(a,b,d,c,n,f,e){this.canvasCtx=a;this.spritePos=d;this.typeConfig=b;this.gapCoefficient=n;this.size=q(1,m.MAX_OBSTACLE_LENGTH);
|
||||
this.dimensions=c;this.remove=!1;this.xPos=c.WIDTH+(e||0);this.width=this.yPos=0;this.collisionBoxes=[];this.timer=this.currentFrame=this.speedOffset=this.gap=0;this.init(f)}function f(a,b){this.canvas=a;this.canvasCtx=a.getContext("2d");this.spritePos=b;this.currentFrame=this.groundYPos=this.yPos=this.xPos=0;this.currentAnimFrames=[];this.timer=this.animStartTime=this.blinkCount=this.blinkDelay=0;this.msPerFrame=1E3/60;this.config=f.config;this.status=f.status.WAITING;this.ducking=this.jumping=!1;
|
||||
this.jumpVelocity=0;this.speedDrop=this.reachedMinHeight=!1;this.jumpspotX=this.jumpCount=0;this.init()}function h(a,b,d){this.canvas=a;this.canvasCtx=a.getContext("2d");this.image=c.imageSprite;this.spritePos=b;this.x=0;this.y=5;this.highScore=this.maxScore=this.currentDistance=0;this.container=null;this.digits=[];this.achievement=!1;this.defaultString="";this.flashIterations=this.flashTimer=0;this.invertTrigger=!1;this.config=h.config;this.maxScoreUnits=this.config.MAX_DISTANCE_UNITS;this.init(d)}
|
||||
function p(a,b,d){this.canvas=a;this.canvasCtx=this.canvas.getContext("2d");this.spritePos=b;this.xPos=this.containerWidth=d;this.yPos=0;this.remove=!1;this.cloudGap=q(p.config.MIN_CLOUD_GAP,p.config.MAX_CLOUD_GAP);this.init()}function e(a,b,d){this.spritePos=b;this.canvas=a;this.canvasCtx=a.getContext("2d");this.xPos=d-50;this.yPos=30;this.opacity=this.currentPhase=0;this.containerWidth=d;this.stars=[];this.drawStars=!1;this.placeStars()}function k(a,b){this.spritePos=b;this.canvas=a;this.canvasCtx=
|
||||
a.getContext("2d");this.sourceDimensions={};this.dimensions=k.dimensions;this.sourceXPos=[this.spritePos.x,this.spritePos.x+this.dimensions.WIDTH];this.xPos=[];this.yPos=0;this.bumpThreshold=.5;this.setSourceDimensions();this.draw()}function v(a,b,d,c){this.canvas=a;this.canvasCtx=this.canvas.getContext("2d");this.config=v.config;this.dimensions=d;this.gapCoefficient=c;this.obstacles=[];this.obstacleHistory=[];this.horizonOffsets=[0,0];this.cloudFrequency=this.config.CLOUD_FREQUENCY;this.spritePos=
|
||||
b;this.nightMode=null;this.clouds=[];this.cloudSpeed=this.config.BG_CLOUD_SPEED;this.horizonLine=null;this.init()}window.Runner=c;var t=1<window.devicePixelRatio,w=/iPad|iPhone|iPod/.test(window.navigator.platform),y=/Android/.test(window.navigator.userAgent)||w;c.config={ACCELERATION:.001,BG_CLOUD_SPEED:.2,BOTTOM_PAD:10,CANVAS_IN_VIEW_OFFSET:-10,CLEAR_TIME:3E3,CLOUD_FREQUENCY:.5,GAMEOVER_CLEAR_TIME:750,GAP_COEFFICIENT:.6,GRAVITY:.6,INITIAL_JUMP_VELOCITY:12,INVERT_FADE_DURATION:12E3,INVERT_DISTANCE:700,
|
||||
MAX_BLINK_COUNT:3,MAX_CLOUDS:6,MAX_OBSTACLE_LENGTH:3,MAX_OBSTACLE_DUPLICATION:2,MAX_SPEED:13,MIN_JUMP_HEIGHT:35,MOBILE_SPEED_COEFFICIENT:1.2,RESOURCE_TEMPLATE_ID:"audio-resources",SPEED:6,SPEED_DROP_COEFFICIENT:3,ARCADE_MODE_INITIAL_TOP_POSITION:35,ARCADE_MODE_TOP_POSITION_PERCENT:.1};c.defaultDimensions={WIDTH:600,HEIGHT:150};c.classes={ARCADE_MODE:"arcade-mode",CANVAS:"runner-canvas",CONTAINER:"runner-container",CRASHED:"crashed",ICON:"icon-offline",INVERTED:"inverted",SNACKBAR:"snackbar",SNACKBAR_SHOW:"snackbar-show",
|
||||
TOUCH_CONTROLLER:"controller"};c.spriteDefinition={LDPI:{CACTUS_LARGE:{x:332,y:2},CACTUS_SMALL:{x:228,y:2},CLOUD:{x:86,y:2},HORIZON:{x:2,y:54},MOON:{x:484,y:2},PTERODACTYL:{x:134,y:2},RESTART:{x:2,y:2},TEXT_SPRITE:{x:655,y:2},TREX:{x:848,y:2},STAR:{x:645,y:2}},HDPI:{CACTUS_LARGE:{x:652,y:2},CACTUS_SMALL:{x:446,y:2},CLOUD:{x:166,y:2},HORIZON:{x:2,y:104},MOON:{x:954,y:2},PTERODACTYL:{x:260,y:2},RESTART:{x:2,y:2},TEXT_SPRITE:{x:1294,y:2},TREX:{x:1678,y:2},STAR:{x:1276,y:2}}};c.sounds={BUTTON_PRESS:"offline-sound-press",
|
||||
HIT:"offline-sound-hit",SCORE:"offline-sound-reached"};c.keycodes={JUMP:{38:1,32:1},DUCK:{40:1},RESTART:{13:1}};c.events={ANIM_END:"webkitAnimationEnd",CLICK:"click",KEYDOWN:"keydown",KEYUP:"keyup",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",RESIZE:"resize",TOUCHEND:"touchend",TOUCHSTART:"touchstart",VISIBILITY:"visibilitychange",BLUR:"blur",FOCUS:"focus",LOAD:"load"};c.prototype={isDisabled:function(){return!1},setupDisabledRunner:function(){this.containerEl=document.createElement("div");this.containerEl.className=
|
||||
c.classes.SNACKBAR;this.containerEl.textContent=loadTimeData.getValue("disabledEasterEgg");this.outerContainerEl.appendChild(this.containerEl);document.addEventListener(c.events.KEYDOWN,function(a){c.keycodes.JUMP[a.keyCode]&&(this.containerEl.classList.add(c.classes.SNACKBAR_SHOW),document.querySelector(".icon").classList.add("icon-disabled"))}.bind(this))},updateConfigSetting:function(a,b){if(a in this.config&&void 0!=b)switch(this.config[a]=b,a){case "GRAVITY":case "MIN_JUMP_HEIGHT":case "SPEED_DROP_COEFFICIENT":this.tRex.config[a]=
|
||||
b;break;case "INITIAL_JUMP_VELOCITY":this.tRex.setJumpVelocity(b);break;case "SPEED":this.setSpeed(b)}},loadImages:function(){t?(c.imageSprite=document.getElementById("offline-resources-2x"),this.spriteDef=c.spriteDefinition.HDPI):(c.imageSprite=document.getElementById("offline-resources-1x"),this.spriteDef=c.spriteDefinition.LDPI);c.imageSprite.complete?this.init():c.imageSprite.addEventListener(c.events.LOAD,this.init.bind(this))},loadSounds:function(){if(!w){this.audioContext=new AudioContext;
|
||||
var a=document.getElementById(this.config.RESOURCE_TEMPLATE_ID).content,b;for(b in c.sounds){var d=a.getElementById(c.sounds[b]).src;d=d.substr(d.indexOf(",")+1);d=B(d);this.audioContext.decodeAudioData(d,function(a,b){this.soundFx[a]=b}.bind(this,b))}}},setSpeed:function(a){var b=a||this.currentSpeed;600>this.dimensions.WIDTH?(a=b*this.dimensions.WIDTH/600*this.config.MOBILE_SPEED_COEFFICIENT,this.currentSpeed=a>b?b:a):a&&(this.currentSpeed=a)},init:function(){document.querySelector("."+c.classes.ICON).style.visibility=
|
||||
"hidden";this.adjustDimensions();this.setSpeed();this.containerEl=document.createElement("div");this.containerEl.className=c.classes.CONTAINER;var a=this.containerEl,b=this.dimensions.WIDTH,d=this.dimensions.HEIGHT,l=c.classes.PLAYER,n=document.createElement("canvas");n.className=l?c.classes.CANVAS+" "+l:c.classes.CANVAS;n.width=b;n.height=d;a.appendChild(n);this.canvas=n;this.canvasCtx=this.canvas.getContext("2d");this.canvasCtx.fillStyle="#f7f7f7";this.canvasCtx.fill();c.updateCanvasScaling(this.canvas);
|
||||
this.horizon=new v(this.canvas,this.spriteDef,this.dimensions,this.config.GAP_COEFFICIENT);this.distanceMeter=new h(this.canvas,this.spriteDef.TEXT_SPRITE,this.dimensions.WIDTH);this.tRex=new f(this.canvas,this.spriteDef.TREX);this.outerContainerEl.appendChild(this.containerEl);this.startListening();this.update();window.addEventListener(c.events.RESIZE,this.debounceResize.bind(this))},createTouchController:function(){this.touchController=document.createElement("div");this.touchController.className=
|
||||
c.classes.TOUCH_CONTROLLER;this.touchController.addEventListener(c.events.TOUCHSTART,this);this.touchController.addEventListener(c.events.TOUCHEND,this);this.outerContainerEl.appendChild(this.touchController)},debounceResize:function(){this.resizeTimerId_||(this.resizeTimerId_=setInterval(this.adjustDimensions.bind(this),250))},adjustDimensions:function(){clearInterval(this.resizeTimerId_);this.resizeTimerId_=null;var a=window.getComputedStyle(this.outerContainerEl);a=Number(a.paddingLeft.substr(0,
|
||||
a.paddingLeft.length-2));this.dimensions.WIDTH=this.outerContainerEl.offsetWidth-2*a;this.isArcadeMode()&&(this.dimensions.WIDTH=Math.min(600,this.dimensions.WIDTH),this.activated&&this.setArcadeModeContainerScale());this.canvas&&(this.canvas.width=this.dimensions.WIDTH,this.canvas.height=this.dimensions.HEIGHT,c.updateCanvasScaling(this.canvas),this.distanceMeter.calcXPos(this.dimensions.WIDTH),this.clearCanvas(),this.horizon.update(0,0,!0),this.tRex.update(0),this.playing||this.crashed||this.paused?
|
||||
(this.containerEl.style.width=this.dimensions.WIDTH+"px",this.containerEl.style.height=this.dimensions.HEIGHT+"px",this.distanceMeter.update(0,Math.ceil(this.distanceRan)),this.stop()):this.tRex.draw(0,0),this.crashed&&this.gameOverPanel&&(this.gameOverPanel.updateDimensions(this.dimensions.WIDTH),this.gameOverPanel.draw()))},playIntro:function(){this.activated||this.crashed?this.crashed&&this.restart():(this.playingIntro=!0,this.tRex.playingIntro=!0,document.styleSheets[0].insertRule("@-webkit-keyframes intro { from { width:"+
|
||||
f.config.WIDTH+"px }to { width: "+this.dimensions.WIDTH+"px }}",0),this.containerEl.addEventListener(c.events.ANIM_END,this.startGame.bind(this)),this.containerEl.style.webkitAnimation="intro .4s ease-out 1 both",this.containerEl.style.width=this.dimensions.WIDTH+"px",this.setPlayStatus(!0),this.activated=!0)},startGame:function(){this.isArcadeMode()&&this.setArcadeMode();this.runningTime=0;this.playingIntro=!1;this.tRex.playingIntro=!1;this.containerEl.style.webkitAnimation="";this.playCount++;document.addEventListener(c.events.VISIBILITY,
|
||||
this.onVisibilityChange.bind(this));window.addEventListener(c.events.BLUR,this.onVisibilityChange.bind(this));window.addEventListener(c.events.FOCUS,this.onVisibilityChange.bind(this))},clearCanvas:function(){this.canvasCtx.clearRect(0,0,this.dimensions.WIDTH,this.dimensions.HEIGHT)},isCanvasInView:function(){return this.containerEl.getBoundingClientRect().top>c.config.CANVAS_IN_VIEW_OFFSET},update:function(){this.updatePending=!1;var a=r(),b=a-(this.time||a);this.time=a;if(this.playing){this.clearCanvas();
|
||||
this.tRex.jumping&&this.tRex.updateJump(b);this.runningTime+=b;a=this.runningTime>this.config.CLEAR_TIME;1!=this.tRex.jumpCount||this.playingIntro||this.playIntro();this.playingIntro?this.horizon.update(0,this.currentSpeed,a):(b=this.activated?b:0,this.horizon.update(b,this.currentSpeed,a,this.inverted));if(a)a:{var d=this.horizon.obstacles[0],l=this.tRex;a=new g(l.xPos+1,l.yPos+1,l.config.WIDTH-2,l.config.HEIGHT-2);var n=new g(d.xPos+1,d.yPos+1,d.typeConfig.width*d.size-2,d.typeConfig.height-2);
|
||||
if(A(a,n)){d=d.collisionBoxes;l=l.ducking?f.collisionBoxes.DUCKING:f.collisionBoxes.RUNNING;for(var e=0;e<l.length;e++)for(var x=0;x<d.length;x++){var h=z(l[e],a),k=z(d[x],n);if(A(h,k)){a=[h,k];break a}}}a=!1}a?this.gameOver():(this.distanceRan+=this.currentSpeed*b/this.msPerFrame,this.currentSpeed<this.config.MAX_SPEED&&(this.currentSpeed+=this.config.ACCELERATION));this.distanceMeter.update(b,Math.ceil(this.distanceRan))&&this.playSound(this.soundFx.SCORE);this.invertTimer>this.config.INVERT_FADE_DURATION?
|
||||
(this.invertTimer=0,this.invertTrigger=!1,this.invert()):this.invertTimer?this.invertTimer+=b:(a=this.distanceMeter.getActualDistance(Math.ceil(this.distanceRan)),0<a&&(this.invertTrigger=!(a%this.config.INVERT_DISTANCE))&&0===this.invertTimer&&(this.invertTimer+=b,this.invert()))}if(this.playing||!this.activated&&this.tRex.blinkCount<c.config.MAX_BLINK_COUNT)this.tRex.update(b),this.scheduleNextUpdate()},handleEvent:function(a){var b=c.events;switch(a.type){case b.KEYDOWN:case b.TOUCHSTART:case b.POINTERDOWN:this.onKeyDown(a);
|
||||
break;case b.KEYUP:case b.TOUCHEND:case b.POINTERUP:this.onKeyUp(a)}},startListening:function(){document.addEventListener(c.events.KEYDOWN,this);document.addEventListener(c.events.KEYUP,this);this.containerEl.addEventListener(c.events.TOUCHSTART,this);document.addEventListener(c.events.POINTERDOWN,this);document.addEventListener(c.events.POINTERUP,this)},stopListening:function(){document.removeEventListener(c.events.KEYDOWN,this);document.removeEventListener(c.events.KEYUP,this);this.touchController&&
|
||||
(this.touchController.removeEventListener(c.events.TOUCHSTART,this),this.touchController.removeEventListener(c.events.TOUCHEND,this));this.containerEl.removeEventListener(c.events.TOUCHSTART,this);document.removeEventListener(c.events.POINTERDOWN,this);document.removeEventListener(c.events.POINTERUP,this)},onKeyDown:function(a){y&&this.playing&&a.preventDefault();this.isCanvasInView()&&(this.crashed||this.paused?this.crashed&&a.type==c.events.TOUCHSTART&&a.currentTarget==this.containerEl&&this.restart():
|
||||
c.keycodes.JUMP[a.keyCode]||a.type==c.events.TOUCHSTART?(a.preventDefault(),this.playing||(this.touchController||a.type!=c.events.TOUCHSTART||this.createTouchController(),this.loadSounds(),this.setPlayStatus(!0),this.update(),window.errorPageController&&errorPageController.trackEasterEgg()),this.tRex.jumping||this.tRex.ducking||(this.playSound(this.soundFx.BUTTON_PRESS),this.tRex.startJump(this.currentSpeed))):this.playing&&c.keycodes.DUCK[a.keyCode]&&(a.preventDefault(),this.tRex.jumping?this.tRex.setSpeedDrop():
|
||||
this.tRex.jumping||this.tRex.ducking||this.tRex.setDuck(!0)))},onKeyUp:function(a){var b=String(a.keyCode),d=c.keycodes.JUMP[b]||a.type==c.events.TOUCHEND||a.type==c.events.POINTERUP;this.isRunning()&&d?this.tRex.endJump():c.keycodes.DUCK[b]?(this.tRex.speedDrop=!1,this.tRex.setDuck(!1)):this.crashed?(d=r()-this.time,this.isCanvasInView()&&(c.keycodes.RESTART[b]||this.isLeftClickOnCanvas(a)||d>=this.config.GAMEOVER_CLEAR_TIME&&c.keycodes.JUMP[b])&&this.restart()):this.paused&&d&&(this.tRex.reset(),
|
||||
this.play())},isLeftClickOnCanvas:function(a){return null!=a.button&&2>a.button&&a.type==c.events.POINTERUP&&a.target==this.canvas},scheduleNextUpdate:function(){this.updatePending||(this.updatePending=!0,this.raqId=requestAnimationFrame(this.update.bind(this)))},isRunning:function(){return!!this.raqId},gameOver:function(){this.playSound(this.soundFx.HIT);y&&window.navigator.vibrate&&window.navigator.vibrate(200);this.stop();this.crashed=!0;this.distanceMeter.achievement=!1;this.tRex.update(100,f.status.CRASHED);
|
||||
this.gameOverPanel?this.gameOverPanel.draw():this.gameOverPanel=new u(this.canvas,this.spriteDef.TEXT_SPRITE,this.spriteDef.RESTART,this.dimensions);this.distanceRan>this.highestScore&&(this.highestScore=Math.ceil(this.distanceRan),this.distanceMeter.setHighScore(this.highestScore));this.time=r()},stop:function(){this.setPlayStatus(!1);this.paused=!0;cancelAnimationFrame(this.raqId);this.raqId=0},play:function(){this.crashed||(this.setPlayStatus(!0),this.paused=!1,this.tRex.update(0,f.status.RUNNING),
|
||||
this.time=r(),this.update())},restart:function(){this.raqId||(this.playCount++,this.runningTime=0,this.setPlayStatus(!0),this.crashed=this.paused=!1,this.distanceRan=0,this.setSpeed(this.config.SPEED),this.time=r(),this.containerEl.classList.remove(c.classes.CRASHED),this.clearCanvas(),this.distanceMeter.reset(this.highestScore),this.horizon.reset(),this.tRex.reset(),this.playSound(this.soundFx.BUTTON_PRESS),this.invert(!0),this.bdayFlashTimer=null,this.update())},setPlayStatus:function(a){this.touchController&&
|
||||
this.touchController.classList.toggle(HIDDEN_CLASS,!a);this.playing=a},isArcadeMode:function(){return"chrome://dino/"==document.title},setArcadeMode:function(){document.body.classList.add(c.classes.ARCADE_MODE);this.setArcadeModeContainerScale()},setArcadeModeContainerScale:function(){var a=window.innerHeight,b=Math.max(1,Math.min(a/this.dimensions.HEIGHT,window.innerWidth/this.dimensions.WIDTH));this.containerEl.style.transform="scale("+b+") translateY("+Math.ceil(Math.max(0,(a-this.dimensions.HEIGHT*
|
||||
b-c.config.ARCADE_MODE_INITIAL_TOP_POSITION)*c.config.ARCADE_MODE_TOP_POSITION_PERCENT))*window.devicePixelRatio+"px)"},onVisibilityChange:function(a){document.hidden||document.webkitHidden||"blur"==a.type||"visible"!=document.visibilityState?this.stop():this.crashed||(this.tRex.reset(),this.play())},playSound:function(a){if(a){var b=this.audioContext.createBufferSource();b.buffer=a;b.connect(this.audioContext.destination);b.start(0)}},invert:function(a){a?(document.body.classList.toggle(c.classes.INVERTED,
|
||||
!1),this.invertTimer=0,this.inverted=!1):this.inverted=document.body.classList.toggle(c.classes.INVERTED,this.invertTrigger)}};c.updateCanvasScaling=function(a,b,d){var c=a.getContext("2d"),n=Math.floor(window.devicePixelRatio)||1,f=Math.floor(c.webkitBackingStorePixelRatio)||1,e=n/f;if(n!==f)return b=b||a.width,d=d||a.height,a.width=b*e,a.height=d*e,a.style.width=b+"px",a.style.height=d+"px",c.scale(e,e),!0;1==n&&(a.style.width=a.width+"px",a.style.height=a.height+"px");return!1};u.dimensions={TEXT_X:0,
|
||||
TEXT_Y:13,TEXT_WIDTH:191,TEXT_HEIGHT:11,RESTART_WIDTH:36,RESTART_HEIGHT:32};u.prototype={updateDimensions:function(a,b){this.canvasDimensions.WIDTH=a;b&&(this.canvasDimensions.HEIGHT=b)},draw:function(){var a=u.dimensions,b=this.canvasDimensions.WIDTH/2,d=a.TEXT_X,l=a.TEXT_Y,e=a.TEXT_WIDTH,f=a.TEXT_HEIGHT,g=Math.round(b-a.TEXT_WIDTH/2),h=Math.round((this.canvasDimensions.HEIGHT-25)/3),k=a.TEXT_WIDTH,p=a.TEXT_HEIGHT,m=a.RESTART_WIDTH,q=a.RESTART_HEIGHT;b-=a.RESTART_WIDTH/2;var r=this.canvasDimensions.HEIGHT/
|
||||
2;t&&(l*=2,d*=2,e*=2,f*=2,m*=2,q*=2);d+=this.textImgPos.x;l+=this.textImgPos.y;this.canvasCtx.drawImage(c.imageSprite,d,l,e,f,g,h,k,p);this.canvasCtx.drawImage(c.imageSprite,this.restartImgPos.x,this.restartImgPos.y,m,q,b,r,a.RESTART_WIDTH,a.RESTART_HEIGHT)}};m.MAX_GAP_COEFFICIENT=1.5;m.MAX_OBSTACLE_LENGTH=3;m.prototype={init:function(a){this.cloneCollisionBoxes();1<this.size&&this.typeConfig.multipleSpeed>a&&(this.size=1);this.width=this.typeConfig.width*this.size;if(Array.isArray(this.typeConfig.yPos)){var b=
|
||||
y?this.typeConfig.yPosMobile:this.typeConfig.yPos;this.yPos=b[q(0,b.length-1)]}else this.yPos=this.typeConfig.yPos;this.draw();1<this.size&&(this.collisionBoxes[1].width=this.width-this.collisionBoxes[0].width-this.collisionBoxes[2].width,this.collisionBoxes[2].x=this.width-this.collisionBoxes[2].width);this.typeConfig.speedOffset&&(this.speedOffset=.5<Math.random()?this.typeConfig.speedOffset:-this.typeConfig.speedOffset);this.gap=this.getGap(this.gapCoefficient,a)},draw:function(){var a=this.typeConfig.width,
|
||||
b=this.typeConfig.height;t&&(a*=2,b*=2);var d=a*this.size*.5*(this.size-1)+this.spritePos.x;0<this.currentFrame&&(d+=a*this.currentFrame);this.canvasCtx.drawImage(c.imageSprite,d,this.spritePos.y,a*this.size,b,this.xPos,this.yPos,this.typeConfig.width*this.size,this.typeConfig.height)},update:function(a,b){this.remove||(this.typeConfig.speedOffset&&(b+=this.speedOffset),this.xPos-=Math.floor(60*b/1E3*a),this.typeConfig.numFrames&&(this.timer+=a,this.timer>=this.typeConfig.frameRate&&(this.currentFrame=
|
||||
this.currentFrame==this.typeConfig.numFrames-1?0:this.currentFrame+1,this.timer=0)),this.draw(),this.isVisible()||(this.remove=!0))},getGap:function(a,b){var d=Math.round(this.width*b+this.typeConfig.minGap*a);return q(d,Math.round(d*m.MAX_GAP_COEFFICIENT))},isVisible:function(){return 0<this.xPos+this.width},cloneCollisionBoxes:function(){for(var a=this.typeConfig.collisionBoxes,b=a.length-1;0<=b;b--)this.collisionBoxes[b]=new g(a[b].x,a[b].y,a[b].width,a[b].height)}};m.types=[{type:"CACTUS_SMALL",
|
||||
width:17,height:35,yPos:105,multipleSpeed:4,minGap:120,minSpeed:0,collisionBoxes:[new g(0,7,5,27),new g(4,0,6,34),new g(10,4,7,14)]},{type:"CACTUS_LARGE",width:25,height:50,yPos:90,multipleSpeed:7,minGap:120,minSpeed:0,collisionBoxes:[new g(0,12,7,38),new g(8,0,7,49),new g(13,10,10,38)]},{type:"PTERODACTYL",width:46,height:40,yPos:[100,75,50],yPosMobile:[100,50],multipleSpeed:999,minSpeed:8.5,minGap:150,collisionBoxes:[new g(15,15,16,5),new g(18,21,24,6),new g(2,14,4,3),new g(6,10,4,7),new g(10,8,
|
||||
6,9)],numFrames:2,frameRate:1E3/6,speedOffset:.8}];f.config={DROP_VELOCITY:-5,GRAVITY:.6,HEIGHT:47,HEIGHT_DUCK:25,INIITAL_JUMP_VELOCITY:-10,INTRO_DURATION:1500,MAX_JUMP_HEIGHT:30,MIN_JUMP_HEIGHT:30,SPEED_DROP_COEFFICIENT:3,SPRITE_WIDTH:262,START_X_POS:50,WIDTH:44,WIDTH_DUCK:59};f.collisionBoxes={DUCKING:[new g(1,18,55,25)],RUNNING:[new g(22,0,17,16),new g(1,18,30,9),new g(10,35,14,8),new g(1,24,29,5),new g(5,30,21,4),new g(9,34,15,4)]};f.status={CRASHED:"CRASHED",DUCKING:"DUCKING",JUMPING:"JUMPING",
|
||||
RUNNING:"RUNNING",WAITING:"WAITING"};f.BLINK_TIMING=7E3;f.animFrames={WAITING:{frames:[44,0],msPerFrame:1E3/3},RUNNING:{frames:[88,132],msPerFrame:1E3/12},CRASHED:{frames:[220],msPerFrame:1E3/60},JUMPING:{frames:[0],msPerFrame:1E3/60},DUCKING:{frames:[264,323],msPerFrame:125}};f.prototype={init:function(){this.yPos=this.groundYPos=c.defaultDimensions.HEIGHT-this.config.HEIGHT-c.config.BOTTOM_PAD;this.minJumpHeight=this.groundYPos-this.config.MIN_JUMP_HEIGHT;this.draw(0,0);this.update(0,f.status.WAITING)},
|
||||
setJumpVelocity:function(a){this.config.INIITAL_JUMP_VELOCITY=-a;this.config.DROP_VELOCITY=-a/2},update:function(a,b){this.timer+=a;b&&(this.status=b,this.currentFrame=0,this.msPerFrame=f.animFrames[b].msPerFrame,this.currentAnimFrames=f.animFrames[b].frames,b==f.status.WAITING&&(this.animStartTime=r(),this.setBlinkDelay()));this.playingIntro&&this.xPos<this.config.START_X_POS&&(this.xPos+=Math.round(this.config.START_X_POS/this.config.INTRO_DURATION*a));this.status==f.status.WAITING?this.blink(r()):
|
||||
this.draw(this.currentAnimFrames[this.currentFrame],0);this.timer>=this.msPerFrame&&(this.currentFrame=this.currentFrame==this.currentAnimFrames.length-1?0:this.currentFrame+1,this.timer=0);this.speedDrop&&this.yPos==this.groundYPos&&(this.speedDrop=!1,this.setDuck(!0))},draw:function(a,b){var d=a,l=b,e=this.ducking&&this.status!=f.status.CRASHED?this.config.WIDTH_DUCK:this.config.WIDTH,g=this.config.HEIGHT,h=g;t&&(d*=2,l*=2,e*=2,g*=2);d+=this.spritePos.x;l+=this.spritePos.y;this.ducking&&this.status!=
|
||||
f.status.CRASHED?this.canvasCtx.drawImage(c.imageSprite,d,l,e,g,this.xPos,this.yPos,this.config.WIDTH_DUCK,h):(this.ducking&&this.status==f.status.CRASHED&&this.xPos++,this.canvasCtx.drawImage(c.imageSprite,d,l,e,g,this.xPos,this.yPos,this.config.WIDTH,h));this.canvasCtx.globalAlpha=1},setBlinkDelay:function(){this.blinkDelay=Math.ceil(Math.random()*f.BLINK_TIMING)},blink:function(a){a-this.animStartTime>=this.blinkDelay&&(this.draw(this.currentAnimFrames[this.currentFrame],0),1==this.currentFrame&&
|
||||
(this.setBlinkDelay(),this.animStartTime=a,this.blinkCount++))},startJump:function(a){this.jumping||(this.update(0,f.status.JUMPING),this.jumpVelocity=this.config.INIITAL_JUMP_VELOCITY-a/10,this.jumping=!0,this.speedDrop=this.reachedMinHeight=!1)},endJump:function(){this.reachedMinHeight&&this.jumpVelocity<this.config.DROP_VELOCITY&&(this.jumpVelocity=this.config.DROP_VELOCITY)},updateJump:function(a,b){var d=a/f.animFrames[this.status].msPerFrame;this.yPos=this.speedDrop?this.yPos+Math.round(this.jumpVelocity*
|
||||
this.config.SPEED_DROP_COEFFICIENT*d):this.yPos+Math.round(this.jumpVelocity*d);this.jumpVelocity+=this.config.GRAVITY*d;if(this.yPos<this.minJumpHeight||this.speedDrop)this.reachedMinHeight=!0;(this.yPos<this.config.MAX_JUMP_HEIGHT||this.speedDrop)&&this.endJump();this.yPos>this.groundYPos&&(this.reset(),this.jumpCount++)},setSpeedDrop:function(){this.speedDrop=!0;this.jumpVelocity=1},setDuck:function(a){a&&this.status!=f.status.DUCKING?(this.update(0,f.status.DUCKING),this.ducking=!0):this.status==
|
||||
f.status.DUCKING&&(this.update(0,f.status.RUNNING),this.ducking=!1)},reset:function(){this.yPos=this.groundYPos;this.jumpVelocity=0;this.ducking=this.jumping=!1;this.update(0,f.status.RUNNING);this.speedDrop=this.midair=!1;this.jumpCount=0}};h.dimensions={WIDTH:10,HEIGHT:13,DEST_WIDTH:11};h.yPos=[0,13,27,40,53,67,80,93,107,120];h.config={MAX_DISTANCE_UNITS:5,ACHIEVEMENT_DISTANCE:100,COEFFICIENT:.025,FLASH_DURATION:250,FLASH_ITERATIONS:3};h.prototype={init:function(a){var b="";this.calcXPos(a);this.maxScore=
|
||||
this.maxScoreUnits;for(a=0;a<this.maxScoreUnits;a++)this.draw(a,0),this.defaultString+="0",b+="9";this.maxScore=parseInt(b)},calcXPos:function(a){this.x=a-h.dimensions.DEST_WIDTH*(this.maxScoreUnits+1)},draw:function(a,b,d){var c=h.dimensions.WIDTH,e=h.dimensions.HEIGHT;b*=h.dimensions.WIDTH;var f=a*h.dimensions.DEST_WIDTH,g=this.y,k=h.dimensions.WIDTH,m=h.dimensions.HEIGHT;t&&(c*=2,e*=2,b*=2);b+=this.spritePos.x;a=0+this.spritePos.y;this.canvasCtx.save();d?this.canvasCtx.translate(this.x-2*this.maxScoreUnits*
|
||||
h.dimensions.WIDTH,this.y):this.canvasCtx.translate(this.x,this.y);this.canvasCtx.drawImage(this.image,b,a,c,e,f,g,k,m);this.canvasCtx.restore()},getActualDistance:function(a){return a?Math.round(a*this.config.COEFFICIENT):0},update:function(a,b){var c=!0,e=!1;this.achievement?this.flashIterations<=this.config.FLASH_ITERATIONS?(this.flashTimer+=a,this.flashTimer<this.config.FLASH_DURATION?c=!1:this.flashTimer>2*this.config.FLASH_DURATION&&(this.flashTimer=0,this.flashIterations++)):(this.achievement=
|
||||
!1,this.flashTimer=this.flashIterations=0):(b=this.getActualDistance(b),b>this.maxScore&&this.maxScoreUnits==this.config.MAX_DISTANCE_UNITS?(this.maxScoreUnits++,this.maxScore=parseInt(this.maxScore+"9")):this.distance=0,0<b?(0==b%this.config.ACHIEVEMENT_DISTANCE&&(this.achievement=!0,this.flashTimer=0,e=!0),this.digits=(this.defaultString+b).substr(-this.maxScoreUnits).split("")):this.digits=this.defaultString.split(""));if(c)for(c=this.digits.length-1;0<=c;c--)this.draw(c,parseInt(this.digits[c]));
|
||||
this.drawHighScore();return e},drawHighScore:function(){this.canvasCtx.save();this.canvasCtx.globalAlpha=.8;for(var a=this.highScore.length-1;0<=a;a--)this.draw(a,parseInt(this.highScore[a],10),!0);this.canvasCtx.restore()},setHighScore:function(a){a=this.getActualDistance(a);a=(this.defaultString+a).substr(-this.maxScoreUnits);this.highScore=["10","11",""].concat(a.split(""))},reset:function(){this.update(0);this.achievement=!1}};p.config={HEIGHT:14,MAX_CLOUD_GAP:400,MAX_SKY_LEVEL:30,MIN_CLOUD_GAP:100,
|
||||
MIN_SKY_LEVEL:71,WIDTH:46};p.prototype={init:function(){this.yPos=q(p.config.MAX_SKY_LEVEL,p.config.MIN_SKY_LEVEL);this.draw()},draw:function(){this.canvasCtx.save();var a=p.config.WIDTH,b=p.config.HEIGHT,d=a,e=b;t&&(a*=2,b*=2);this.canvasCtx.drawImage(c.imageSprite,this.spritePos.x,this.spritePos.y,a,b,this.xPos,this.yPos,d,e);this.canvasCtx.restore()},update:function(a){this.remove||(this.xPos-=Math.ceil(a),this.draw(),this.isVisible()||(this.remove=!0))},isVisible:function(){return 0<this.xPos+
|
||||
p.config.WIDTH}};e.config={FADE_SPEED:.035,HEIGHT:40,MOON_SPEED:.25,NUM_STARS:2,STAR_SIZE:9,STAR_SPEED:.3,STAR_MAX_Y:70,WIDTH:20};e.phases=[140,120,100,60,40,20,0];e.prototype={update:function(a,b){a&&0==this.opacity&&(this.currentPhase++,this.currentPhase>=e.phases.length&&(this.currentPhase=0));a&&(1>this.opacity||0==this.opacity)?this.opacity+=e.config.FADE_SPEED:0<this.opacity&&(this.opacity-=e.config.FADE_SPEED);if(0<this.opacity){this.xPos=this.updateXPos(this.xPos,e.config.MOON_SPEED);if(this.drawStars)for(var c=
|
||||
0;c<e.config.NUM_STARS;c++)this.stars[c].x=this.updateXPos(this.stars[c].x,e.config.STAR_SPEED);this.draw()}else this.opacity=0,this.placeStars();this.drawStars=!0},updateXPos:function(a,b){return a=a<-e.config.WIDTH?this.containerWidth:a-b},draw:function(){var a=3==this.currentPhase?2*e.config.WIDTH:e.config.WIDTH,b=e.config.HEIGHT,d=this.spritePos.x+e.phases[this.currentPhase],f=a,g=e.config.STAR_SIZE,h=c.spriteDefinition.LDPI.STAR.x;t&&(a*=2,b*=2,d=this.spritePos.x+2*e.phases[this.currentPhase],
|
||||
g*=2,h=c.spriteDefinition.HDPI.STAR.x);this.canvasCtx.save();this.canvasCtx.globalAlpha=this.opacity;if(this.drawStars)for(var k=0;k<e.config.NUM_STARS;k++)this.canvasCtx.drawImage(c.imageSprite,h,this.stars[k].sourceY,g,g,Math.round(this.stars[k].x),this.stars[k].y,e.config.STAR_SIZE,e.config.STAR_SIZE);this.canvasCtx.drawImage(c.imageSprite,d,this.spritePos.y,a,b,Math.round(this.xPos),this.yPos,f,e.config.HEIGHT);this.canvasCtx.globalAlpha=1;this.canvasCtx.restore()},placeStars:function(){for(var a=
|
||||
Math.round(this.containerWidth/e.config.NUM_STARS),b=0;b<e.config.NUM_STARS;b++)this.stars[b]={},this.stars[b].x=q(a*b,a*(b+1)),this.stars[b].y=q(0,e.config.STAR_MAX_Y),this.stars[b].sourceY=t?c.spriteDefinition.HDPI.STAR.y+2*e.config.STAR_SIZE*b:c.spriteDefinition.LDPI.STAR.y+e.config.STAR_SIZE*b},reset:function(){this.opacity=this.currentPhase=0;this.update(!1)}};k.dimensions={WIDTH:600,HEIGHT:12,YPOS:127};k.prototype={setSourceDimensions:function(){for(var a in k.dimensions)t?"YPOS"!=a&&(this.sourceDimensions[a]=
|
||||
2*k.dimensions[a]):this.sourceDimensions[a]=k.dimensions[a],this.dimensions[a]=k.dimensions[a];this.xPos=[0,k.dimensions.WIDTH];this.yPos=k.dimensions.YPOS},getRandomType:function(){return Math.random()>this.bumpThreshold?this.dimensions.WIDTH:0},draw:function(){this.canvasCtx.drawImage(c.imageSprite,this.sourceXPos[0],this.spritePos.y,this.sourceDimensions.WIDTH,this.sourceDimensions.HEIGHT,this.xPos[0],this.yPos,this.dimensions.WIDTH,this.dimensions.HEIGHT);this.canvasCtx.drawImage(c.imageSprite,
|
||||
this.sourceXPos[1],this.spritePos.y,this.sourceDimensions.WIDTH,this.sourceDimensions.HEIGHT,this.xPos[1],this.yPos,this.dimensions.WIDTH,this.dimensions.HEIGHT)},updateXPos:function(a,b){var c=0==a?1:0;this.xPos[a]-=b;this.xPos[c]=this.xPos[a]+this.dimensions.WIDTH;this.xPos[a]<=-this.dimensions.WIDTH&&(this.xPos[a]+=2*this.dimensions.WIDTH,this.xPos[c]=this.xPos[a]-this.dimensions.WIDTH,this.sourceXPos[a]=this.getRandomType()+this.spritePos.x)},update:function(a,b){var c=Math.floor(.06*b*a);0>=
|
||||
this.xPos[0]?this.updateXPos(0,c):this.updateXPos(1,c);this.draw()},reset:function(){this.xPos[0]=0;this.xPos[1]=k.dimensions.WIDTH}};v.config={BG_CLOUD_SPEED:.2,BUMPY_THRESHOLD:.3,CLOUD_FREQUENCY:.5,HORIZON_HEIGHT:16,MAX_CLOUDS:6};v.prototype={init:function(){this.addCloud();this.horizonLine=new k(this.canvas,this.spritePos.HORIZON);this.nightMode=new e(this.canvas,this.spritePos.MOON,this.dimensions.WIDTH)},update:function(a,b,c,e){this.runningTime+=a;this.horizonLine.update(a,b);this.nightMode.update(e);
|
||||
this.updateClouds(a,b);c&&this.updateObstacles(a,b)},updateClouds:function(a,b){var c=this.cloudSpeed/1E3*a*b,e=this.clouds.length;if(e){for(var f=e-1;0<=f;f--)this.clouds[f].update(c);c=this.clouds[e-1];e<this.config.MAX_CLOUDS&&this.dimensions.WIDTH-c.xPos>c.cloudGap&&this.cloudFrequency>Math.random()&&this.addCloud();this.clouds=this.clouds.filter(function(a){return!a.remove})}else this.addCloud()},updateObstacles:function(a,b){for(var c=this.obstacles.slice(0),e=0;e<this.obstacles.length;e++){var f=
|
||||
this.obstacles[e];f.update(a,b);f.remove&&c.shift()}this.obstacles=c;0<this.obstacles.length?(c=this.obstacles[this.obstacles.length-1])&&!c.followingObstacleCreated&&c.isVisible()&&c.xPos+c.width+c.gap<this.dimensions.WIDTH&&(this.addNewObstacle(b),c.followingObstacleCreated=!0):this.addNewObstacle(b)},removeFirstObstacle:function(){this.obstacles.shift()},addNewObstacle:function(a){var b=q(0,m.types.length-1);b=m.types[b];this.duplicateObstacleCheck(b.type)||a<b.minSpeed?this.addNewObstacle(a):
|
||||
(this.obstacles.push(new m(this.canvasCtx,b,this.spritePos[b.type],this.dimensions,this.gapCoefficient,a,b.width)),this.obstacleHistory.unshift(b.type),1<this.obstacleHistory.length&&this.obstacleHistory.splice(c.config.MAX_OBSTACLE_DUPLICATION))},duplicateObstacleCheck:function(a){for(var b=0,d=0;d<this.obstacleHistory.length;d++)b=this.obstacleHistory[d]==a?b+1:0;return b>=c.config.MAX_OBSTACLE_DUPLICATION},reset:function(){this.obstacles=[];this.horizonLine.reset();this.nightMode.reset()},resize:function(a,
|
||||
b){this.canvas.width=a;this.canvas.height=b},addCloud:function(){this.clouds.push(new p(this.canvas,this.spritePos.CLOUD,this.dimensions.WIDTH))}}})();var HIDDEN_CLASS="hidden";function onDocumentLoad(){new Runner(".interstitial-wrapper")}document.addEventListener("DOMContentLoaded",onDocumentLoad);
|
Before Width: | Height: | Size: 382 B |
Before Width: | Height: | Size: 196 B |
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 479 B |
Before Width: | Height: | Size: 269 B |
Before Width: | Height: | Size: 3 KiB |
|
@ -1,93 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>2048</title>
|
||||
|
||||
<link href="https://cdn.jsdelivr.net/gh/BinBashBanana/gstore/html5games/2048/style/main.css" rel="stylesheet" type="text/css">
|
||||
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/BinBashBanana/gstore/html5games/2048/favicon.ico">
|
||||
<link rel="apple-touch-icon" href="https://cdn.jsdelivr.net/gh/BinBashBanana/gstore/html5games/2048/meta/apple-touch-icon.png">
|
||||
<link rel="apple-touch-startup-image" href="https://cdn.jsdelivr.net/gh/BinBashBanana/gstore/html5games/2048/meta/apple-touch-startup-image-640x1096.png" media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2)"> <!-- iPhone 5+ -->
|
||||
<link rel="apple-touch-startup-image" href="https://cdn.jsdelivr.net/gh/BinBashBanana/gstore/html5games/2048/meta/apple-touch-startup-image-640x920.png" media="(device-width: 320px) and (device-height: 480px) and (-webkit-device-pixel-ratio: 2)"> <!-- iPhone, retina -->
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||
|
||||
<meta name="HandheldFriendly" content="True">
|
||||
<meta name="MobileOptimized" content="320">
|
||||
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0, maximum-scale=1, user-scalable=no, minimal-ui">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="heading">
|
||||
<h1 class="title">2048</h1>
|
||||
<div class="scores-container">
|
||||
<div class="score-container">0</div>
|
||||
<div class="best-container">0</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="above-game">
|
||||
<p class="game-intro">Join the numbers and get to the <strong>2048 tile!</strong></p>
|
||||
<a class="restart-button">New Game</a>
|
||||
</div>
|
||||
|
||||
<div class="game-container">
|
||||
<div class="game-message">
|
||||
<p></p>
|
||||
<div class="lower">
|
||||
<a class="keep-playing-button">Keep going</a>
|
||||
<a class="retry-button">Try again</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid-container">
|
||||
<div class="grid-row">
|
||||
<div class="grid-cell"></div>
|
||||
<div class="grid-cell"></div>
|
||||
<div class="grid-cell"></div>
|
||||
<div class="grid-cell"></div>
|
||||
</div>
|
||||
<div class="grid-row">
|
||||
<div class="grid-cell"></div>
|
||||
<div class="grid-cell"></div>
|
||||
<div class="grid-cell"></div>
|
||||
<div class="grid-cell"></div>
|
||||
</div>
|
||||
<div class="grid-row">
|
||||
<div class="grid-cell"></div>
|
||||
<div class="grid-cell"></div>
|
||||
<div class="grid-cell"></div>
|
||||
<div class="grid-cell"></div>
|
||||
</div>
|
||||
<div class="grid-row">
|
||||
<div class="grid-cell"></div>
|
||||
<div class="grid-cell"></div>
|
||||
<div class="grid-cell"></div>
|
||||
<div class="grid-cell"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tile-container">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p class="game-explanation">
|
||||
<strong class="important">How to play:</strong> Use your <strong>arrow keys</strong> to move the tiles. When two tiles with the same number touch, they <strong>merge into one!</strong>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/gh/BinBashBanana/gstore/html5games/2048/js/bind_polyfill.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/gh/BinBashBanana/gstore/html5games/2048/js/classlist_polyfill.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/gh/BinBashBanana/gstore/html5games/2048/js/animframe_polyfill.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/gh/BinBashBanana/gstore/html5games/2048/js/keyboard_input_manager.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/gh/BinBashBanana/gstore/html5games/2048/js/html_actuator.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/gh/BinBashBanana/gstore/html5games/2048/js/grid.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/gh/BinBashBanana/gstore/html5games/2048/js/tile.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/gh/BinBashBanana/gstore/html5games/2048/js/local_storage_manager.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/gh/BinBashBanana/gstore/html5games/2048/js/game_manager.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/gh/BinBashBanana/gstore/html5games/2048/js/application.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
3
views/archive/g/README.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
Moved to a new repository due to size! :D
|
||||
|
||||
https://github.com/QuiteAFancyEmerald/HU-Archive
|
|
@ -1,32 +0,0 @@
|
|||
<html>
|
||||
<head>
|
||||
<script src="https://cdn.jsdelivr.net/gh/BinBashBanana/gstore/html5games/asteroids/jquery-1.4.1.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/gh/BinBashBanana/gstore/html5games/asteroids/vector_battle_regular.typeface.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/gh/BinBashBanana/gstore/html5games/asteroids/ipad.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/gh/BinBashBanana/gstore/html5games/asteroids/game.js"></script>
|
||||
<style>
|
||||
body {background-color: #000;}
|
||||
#canvas { border:1px solid black; top:0px; left:0px; background-color: #fff;}
|
||||
.button { position:absolute; border:1px solid black; }
|
||||
#left-controls { position:absolute; left:1px; bottom:0px; display:none; }
|
||||
#right-controls { position:absolute; right:1px; bottom:0px; display:none; }
|
||||
#up { width:200px; height:100px; bottom:100px;}
|
||||
#left { width:100px; height:100px; bottom:0px;}
|
||||
#right { width:100px; height:100px; bottom:0px; left:100px; }
|
||||
#space { width:200px; height:200px; bottom:0px; right:0px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="game-container" align="center">
|
||||
<canvas id="canvas" width="780" height="540"></canvas>
|
||||
<div id="left-controls">
|
||||
<div id="up" class='button'>THRUST</div>
|
||||
<div id="left" class='button'>LEFT</div>
|
||||
<div id="right" class='button'>RIGHT</div>
|
||||
</div>
|
||||
<div id="right-controls">
|
||||
<div id="space" class='button'>FIRE</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
Before Width: | Height: | Size: 93 KiB |
Before Width: | Height: | Size: 591 KiB |
Before Width: | Height: | Size: 206 KiB |
|
@ -1,372 +0,0 @@
|
|||
<html>
|
||||
|
||||
<head>
|
||||
|
||||
<script src='https://cdn.jsdelivr.net/gh/BinBashBanana/gstore/html5games/astray/Box2dWeb.min.js'></script>
|
||||
<script src="https://cdn.jsdelivr.net/gh/BinBashBanana/gstore/html5games/astray/Three.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/gh/BinBashBanana/gstore/html5games/astray/keyboard.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/gh/BinBashBanana/gstore/html5games/astray/jquery.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/gh/BinBashBanana/gstore/html5games/astray/maze.js"></script>
|
||||
|
||||
<script>
|
||||
|
||||
var camera = undefined,
|
||||
scene = undefined,
|
||||
renderer = undefined,
|
||||
light = undefined,
|
||||
mouseX = undefined,
|
||||
mouseY = undefined,
|
||||
maze = undefined,
|
||||
mazeMesh = undefined,
|
||||
mazeDimension = 11,
|
||||
planeMesh = undefined,
|
||||
ballMesh = undefined,
|
||||
ballRadius = 0.25,
|
||||
keyAxis = [0, 0],
|
||||
ironTexture = THREE.ImageUtils.loadTexture('ball.png'),
|
||||
planeTexture = THREE.ImageUtils.loadTexture('concrete.png'),
|
||||
brickTexture = THREE.ImageUtils.loadTexture('brick.png'),
|
||||
gameState = undefined,
|
||||
|
||||
// Box2D shortcuts
|
||||
b2World = Box2D.Dynamics.b2World,
|
||||
b2FixtureDef = Box2D.Dynamics.b2FixtureDef,
|
||||
b2BodyDef = Box2D.Dynamics.b2BodyDef,
|
||||
b2Body = Box2D.Dynamics.b2Body,
|
||||
b2CircleShape = Box2D.Collision.Shapes.b2CircleShape,
|
||||
b2PolygonShape = Box2D.Collision.Shapes.b2PolygonShape,
|
||||
b2Settings = Box2D.Common.b2Settings,
|
||||
b2Vec2 = Box2D.Common.Math.b2Vec2,
|
||||
|
||||
// Box2D world variables
|
||||
wWorld = undefined,
|
||||
wBall = undefined;
|
||||
|
||||
|
||||
function createPhysicsWorld() {
|
||||
// Create the world object.
|
||||
wWorld = new b2World(new b2Vec2(0, 0), true);
|
||||
|
||||
// Create the ball.
|
||||
var bodyDef = new b2BodyDef();
|
||||
bodyDef.type = b2Body.b2_dynamicBody;
|
||||
bodyDef.position.Set(1, 1);
|
||||
wBall = wWorld.CreateBody(bodyDef);
|
||||
var fixDef = new b2FixtureDef();
|
||||
fixDef.density = 1.0;
|
||||
fixDef.friction = 0.0;
|
||||
fixDef.restitution = 0.25;
|
||||
fixDef.shape = new b2CircleShape(ballRadius);
|
||||
wBall.CreateFixture(fixDef);
|
||||
|
||||
// Create the maze.
|
||||
bodyDef.type = b2Body.b2_staticBody;
|
||||
fixDef.shape = new b2PolygonShape();
|
||||
fixDef.shape.SetAsBox(0.5, 0.5);
|
||||
for (var i = 0; i < maze.dimension; i++) {
|
||||
for (var j = 0; j < maze.dimension; j++) {
|
||||
if (maze[i][j]) {
|
||||
bodyDef.position.x = i;
|
||||
bodyDef.position.y = j;
|
||||
wWorld.CreateBody(bodyDef).CreateFixture(fixDef);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function generate_maze_mesh(field) {
|
||||
var dummy = new THREE.Geometry();
|
||||
for (var i = 0; i < field.dimension; i++) {
|
||||
for (var j = 0; j < field.dimension; j++) {
|
||||
if (field[i][j]) {
|
||||
var geometry = new THREE.CubeGeometry(1,1,1,1,1,1);
|
||||
var mesh_ij = new THREE.Mesh(geometry);
|
||||
mesh_ij.position.x = i;
|
||||
mesh_ij.position.y = j;
|
||||
mesh_ij.position.z = 0.5;
|
||||
THREE.GeometryUtils.merge(dummy, mesh_ij);
|
||||
}
|
||||
}
|
||||
}
|
||||
var material = new THREE.MeshPhongMaterial({map: brickTexture});
|
||||
var mesh = new THREE.Mesh(dummy, material)
|
||||
return mesh;
|
||||
}
|
||||
|
||||
|
||||
function createRenderWorld() {
|
||||
|
||||
// Create the scene object.
|
||||
scene = new THREE.Scene();
|
||||
|
||||
// Add the light.
|
||||
light= new THREE.PointLight(0xffffff, 1);
|
||||
light.position.set(1, 1, 1.3);
|
||||
scene.add(light);
|
||||
|
||||
// Add the ball.
|
||||
g = new THREE.SphereGeometry(ballRadius, 32, 16);
|
||||
m = new THREE.MeshPhongMaterial({map:ironTexture});
|
||||
ballMesh = new THREE.Mesh(g, m);
|
||||
ballMesh.position.set(1, 1, ballRadius);
|
||||
scene.add(ballMesh);
|
||||
|
||||
// Add the camera.
|
||||
var aspect = window.innerWidth/window.innerHeight;
|
||||
camera = new THREE.PerspectiveCamera(60, aspect, 1, 1000);
|
||||
camera.position.set(1, 1, 5);
|
||||
scene.add(camera);
|
||||
|
||||
// Add the maze.
|
||||
mazeMesh = generate_maze_mesh(maze);
|
||||
scene.add(mazeMesh);
|
||||
|
||||
// Add the ground.
|
||||
g = new THREE.PlaneGeometry(mazeDimension*10, mazeDimension*10, mazeDimension, mazeDimension);
|
||||
planeTexture.wrapS = planeTexture.wrapT = THREE.RepeatWrapping;
|
||||
planeTexture.repeat.set(mazeDimension*5, mazeDimension*5);
|
||||
m = new THREE.MeshPhongMaterial({map:planeTexture});
|
||||
planeMesh = new THREE.Mesh(g, m);
|
||||
planeMesh.position.set((mazeDimension-1)/2, (mazeDimension-1)/2, 0);
|
||||
planeMesh.rotation.set(Math.PI/2, 0, 0);
|
||||
scene.add(planeMesh);
|
||||
|
||||
}
|
||||
|
||||
|
||||
function updatePhysicsWorld() {
|
||||
|
||||
// Apply "friction".
|
||||
var lv = wBall.GetLinearVelocity();
|
||||
lv.Multiply(0.95);
|
||||
wBall.SetLinearVelocity(lv);
|
||||
|
||||
// Apply user-directed force.
|
||||
var f = new b2Vec2(keyAxis[0]*wBall.GetMass()*0.25, keyAxis[1]*wBall.GetMass()*0.25);
|
||||
wBall.ApplyImpulse(f, wBall.GetPosition());
|
||||
keyAxis = [0,0];
|
||||
|
||||
// Take a time step.
|
||||
wWorld.Step(1/60, 8, 3);
|
||||
}
|
||||
|
||||
|
||||
function updateRenderWorld() {
|
||||
|
||||
// Update ball position.
|
||||
var stepX = wBall.GetPosition().x - ballMesh.position.x;
|
||||
var stepY = wBall.GetPosition().y - ballMesh.position.y;
|
||||
ballMesh.position.x += stepX;
|
||||
ballMesh.position.y += stepY;
|
||||
|
||||
// Update ball rotation.
|
||||
var tempMat = new THREE.Matrix4();
|
||||
tempMat.makeRotationAxis(new THREE.Vector3(0,1,0), stepX/ballRadius);
|
||||
tempMat.multiplySelf(ballMesh.matrix);
|
||||
ballMesh.matrix = tempMat;
|
||||
tempMat = new THREE.Matrix4();
|
||||
tempMat.makeRotationAxis(new THREE.Vector3(1,0,0), -stepY/ballRadius);
|
||||
tempMat.multiplySelf(ballMesh.matrix);
|
||||
ballMesh.matrix = tempMat;
|
||||
ballMesh.rotation.getRotationFromMatrix(ballMesh.matrix);
|
||||
|
||||
// Update camera and light positions.
|
||||
camera.position.x += (ballMesh.position.x - camera.position.x) * 0.1;
|
||||
camera.position.y += (ballMesh.position.y - camera.position.y) * 0.1;
|
||||
camera.position.z += (5 - camera.position.z) * 0.1;
|
||||
light.position.x = camera.position.x;
|
||||
light.position.y = camera.position.y;
|
||||
light.position.z = camera.position.z - 3.7;
|
||||
}
|
||||
|
||||
|
||||
function gameLoop() {
|
||||
|
||||
switch(gameState) {
|
||||
|
||||
case 'initialize':
|
||||
maze = generateSquareMaze(mazeDimension);
|
||||
maze[mazeDimension-1][mazeDimension-2] = false;
|
||||
createPhysicsWorld();
|
||||
createRenderWorld();
|
||||
camera.position.set(1, 1, 5);
|
||||
light.position.set(1, 1, 1.3);
|
||||
light.intensity = 0;
|
||||
var level = Math.floor((mazeDimension-1)/2 - 4);
|
||||
$('#level').html('Level ' + level);
|
||||
gameState = 'fade in';
|
||||
break;
|
||||
|
||||
case 'fade in':
|
||||
light.intensity += 0.1 * (1.0 - light.intensity);
|
||||
renderer.render(scene, camera);
|
||||
if (Math.abs(light.intensity - 1.0) < 0.05) {
|
||||
light.intensity = 1.0;
|
||||
gameState = 'play'
|
||||
}
|
||||
break;
|
||||
|
||||
case 'play':
|
||||
updatePhysicsWorld();
|
||||
updateRenderWorld();
|
||||
renderer.render(scene, camera);
|
||||
|
||||
// Check for victory.
|
||||
var mazeX = Math.floor(ballMesh.position.x + 0.5);
|
||||
var mazeY = Math.floor(ballMesh.position.y + 0.5);
|
||||
if (mazeX == mazeDimension && mazeY == mazeDimension - 2) {
|
||||
mazeDimension += 2;
|
||||
gameState = 'fade out';
|
||||
}
|
||||
break;
|
||||
|
||||
case 'fade out':
|
||||
updatePhysicsWorld();
|
||||
updateRenderWorld();
|
||||
light.intensity += 0.1 * (0.0 - light.intensity);
|
||||
renderer.render(scene, camera);
|
||||
if (Math.abs(light.intensity - 0.0) < 0.1) {
|
||||
light.intensity = 0.0;
|
||||
renderer.render(scene, camera);
|
||||
gameState = 'initialize'
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
requestAnimationFrame(gameLoop);
|
||||
|
||||
}
|
||||
|
||||
|
||||
function onResize() {
|
||||
renderer.setSize(window.innerWidth, window.innerHeight);
|
||||
camera.aspect = window.innerWidth/window.innerHeight;
|
||||
camera.updateProjectionMatrix();
|
||||
}
|
||||
|
||||
|
||||
function onMoveKey(axis) {
|
||||
keyAxis = axis.slice(0);
|
||||
}
|
||||
|
||||
|
||||
jQuery.fn.centerv = function () {
|
||||
wh = window.innerHeight;
|
||||
h = this.outerHeight();
|
||||
this.css("position", "absolute");
|
||||
this.css("top", Math.max(0, (wh - h)/2) + "px");
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
jQuery.fn.centerh = function () {
|
||||
ww = window.innerWidth;
|
||||
w = this.outerWidth();
|
||||
this.css("position", "absolute");
|
||||
this.css("left", Math.max(0, (ww - w)/2) + "px");
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
jQuery.fn.center = function () {
|
||||
this.centerv();
|
||||
this.centerh();
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
// Prepare the instructions.
|
||||
$('#instructions').center();
|
||||
$('#instructions').hide();
|
||||
KeyboardJS.bind.key('i', function(){$('#instructions').show()},
|
||||
function(){$('#instructions').hide()});
|
||||
|
||||
// Create the renderer.
|
||||
renderer = new THREE.WebGLRenderer();
|
||||
renderer.setSize(window.innerWidth, window.innerHeight);
|
||||
document.body.appendChild(renderer.domElement);
|
||||
|
||||
// Bind keyboard and resize events.
|
||||
KeyboardJS.bind.axis('left', 'right', 'down', 'up', onMoveKey);
|
||||
KeyboardJS.bind.axis('h', 'l', 'j', 'k', onMoveKey);
|
||||
$(window).resize(onResize);
|
||||
|
||||
|
||||
// Set the initial game state.
|
||||
gameState = 'initialize';
|
||||
|
||||
// Start the game loop.
|
||||
requestAnimationFrame(gameLoop);
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
body {
|
||||
background: black;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-family: 'Helvetica';
|
||||
}
|
||||
|
||||
#instructions {
|
||||
background-color: rgba(0,0,0,0.75);
|
||||
color: white;
|
||||
text-align: center;
|
||||
padding: 32px;
|
||||
margin: 0px;
|
||||
display: inline;
|
||||
border: 2px solid white;
|
||||
}
|
||||
|
||||
#help {
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
bottom: 0px;
|
||||
padding: 4px;
|
||||
color: white;
|
||||
}
|
||||
|
||||
#level {
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
top: 0px;
|
||||
padding: 4px;
|
||||
color: yellow;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div id='instructions'>
|
||||
How to play Astray:
|
||||
<br><br>
|
||||
Use the arrow keys to move the ball and find the exit to the maze.
|
||||
<br><br>
|
||||
Vim trainees: h, j, k, l
|
||||
</div>
|
||||
|
||||
<div id='help'>
|
||||
Hold down the 'I' key for instructions.
|
||||
</div>
|
||||
|
||||
<div id='level'>
|
||||
Level 1
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
<!doctype html>
|
||||
<!--
|
||||
Bounce Back ~ A boomerang roguelike for JS13k
|
||||
Copyright (C) 2019 Frank Force
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
-->
|
||||
<!--
|
||||
When life gets you down,
|
||||
it's never too late to...
|
||||
|
||||
B O U N C E B A C K
|
||||
|
||||
A JS13k 2019 Game
|
||||
By Frank Force
|
||||
|
||||
WASD = Move
|
||||
Mouse = Aim
|
||||
Click = Throw
|
||||
Space = Dash
|
||||
|
||||
Hints
|
||||
- You will keep money after you die!
|
||||
- You won't take damage while dashing.
|
||||
- There are 10 levels.
|
||||
- Sand slows down you and enemies.
|
||||
- Yellow boormang can grab pickups.
|
||||
- Blue boomerang does double damage.
|
||||
- Beat the game to unlock speed run mode.
|
||||
-->
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Bounce Back</title>
|
||||
<style>
|
||||
body
|
||||
{
|
||||
background:#000;
|
||||
overflow:hidden;
|
||||
margin:0;
|
||||
}
|
||||
canvas
|
||||
{
|
||||
width:100%;
|
||||
height:100%;
|
||||
image-rendering:-moz-crisp-edges;
|
||||
image-rendering:pixelated;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<canvas id=c1></canvas>
|
||||
<canvas id=c2 style=visibility:hidden></canvas>
|
||||
<script src='https://cdn.jsdelivr.net/gh/BinBashBanana/gstore/html5games/bounceback/gameEngine.js'></script>
|
||||
<script src='https://cdn.jsdelivr.net/gh/BinBashBanana/gstore/html5games/bounceback/gameEngineDebug.js'></script>
|
||||
<script src='https://cdn.jsdelivr.net/gh/BinBashBanana/gstore/html5games/bounceback/game.js'></script>
|
||||
</body>
|
||||
</html>
|
Before Width: | Height: | Size: 2.1 KiB |
|
@ -1,122 +0,0 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
|
||||
<!-- Mirrored from www.phoenix-le.cf/gfiles/html5games/breaklock/ by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 29 Jan 2020 01:05:01 GMT -->
|
||||
<head>
|
||||
<title>BreakLock</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
|
||||
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/BinBashBanana/gstore/html5games/breaklock/assets/favicon.ico">
|
||||
<meta name="theme-color" content="#14171b">
|
||||
|
||||
<link rel="manifest" href="https://cdn.jsdelivr.net/gh/BinBashBanana/gstore/html5games/breaklock/manifest.json">
|
||||
|
||||
<!-- Add to home screen for Safari on iOS -->
|
||||
<link rel="apple-touch-icon" href="https://cdn.jsdelivr.net/gh/BinBashBanana/gstore/html5games/breaklock/assets/icons/ios-180x180.png">
|
||||
<link rel="apple-touch-startup-image" href="https://cdn.jsdelivr.net/gh/BinBashBanana/gstore/html5games/breaklock/assets/ios-startup/startup-640x1136.png" media="device-width: 375px">
|
||||
<link rel="apple-touch-startup-image" href="https://cdn.jsdelivr.net/gh/BinBashBanana/gstore/html5games/breaklock/assets/ios-startup/startup-1080x1920.png" media="device-width: 414px">
|
||||
<link rel="apple-touch-startup-image" href="https://cdn.jsdelivr.net/gh/BinBashBanana/gstore/html5games/breaklock/assets/ios-startup/startup-640x1136.png" media="(device-width: 320px) and (device-height: 568px)">
|
||||
<link rel="apple-touch-startup-image" href="https://cdn.jsdelivr.net/gh/BinBashBanana/gstore/html5games/breaklock/assets/ios-startup/startup-640x960.png" media="(device-width: 320px) and (device-height: 480px)">
|
||||
|
||||
<meta name="apple-mobile-web-app-title" content="BreakLock">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||
|
||||
<meta name="HandheldFriendly" content="True">
|
||||
<meta name="MobileOptimized" content="320">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no, minimal-ui">
|
||||
|
||||
<meta name="msapplication-TileImage" content="https://cdn.jsdelivr.net/gh/BinBashBanana/gstore/html5games/breaklock/assets/icons/icon-144x144.png">
|
||||
<meta name="msapplication-TileColor" content="#14171b">
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/BinBashBanana/gstore/html5games/breaklock/app.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- Intro -->
|
||||
<p id="app-intro" style="font-family: monospace; color: #fff;">
|
||||
$ ./breaklock start<br>
|
||||
Loading...
|
||||
<style type="text/css">
|
||||
body {
|
||||
background: #14171b;
|
||||
}
|
||||
</style>
|
||||
</p>
|
||||
|
||||
<!-- Static content -->
|
||||
<div style="display: none;">
|
||||
<div id="instructions-template">
|
||||
<object class="introduction-demo" data="https://cdn.jsdelivr.net/gh/BinBashBanana/gstore/html5games/breaklock/assets/intro.svg" type="image/svg+xml"></object>
|
||||
<p>Link the dots to find the lock pattern. After every attempt the game will tell you how many dots you got right.<p>
|
||||
<table>
|
||||
<tr>
|
||||
<td style="width:1.5em;">●</td>
|
||||
<td>a dot occurs in the pattern and is in the correct order</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>○</td>
|
||||
<td>a dot occurs in the pattern but in the wrong order</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p>The difficulty setting changes the amount of dots to connect. Easy is 4 dots, medium is 5 dots and hard is 6 dots.</p>
|
||||
<p>Good luck!_</p>
|
||||
<p class="small">by <a href="https://twitter.com/mxwllt"><svg class="icon"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icon-maxwellito"></use></svg></a> / on <a href="https://github.com/maxwellito/breaklock"><svg class="icon"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icon-github"></use></svg></a></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- SVG Icon definitions -->
|
||||
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
|
||||
<symbol viewBox="0 0 128 128" id="icon-new_game">
|
||||
<path d="M111.5,120.5h-96c-4.418,0-8-3.582-8-8V16c0-3.236,1.949-6.153,4.938-7.391c2.991-1.237,6.432-0.554,8.718,1.734l48.5,48.5 c2.288,2.288,2.972,5.729,1.733,8.719S67.235,72.5,64,72.5H23.5v32h80v-80h-40c-4.418,0-8-3.582-8-8s3.582-8,8-8h48 c4.418,0,8,3.582,8,8v96C119.5,116.918,115.918,120.5,111.5,120.5z M23.5,56.5h21.187L23.5,35.313V56.5z"/>
|
||||
</symbol>
|
||||
<symbol viewBox="0 0 128 128" id="icon-back_home">
|
||||
<path d="M111.5,120.5h-96c-4.418,0-8-3.582-8-8V64c0-2.129,0.849-4.17,2.358-5.672l48.25-48C59.613,8.831,61.681,8.015,63.776,8 c2.123,0.007,4.157,0.858,5.652,2.365l47.875,48.25c1.907,1.922,2.639,4.569,2.196,7.047V112.5 C119.5,116.918,115.918,120.5,111.5,120.5z M23.5,104.5h80v-32h-40c-4.418,0-8-3.582-8-8s3.582-8,8-8h29.165L63.713,27.321 L23.5,67.326V104.5z"/>
|
||||
</symbol>
|
||||
<symbol viewBox="0 0 128 128" id="icon-continue">
|
||||
<path d="M15.5,120c-1.463,0-2.921-0.4-4.207-1.194C8.936,117.348,7.5,114.772,7.5,112V16c0-2.772,1.436-5.348,3.794-6.805 c2.359-1.458,5.304-1.591,7.784-0.35l96,48C117.788,58.2,119.5,60.97,119.5,64s-1.712,5.8-4.422,7.155l-96,48 C17.949,119.72,16.723,120,15.5,120z M23.5,28.944v70.111L93.611,64L23.5,28.944z"/>
|
||||
</symbol>
|
||||
<symbol viewBox="0 0 120 122" id="icon-maxwellito">
|
||||
<polyline points="30,0 60,17.33 40,28.88 60,40.43 80,28.88 60,17.33 90,0 120,17.33 120,51.98 90,69.29 90,46.20 70,57.75 70,80.84 90,69.29 90,103.93 60,121.26 30,103.93 30,69.29 50,80.84 50,57.75 30,46.2 30,69.29 0,51.98 0,17.33" />
|
||||
</symbol>
|
||||
<symbol viewBox="0 0 128 128" id="icon-github">
|
||||
<path d="M115.9,35.4c-5.3-9.2-12.6-16.5-21.8-21.8c-9.2-5.4-19.2-8-30.1-8c-10.9,0-20.9,2.7-30.1,8C24.7,18.9,17.4,26.2,12,35.4 c-5.3,9.2-8,19.3-8,30.1c0,13.1,3.8,24.9,11.4,35.3c7.7,10.4,17.5,17.7,29.6,21.7c1.4,0.3,2.5,0.1,3.1-0.5c0.7-0.6,1-1.4,1-2.4 v-4.2l-0.1-7l-1.8,0.3c-1.1,0.3-2.6,0.3-4.4,0.3c-1.7,0-3.6-0.2-5.4-0.5c-1.9-0.3-3.6-1.1-5.3-2.3c-1.6-1.2-2.7-2.8-3.4-4.8 L28,99.5c-0.5-1.2-1.3-2.5-2.5-4c-1.1-1.5-2.2-2.5-3.4-3l-0.5-0.4c-0.4-0.3-0.7-0.5-1-0.9c-0.3-0.4-0.5-0.7-0.7-1.1 c-0.1-0.4,0-0.7,0.4-0.9c0.4-0.3,1.2-0.4,2.2-0.4l1.6,0.3c1,0.2,2.3,0.8,3.8,1.8c1.6,1,2.8,2.4,3.8,4.1c1.2,2.1,2.6,3.7,4.3,4.8 c1.7,1.1,3.4,1.6,5.1,1.6c1.7,0,3.2-0.1,4.5-0.4c1.2-0.2,2.4-0.6,3.5-1.1c0.5-3.5,1.8-6.2,3.8-8c-3-0.3-5.6-0.8-8-1.4 c-2.4-0.7-4.8-1.6-7.3-3.1c-2.5-1.4-4.7-3.1-6.3-5.2c-1.6-2.1-3-4.8-4.1-8.2c-1.1-3.4-1.6-7.3-1.6-11.7c0-6.3,2.1-11.7,6.2-16.1 c-1.9-4.7-1.8-10,0.5-16c1.5-0.4,3.7-0.1,6.7,1.1c3,1.2,5.1,2.2,6.5,3c1.4,0.8,2.5,1.5,3.3,2.1c4.8-1.4,9.9-2,15-2 c5.1,0,10.1,0.7,15,2l3-1.9c2-1.3,4.4-2.5,7.2-3.5c2.7-1,4.9-1.4,6.3-0.8c2.4,5.9,2.6,11.2,0.7,15.9c4.1,4.5,6.2,9.9,6.2,16.1 c0,4.4-0.5,8.3-1.6,11.8c-1,3.4-2.4,6.1-4.1,8.2c-1.7,2-3.8,3.8-6.3,5.1c-2.6,1.5-5,2.5-7.4,3.1c-2.4,0.6-5,1.1-8,1.4 c2.7,2.4,4.1,6.1,4.1,11.1v16.5c0,0.9,0.3,1.7,1,2.4c0.7,0.6,1.6,0.8,3.1,0.5c12-4,21.9-11.2,29.6-21.7 c7.7-10.4,11.4-22.2,11.4-35.3C124,54.7,121.3,44.6,115.9,35.4L115.9,35.4z"/>
|
||||
</symbol>
|
||||
<symbol viewBox="0 0 128 128" id="icon-facebook">
|
||||
<path d="M16,16v96h51.164V74.451h-12.08v-13.99h12.08V50.144c0-11.973,7.312-18.493,17.994-18.493c5.115,0,9.514,0.381,10.795,0.552 v12.514l-7.408,0.003c-5.809,0-6.934,2.76-6.934,6.811v8.932h13.854l-1.803,13.99H81.611V112H112V16H16z"/>
|
||||
</symbol>
|
||||
<symbol viewBox="0 0 128 128" id="icon-twitter">
|
||||
<path d="M128,24.3c-4.7,2.1-9.8,3.5-15.1,4.1c5.4-3.2,9.6-8.4,11.5-14.5c-5.1,3-10.7,5.2-16.7,6.4 C103,15.2,96.2,12,88.6,12c-14.5,0-26.3,11.8-26.3,26.3c0,2.1,0.2,4.1,0.7,6C41.2,43.2,21.9,32.7,8.9,16.8 C6.7,20.7,5.4,25.2,5.4,30c0,9.1,4.6,17.1,11.7,21.9c-4.3-0.1-8.4-1.3-11.9-3.3v0.3c0,12.7,9.1,23.3,21.1,25.7 c-2.2,0.6-4.5,0.9-6.9,0.9c-1.7,0-3.3-0.2-4.9-0.5c3.3,10.4,13,18,24.5,18.2c-9,7-20.3,11.2-32.6,11.2c-2.1,0-4.2-0.1-6.3-0.4 c11.6,7.5,25.4,11.8,40.2,11.8c48.3,0,74.7-40,74.7-74.7l-0.1-3.4C120,34.2,124.5,29.6,128,24.3z"/>
|
||||
</symbol>
|
||||
</svg>
|
||||
|
||||
<noscript>
|
||||
<!--[if lte IE 6]>
|
||||
<p>
|
||||
If you read this it's probably because the world has rebooted. I don't know how but you arrived here. I'm sorry you cannot enjoy this little game but you will be able to in the not too distant future. Browsers will become incredibly better. Just before the world turns into chaos due to Nutella production shortages. Scientists will realise too late that Nutella was to humans what pollen is to bees. Don't believe the hype, the end didn't (or won't) happen because the 'left-pad' package got removed from NPM. Good luck.
|
||||
</p>
|
||||
<p>
|
||||
PS: If the world has ended, please tell thejameskyle that I loved him. Only his cat can save the world. (Shut the door)
|
||||
</p>
|
||||
<![endif]-->
|
||||
</noscript>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/gh/BinBashBanana/gstore/html5games/breaklock/app.js"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
// Set up service worker
|
||||
if ('serviceWorker' in navigator) {
|
||||
navigator.serviceWorker
|
||||
.register('service-worker.js', {scope: '.'});
|
||||
}
|
||||
|
||||
// Easter Egg to get it full black
|
||||
// Awesome for OLED screens
|
||||
if (localStorage.getItem('isDeepBlack')) {
|
||||
document.body.classList.add('deepblack')
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
<!-- Mirrored from www.phoenix-le.cf/gfiles/html5games/breaklock/ by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 29 Jan 2020 01:05:03 GMT -->
|
||||
</html>
|
|
@ -1,27 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="author" content="">
|
||||
<link href="https://cdn.jsdelivr.net/gh/BinBashBanana/gstore/html5games/breakout/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="https://cdn.jsdelivr.net/gh/BinBashBanana/gstore/html5games/breakout/css/styles.css" rel="stylesheet">
|
||||
<!-- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"> -->
|
||||
<link href='https://fonts.googleapis.com/css?family=Titillium+Web' rel='stylesheet' type='text/css'>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<canvas id="myCanvas"></canvas>
|
||||
|
||||
<div class="container playbtn">
|
||||
<div class="row text-center">
|
||||
<button type="button" class="btn btn-lg btn-primary" id="start" autofocus>Start / Resume</button>
|
||||
<button type="button" class="btn btn-lg btn-danger hidden" id="pause">Pause</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/gh/BinBashBanana/gstore/html5games/breakout/js/jquery.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/gh/BinBashBanana/gstore/html5games/breakout/js/script.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,293 +0,0 @@
|
|||
/*
|
||||
* Javascript/Canvas Textured 3D Renderer v0.3.1
|
||||
* Copyright (c) 2008 Jacob Seidelin, cupboy@gmail.com
|
||||
* This software is free to use for non-commercial purposes. For anything else, please contact the author.
|
||||
* This is a version modified by Stefano Gioffre'.
|
||||
*/
|
||||
|
||||
Canvas3D.Camera = function() {
|
||||
|
||||
this._oPosition = new Canvas3D.Vec3(0,0,0);
|
||||
|
||||
this._oSideVec = new Canvas3D.Vec3(1,0,0);
|
||||
this._oUpVec = new Canvas3D.Vec3(0,1,0);
|
||||
this._oOutVec = new Canvas3D.Vec3(0,0,1);
|
||||
|
||||
this._oRotMat = new Canvas3D.Matrix3();
|
||||
|
||||
this._bDirty = false;
|
||||
this._fFocal = 500;
|
||||
this._fFocalDistance = this._fFocal;
|
||||
|
||||
this._bReverseX = false;
|
||||
this._bReverseY = false;
|
||||
|
||||
this._bTarget = true;
|
||||
|
||||
this._iClipNear = 1;
|
||||
this._iClipFar = 10000000;
|
||||
|
||||
this._fScale = 1;
|
||||
|
||||
this._oLookAt = new Canvas3D.Vec3(0,0,0);
|
||||
|
||||
};
|
||||
|
||||
var proto = Canvas3D.Camera.prototype;
|
||||
|
||||
proto.getDirty = function() {
|
||||
return this._bDirty;
|
||||
}
|
||||
|
||||
proto.setDirty = function(bDirty) {
|
||||
this._bDirty = bDirty;
|
||||
}
|
||||
|
||||
proto.setPosition = function(oPos) {
|
||||
this._oPosition.set(oPos.x, oPos.y, oPos.z);
|
||||
this._bDirty = true;
|
||||
}
|
||||
|
||||
proto.getPosition = function() {
|
||||
return this._oPosition;
|
||||
}
|
||||
|
||||
proto.setScale = function(fScale) {
|
||||
this._fScale = fScale;
|
||||
this._bDirty = true;
|
||||
}
|
||||
|
||||
proto.getScale = function() {
|
||||
return this._fScale;
|
||||
}
|
||||
|
||||
proto.getSide = function() {
|
||||
return this._oSideVec;
|
||||
}
|
||||
|
||||
proto.getUp = function() {
|
||||
return this._oUpVec;
|
||||
}
|
||||
|
||||
proto.setUp = function(oVec) {
|
||||
this._oUpVec = oVec;
|
||||
}
|
||||
|
||||
proto.getOut = function() {
|
||||
return this._oOutVec;
|
||||
}
|
||||
|
||||
proto.moveSideways = function(d) {
|
||||
this._oPosition.x += this._oSideVec.x * d;
|
||||
this._oPosition.y += this._oSideVec.y * d;
|
||||
this._oPosition.z += this._oSideVec.z * d;
|
||||
this.setDirty(true);
|
||||
}
|
||||
|
||||
proto.moveUpwards = function(d) {
|
||||
this._oPosition.x += this._oUpVec.x * d;
|
||||
this._oPosition.y += this._oUpVec.y * d;
|
||||
this._oPosition.z += this._oUpVec.z * d;
|
||||
this.setDirty(true);
|
||||
}
|
||||
|
||||
proto.moveForward = function(d) {
|
||||
this._oPosition.x += this._oOutVec.x * d;
|
||||
this._oPosition.y += this._oOutVec.y * d;
|
||||
this._oPosition.z += this._oOutVec.z * d;
|
||||
this.setDirty(true);
|
||||
}
|
||||
|
||||
// rotate around the camera's side axis with a target center point (uses camera target if oTarget is null)
|
||||
proto.pitchAroundTarget = function(fTheta, oTarget) {
|
||||
var M = new Canvas3D.Matrix3();
|
||||
var oPos = this.getPosition();
|
||||
oTarget = oTarget || this.getLookAt();
|
||||
|
||||
// translate position to target space
|
||||
oPos.subVector(oTarget);
|
||||
|
||||
// rotate around side axis
|
||||
M.loadRotationAxis(this._oSideVec, Math.sin(fTheta * Math.PI / 180.0), Math.cos(fTheta * Math.PI / 180.0));
|
||||
oPos = M.multiplyVector(oPos);
|
||||
|
||||
// translate position out of target space
|
||||
oPos.addVector(oTarget);
|
||||
|
||||
this.setPosition(oPos);
|
||||
this.setDirty(true);
|
||||
}
|
||||
|
||||
proto.yaw = function(fTheta) {
|
||||
var M = new Canvas3D.Matrix3();
|
||||
M.loadRotationAxis(this._oUpVec, Math.sin(fTheta), Math.cos(fTheta));
|
||||
this._oSideVec = M.multiplyVector(this._oSideVec);
|
||||
this._oOutVec = M.multiplyVector(this._oOutVec);
|
||||
this.setDirty(true);
|
||||
}
|
||||
|
||||
// rotate around the camera's up axis with a target center point (uses camera target if oTarget is null)
|
||||
proto.yawAroundTarget = function(fTheta, oTarget) {
|
||||
var M = new Canvas3D.Matrix3();
|
||||
var oPos = this.getPosition();
|
||||
oTarget = oTarget || this.getLookAt();
|
||||
|
||||
// translate position to target space
|
||||
oPos.subVector(oTarget);
|
||||
|
||||
// rotate around up axis
|
||||
M.loadRotationAxis(this._oUpVec, Math.sin(fTheta * Math.PI / 180.0), Math.cos(fTheta * Math.PI / 180.0));
|
||||
oPos = M.multiplyVector(oPos);
|
||||
|
||||
// translate position out of target space
|
||||
oPos.addVector(oTarget);
|
||||
|
||||
this.setPosition(oPos);
|
||||
this.setDirty(true);
|
||||
}
|
||||
|
||||
// rotate around the camera's out axis with a target center point (uses camera target if oTarget is null)
|
||||
proto.rollAroundTarget = function(fTheta, oTarget) {
|
||||
var M = new Canvas3D.Matrix3();
|
||||
var oPos = this.getPosition();
|
||||
oTarget = oTarget || this.getLookAt();
|
||||
|
||||
// translate position to target space
|
||||
oPos.subVector(oTarget);
|
||||
|
||||
// rotate around out axis
|
||||
M.loadRotationAxis(this._oOutVec, Math.sin(fTheta * Math.PI / 180.0), Math.cos(fTheta * Math.PI / 180.0));
|
||||
oPos = M.multiplyVector(oPos);
|
||||
|
||||
// translate position out of target space
|
||||
oPos.addVector(oTarget);
|
||||
|
||||
this.setPosition(oPos);
|
||||
this.setDirty(true);
|
||||
}
|
||||
|
||||
proto.rotateY = function(sine, cosine) {
|
||||
var M = new Canvas3D.Matrix3();
|
||||
M.loadRotationY(sine, cosine);
|
||||
this._oSideVec = M.multiplyVector(this._oSideVec);
|
||||
this._oUpVec = M.multiplyVector(this._oUpVec);
|
||||
this._oOutVec = M.multiplyVector(this._oOutVec);
|
||||
this.setDirty(true);
|
||||
}
|
||||
|
||||
|
||||
proto.lookAt = function(P, Up) {
|
||||
Up = Up || this._oUpVec;
|
||||
this._oOutVec = P.returnSub(this._oPosition).unit();
|
||||
|
||||
//this._oSideVec = this._oOutVec.cross(new Canvas3D.Vec3 (0.0, 1.0, 0.0)).unit();
|
||||
//this._oSideVec = this._oOutVec.cross(this._oUpVec).unit();
|
||||
this._oSideVec = this._oOutVec.cross(Up).unit();
|
||||
this._oUpVec = this._oSideVec.cross(this._oOutVec).unit();
|
||||
this._vecLookAt = P.clone();
|
||||
this.setDirty(true);
|
||||
}
|
||||
|
||||
proto.getLookAt = function() {
|
||||
return this._vecLookAt;
|
||||
}
|
||||
|
||||
proto.updateRotationMatrix = function() {
|
||||
var e0 = this._oRotMat.e[0];
|
||||
var e1 = this._oRotMat.e[1];
|
||||
var e2 = this._oRotMat.e[2];
|
||||
|
||||
e0[0] = this._oSideVec.x;
|
||||
e0[1] = this._oSideVec.y;
|
||||
e0[2] = this._oSideVec.z;
|
||||
|
||||
e1[0] = this._oUpVec.x;
|
||||
e1[1] = this._oUpVec.y;
|
||||
e1[2] = this._oUpVec.z;
|
||||
|
||||
e2[0] = this._oOutVec.x;
|
||||
e2[1] = this._oOutVec.y;
|
||||
e2[2] = this._oOutVec.z;
|
||||
}
|
||||
|
||||
proto.transformPoint = function(P) {
|
||||
var e = this._oRotMat.e;
|
||||
var oPos = this._oPosition;
|
||||
|
||||
var e0 = e[0];
|
||||
var e1 = e[1];
|
||||
var e2 = e[2];
|
||||
|
||||
var vx = P.x - oPos.x;
|
||||
var vy = P.y - oPos.y;
|
||||
var vz = P.z - oPos.z;
|
||||
|
||||
return new Canvas3D.Vec3(
|
||||
(vx * e0[0] + vy * e0[1] + vz * e0[2]),
|
||||
(vx * e1[0] + vy * e1[1] + vz * e1[2]),
|
||||
(vx * e2[0] + vy * e2[1] + vz * e2[2])
|
||||
);
|
||||
}
|
||||
|
||||
proto.project = function(P) {
|
||||
var fFocal = this._fFocal;
|
||||
return {
|
||||
x: P.x * fFocal / (P.z + this._fFocalDistance) * this._fScale * (this._bReverseX?-1:1),
|
||||
y: -P.y * fFocal / (P.z + this._fFocalDistance) * this._fScale * (this._bReverseY?-1:1)
|
||||
};
|
||||
}
|
||||
|
||||
proto.clip = function(P) {
|
||||
if (P.z < 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
proto.isBehind = function(P) {
|
||||
if (P.z > 0) return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
proto.getClipNear = function() {
|
||||
return this._iClipNear;
|
||||
}
|
||||
|
||||
proto.getClipFar = function() {
|
||||
return this._iClipFar;
|
||||
}
|
||||
|
||||
proto.clip = function(P) {
|
||||
if (P.z > this._iClipNear && P.z < this._iClipFar) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
proto.setFOV = function(fFOV) {
|
||||
this._fFOV = fFOV;
|
||||
var fFocal = 1 / Math.tan(105 * Math.PI*Math.PI / (180*180 * 2));
|
||||
this._fFocal = fFocal;
|
||||
this._fFocalDistance = fFocal;
|
||||
}
|
||||
|
||||
proto.getFOV = function() {
|
||||
return this._fFOV;
|
||||
}
|
||||
|
||||
proto.getFocal = function() {
|
||||
return this._fFocal;
|
||||
}
|
||||
|
||||
proto.setFocalDistance = function(fValue) {
|
||||
this._fFocalDistance = fValue;
|
||||
}
|
||||
|
||||
proto.setReverseX = function(bEnable) {
|
||||
this._bReverseX = bEnable;
|
||||
}
|
||||
|
||||
proto.setReverseY = function(bEnable) {
|
||||
this._bReverseY = bEnable;
|
||||
}
|
|
@ -1,75 +0,0 @@
|
|||
/*
|
||||
* Javascript/Canvas Textured 3D Renderer v0.3
|
||||
* Copyright (c) 2008 Jacob Seidelin, cupboy@gmail.com
|
||||
* This software is free to use for non-commercial purposes. For anything else, please contact the author.
|
||||
* This is a version modified by Stefano Gioffre'.
|
||||
*/
|
||||
|
||||
var __iLightIDCounter = 0;
|
||||
|
||||
Canvas3D.Light = function() {
|
||||
this._oPosition = new Canvas3D.Vec3(0,0,0);
|
||||
this._oColor = {r:255,g:255,b:255};
|
||||
this._fIntensity = 1.0;
|
||||
|
||||
this._iLightID = ++__iLightIDCounter;
|
||||
};
|
||||
|
||||
var proto = Canvas3D.Light.prototype;
|
||||
|
||||
proto.setPosition = function(oPos) {
|
||||
this._oPosition = oPos;
|
||||
this._bDirty = true;
|
||||
}
|
||||
|
||||
proto.getPosition = function() {
|
||||
return this._oPosition;
|
||||
}
|
||||
|
||||
proto.setColor = function(oColor) {
|
||||
this._oColor = oColor;
|
||||
this._bDirty = true;
|
||||
}
|
||||
|
||||
proto.getColor = function() {
|
||||
return this._oColor;
|
||||
}
|
||||
|
||||
proto.setIntensity = function(fIntensity) {
|
||||
this._fIntensity = fIntensity;
|
||||
this._bDirty = true;
|
||||
}
|
||||
|
||||
proto.getIntensity = function(fIntensity) {
|
||||
return this._fIntensity;
|
||||
}
|
||||
|
||||
proto.setScene = function(oScene) {
|
||||
if (this._oScene != oScene) {
|
||||
this._oScene = oScene;
|
||||
this._bDirty = true;
|
||||
}
|
||||
}
|
||||
|
||||
proto.draw = function(oContext, iOffsetX, iOffsetY) {
|
||||
var oScene = this._oScene;
|
||||
var oCam = oScene.getActiveCamera();
|
||||
|
||||
var oPos2D = oCam.transform2D(oCam.transformPoint(this._oPosition));
|
||||
|
||||
var iRadius = 3;
|
||||
|
||||
oContext.beginPath();
|
||||
oContext.moveTo(oPos2D.x + iOffsetX + iRadius, oPos2D.y + iOffsetY);
|
||||
oContext.arc(oPos2D.x + iOffsetX, oPos2D.y + iOffsetY, iRadius, 0, 360, false);
|
||||
oContext.fillStyle = "rgb(255,255,0)";
|
||||
oContext.fill();
|
||||
}
|
||||
|
||||
proto.getDirty = function() {
|
||||
return this._bDirty;
|
||||
}
|
||||
|
||||
proto.setDirty = function(bDirty) {
|
||||
this._bDirty = bDirty;
|
||||
}
|
|
@ -1,122 +0,0 @@
|
|||
/*
|
||||
* Javascript/Canvas Textured 3D Renderer v0.3
|
||||
* Copyright (c) 2008 Jacob Seidelin, cupboy@gmail.com
|
||||
* This software is free to use for non-commercial purposes. For anything else, please contact the author.
|
||||
* This is a version modified by Stefano Gioffre'.
|
||||
*/
|
||||
|
||||
Canvas3D.Matrix3 = function() {
|
||||
this.e = [
|
||||
[1.0, 0.0, 0.0],
|
||||
[0.0, 1.0, 0.0],
|
||||
[0.0, 0.0, 1.0]
|
||||
];
|
||||
}
|
||||
|
||||
Canvas3D.Matrix3.prototype.multiplyVector = function(v) {
|
||||
var p = new Canvas3D.Vec3;
|
||||
var e0 = this.e[0], e1 = this.e[1], e2 = this.e[2];
|
||||
|
||||
var vx = v.x, vy = v.y, vz = v.z;
|
||||
|
||||
p.x = vx * e0[0] + vy * e0[1] + vz * e0[2];
|
||||
p.y = vx * e1[0] + vy * e1[1] + vz * e1[2];
|
||||
p.z = vx * e2[0] + vy * e2[1] + vz * e2[2];
|
||||
return p;
|
||||
}
|
||||
|
||||
Canvas3D.Matrix3.prototype.multiplyMatrix = function(M) {
|
||||
var p = new Canvas3D.Matrix3();
|
||||
var e0 = this.e[0], e1 = this.e[1], e2 = this.e[2];
|
||||
|
||||
var m0 = M.e[0], m1 = M.e[1], m2 = M.e[2];
|
||||
|
||||
var e00 = e0[0], e01 = e0[1], e02 = e0[2];
|
||||
var e10 = e1[0], e11 = e1[1], e12 = e1[2];
|
||||
var e20 = e2[0], e21 = e2[1], e22 = e2[2];
|
||||
|
||||
var m00 = m0[0], m01 = m0[1], m02 = m0[2];
|
||||
var m10 = m1[0], m11 = m1[1], m12 = m1[2];
|
||||
var m20 = m2[0], m21 = m2[1], m22 = m2[2];
|
||||
|
||||
p.e[0][0] = m00 * e00 + m10 * e01 + m20 * e02;
|
||||
p.e[0][1] = m01 * e00 + m11 * e01 + m21 * e02;
|
||||
p.e[0][2] = m02 * e00 + m12 * e01 + m22 * e02;
|
||||
|
||||
p.e[1][0] = m00 * e10 + m10 * e11 + m20 * e12;
|
||||
p.e[1][1] = m01 * e10 + m11 * e11 + m21 * e12;
|
||||
p.e[1][2] = m02 * e10 + m12 * e11 + m22 * e12;
|
||||
|
||||
p.e[2][0] = m00 * e20 + m10 * e21 + m20 * e22;
|
||||
p.e[2][1] = m01 * e20 + m11 * e21 + m21 * e22;
|
||||
p.e[2][2] = m02 * e20 + m12 * e21 + m22 * e22;
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
Canvas3D.Matrix3.prototype.transpose = function() {
|
||||
var t = new Canvas3D.Matrix3();
|
||||
t.e[0][0] = this.e[0][0];
|
||||
t.e[0][1] = this.e[1][0];
|
||||
t.e[0][2] = this.e[2][0];
|
||||
t.e[1][0] = this.e[0][1];
|
||||
t.e[1][1] = this.e[1][1];
|
||||
t.e[1][2] = this.e[2][1];
|
||||
t.e[2][0] = this.e[0][2];
|
||||
t.e[2][1] = this.e[1][2];
|
||||
t.e[2][2] = this.e[2][2];
|
||||
return t;
|
||||
}
|
||||
|
||||
Canvas3D.Matrix3.prototype.loadIdentity = function() {
|
||||
var e0 = this.e[0], e1 = this.e[1], e2 = this.e[2];
|
||||
e0[0] = 1; e0[1] = 0; e0[2] = 0;
|
||||
e1[0] = 0; e1[1] = 1; e1[2] = 0;
|
||||
e2[0] = 0; e2[1] = 0; e2[2] = 1;
|
||||
}
|
||||
|
||||
Canvas3D.Matrix3.prototype.loadRotationX = function(s, c) {
|
||||
var e0 = this.e[0], e1 = this.e[1], e2 = this.e[2];
|
||||
e0[0] = 1; e0[1] = 0; e0[2] = 0;
|
||||
e1[0] = 0; e1[1] = c; e1[2] = -s;
|
||||
e2[0] = 0; e2[1] = s; e2[2] = c;
|
||||
}
|
||||
|
||||
Canvas3D.Matrix3.prototype.loadRotationY = function(s, c) {
|
||||
var e0 = this.e[0], e1 = this.e[1], e2 = this.e[2];
|
||||
e0[0] = c; e0[1] = 0; e0[2] = s;
|
||||
e1[0] = 0; e1[1] = 1; e1[2] = 0;
|
||||
e2[0] = -s; e2[1] = 0; e2[2] = c;
|
||||
}
|
||||
|
||||
Canvas3D.Matrix3.prototype.loadRotationZ = function(s, c) {
|
||||
var e0 = this.e[0], e1 = this.e[1], e2 = this.e[2];
|
||||
e0[0] = c; e0[1] = -s; e0[2] = 0;
|
||||
e1[0] = s; e1[1] = c; e1[2] = 0;
|
||||
e2[0] = 0; e2[1] = 0; e2[2] = 1;
|
||||
}
|
||||
|
||||
Canvas3D.Matrix3.prototype.loadRotationAxis = function(A, s, c) {
|
||||
var t = 1 - c;
|
||||
var tx = t * A.x;
|
||||
var ty = t * A.y;
|
||||
var txx = tx * A.x;
|
||||
var txy = tx * A.y;
|
||||
var txz = tx * A.z;
|
||||
var tyy = ty * A.y;
|
||||
var tyz = ty * A.z;
|
||||
var tzz = t * A.z * A.z;
|
||||
var sx = s * A.x;
|
||||
var sy = s * A.y;
|
||||
var sz = s * A.z;
|
||||
|
||||
this.e[0][0] = txx + c;
|
||||
this.e[0][1] = txy - sz;
|
||||
this.e[0][2] = txz + sy;
|
||||
this.e[1][0] = txy + sz;
|
||||
this.e[1][1] = tyy + c;
|
||||
this.e[1][2] = tyz - sx;
|
||||
this.e[2][0] = txz - sy;
|
||||
this.e[2][1] = tyz + sx;
|
||||
this.e[2][2] = tzz + c;
|
||||
}
|
|
@ -1,906 +0,0 @@
|
|||
/*
|
||||
* Javascript/Canvas Textured 3D Renderer v0.3.1
|
||||
* Copyright (c) 2008 Jacob Seidelin, cupboy@gmail.com
|
||||
* This software is free to use for non-commercial purposes. For anything else, please contact the author.
|
||||
* This is a version modified by Stefano Gioffre'.
|
||||
*/
|
||||
|
||||
Canvas3D.Mesh = function() {
|
||||
|
||||
this._oPosition = new Canvas3D.Vec3(0,0,0);
|
||||
this._oRotation = new Canvas3D.Vec3(0,0,0);
|
||||
|
||||
this._aVertices = []; // vertex positions in object space
|
||||
this._aGlobalVertices = []; // vertices translated to global space
|
||||
this._aFaces = [];
|
||||
this._aNormals = [];
|
||||
this._aMaterials = [];
|
||||
|
||||
this._bDirty = true;
|
||||
|
||||
this._bVisible = true;
|
||||
|
||||
this._iForcedZ = -1;
|
||||
this._bHideWhenRotating = false;
|
||||
|
||||
this._oDefaultColor = {r:155,g:155,b:155};
|
||||
this._oDefaultMaterial = {};
|
||||
this._iSize = 1;
|
||||
|
||||
this._fScale = 1;
|
||||
|
||||
this._bFill = true; // render filled triangles
|
||||
this._bWire = false; // render wireframe
|
||||
this._bShading = true; // shade/light filled triangles
|
||||
this._bBackfaceCull = true; // only draw triangles facing the camera
|
||||
this._bZSort = true; // sort triangles back-to-front
|
||||
this._bExpandClipPath = true; // expand clip path by 1px, to minimize gaps
|
||||
|
||||
this._bTexture = false; // render textured triangles (must enable bFill as well)
|
||||
this._bTextureShading = false; // render shading on textured triangles (must enable bShading as well)
|
||||
|
||||
// sometimes the exported normals from Max are messed up, or they're imported wrong or whatever, I don't know.
|
||||
// We can recalculate them after loading.
|
||||
this._bCalcNormals = true;
|
||||
|
||||
// only allow textures if canvas is available
|
||||
var oCanvas = document.createElement("canvas");
|
||||
this._bCanTexture = false;
|
||||
this._bCanTextureUV = false;
|
||||
if (oCanvas.getContext && oCanvas.getContext("2d")) {
|
||||
this._bCanTexture = true;
|
||||
if (oCanvas.getContext("2d").getImageData) {
|
||||
this._bCanTextureUV = true;
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// parse the mesh data
|
||||
// the mesh data (vertices, faces, texture coordinates, materials) are read from a JSON object structure
|
||||
// and copied into local arrays
|
||||
// normals are recalculated, if enabled.
|
||||
Canvas3D.Mesh.prototype.setMeshData = function(oMeshData, oScene) {
|
||||
this._oMeshData = oMeshData;
|
||||
|
||||
this._aVertices = [];
|
||||
this._aFaces = [];
|
||||
this._aNormals = [];
|
||||
this._aMaterials = [];
|
||||
|
||||
var oPos = this._oPosition;
|
||||
|
||||
var me = this;
|
||||
|
||||
if (this._oMeshData.mat) {
|
||||
for (var m=0;m<this._oMeshData.mat.length;m++) {
|
||||
var oMat = this._oMeshData.mat[m];
|
||||
oMat.idx = m;
|
||||
if (oMat.t) {
|
||||
oMat.image = new Image();
|
||||
if (oMat.uv && this._bCanTextureUV) {
|
||||
oMat.image.mat = oMat;
|
||||
oMat.image.onload = function() {
|
||||
me._bakeTexture(this.mat);
|
||||
if (oScene) {
|
||||
oScene.setDirty(true);
|
||||
}
|
||||
this.onload = null;
|
||||
}
|
||||
}
|
||||
oMat.image.src = "textures/" + oMat.t;
|
||||
}
|
||||
this._aMaterials.push(oMat);
|
||||
}
|
||||
}
|
||||
|
||||
for (var o=0;o<this._oMeshData.obj.length;o++) {
|
||||
|
||||
var oObject = this._oMeshData.obj[o];
|
||||
var aVertices = oObject.vrt;
|
||||
var aTexCoords = oObject.tex;
|
||||
|
||||
this._aTexCoords = aTexCoords;
|
||||
|
||||
var iVertOffset = this._aVertices.length;
|
||||
|
||||
var fTotalX = 0;
|
||||
var fTotalY = 0;
|
||||
var fTotalZ = 0;
|
||||
|
||||
var iNumVertices = aVertices.length;
|
||||
|
||||
for (var v=0;v<iNumVertices;v++) {
|
||||
var oVertex = new Canvas3D.Vec3(
|
||||
aVertices[v][0],
|
||||
aVertices[v][1],
|
||||
aVertices[v][2]
|
||||
);
|
||||
|
||||
this._aVertices.push(oVertex);
|
||||
|
||||
this._aGlobalVertices.push(
|
||||
new Canvas3D.Vec3(
|
||||
oVertex.x + oPos.x,
|
||||
oVertex.y + oPos.y,
|
||||
oVertex.z + oPos.z
|
||||
)
|
||||
);
|
||||
|
||||
fTotalX += oVertex.x;
|
||||
fTotalY += oVertex.y;
|
||||
fTotalZ += oVertex.z;
|
||||
}
|
||||
|
||||
var fAvgX = fTotalX / iNumVertices;
|
||||
var fAvgY = fTotalY / iNumVertices;
|
||||
var fAvgZ = fTotalZ / iNumVertices;
|
||||
|
||||
var oLocalCenter = new Canvas3D.Vec3(fAvgX, fAvgY, fAvgZ);
|
||||
|
||||
var aFaces = oObject.fac;
|
||||
for (var f=0;f<aFaces.length;f++) {
|
||||
var oFace = aFaces[f];
|
||||
|
||||
var oPoint1 = this._aGlobalVertices[oFace[0] + iVertOffset];
|
||||
var oPoint2 = this._aGlobalVertices[oFace[1] + iVertOffset];
|
||||
var oPoint3 = this._aGlobalVertices[oFace[2] + iVertOffset];
|
||||
|
||||
var oCenter = new Canvas3D.Vec3(
|
||||
(oPoint1.x + oPoint2.x + oPoint3.x) / 3,
|
||||
(oPoint1.y + oPoint2.y + oPoint3.y) / 3,
|
||||
(oPoint1.z + oPoint2.z + oPoint3.z) / 3
|
||||
);
|
||||
|
||||
var oNormal = new Canvas3D.Vec3(
|
||||
oObject.nrm[f][0],
|
||||
oObject.nrm[f][1],
|
||||
oObject.nrm[f][2]
|
||||
);
|
||||
|
||||
var oFace = {
|
||||
a : oFace[0] + iVertOffset,
|
||||
b : oFace[1] + iVertOffset,
|
||||
c : oFace[2] + iVertOffset,
|
||||
normal : oNormal,
|
||||
center : oCenter,
|
||||
mat : oFace[3],
|
||||
idx : f,
|
||||
lights : []
|
||||
}
|
||||
|
||||
this._aFaces.push(oFace);
|
||||
}
|
||||
|
||||
if (this._bCalcNormals) {
|
||||
this._recalcNormals();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// here we prepare the texture for easy rendering.
|
||||
// For each face, a triangular region is drawn onto a canvas containing the image data for that face
|
||||
// We draw a triangular section on the destination canvas containing the corresponding pixel data from the source texture,
|
||||
// using the UV coords to retrieve the correct pixels
|
||||
// that way, we have all texture parts rotated and scaled into a common form, so they can easily be drawn later
|
||||
// at the moment, the data is read with getImageData and is rather slow, but it should be possible do to sort of the reverse process
|
||||
// of the drawTextureTriangle transform to draw these texture parts.
|
||||
Canvas3D.Mesh.prototype._bakeTexture = function(oMat) {
|
||||
|
||||
var f = this._aFaces.length;
|
||||
|
||||
var aTexFaces = [];
|
||||
// find all face that need this texture
|
||||
do {
|
||||
var oFace = this._aFaces[f-1];
|
||||
if (oFace.mat == oMat.idx) {
|
||||
aTexFaces.push(oFace);
|
||||
oFace.texidx = aTexFaces.length-1;
|
||||
}
|
||||
} while (--f)
|
||||
|
||||
f = aTexFaces.length;
|
||||
if (f < 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
var fc = aTexFaces.length;
|
||||
|
||||
var iTexRes = oMat.res;
|
||||
var iTexWidth = iTexRes * f + f*2;
|
||||
var iTexHeight = iTexRes + 2;
|
||||
|
||||
var iSrcWidth = oMat.w;
|
||||
var iSrcHeight = oMat.h;
|
||||
|
||||
// create canvas for source texture image and paint the texture on it
|
||||
var oSource = document.createElement("canvas");
|
||||
oSource.width = iSrcWidth;
|
||||
oSource.height = iSrcHeight;
|
||||
oSource.style.width = iSrcWidth+"px";
|
||||
oSource.style.height = iSrcHeight+"px";
|
||||
var oSrcCtx = oSource.getContext("2d");
|
||||
oSrcCtx.drawImage(oMat.image, 0, 0, iSrcWidth, iSrcHeight);
|
||||
var oSrcDataObj = oSrcCtx.getImageData(0, 0, iSrcWidth, iSrcHeight);
|
||||
var aSrcData = oSrcDataObj.data;
|
||||
|
||||
// create canvas for finished face textures.
|
||||
var oTexCanvas = document.createElement("canvas");
|
||||
oTexCanvas.width = iTexWidth;
|
||||
oTexCanvas.height = iTexHeight;
|
||||
oTexCanvas.style.width = iTexWidth+"px";
|
||||
oTexCanvas.style.height = (iTexHeight)+"px";
|
||||
oTexCanvas.style.backgroundColor = "rgb(255,0,255)";
|
||||
oTexCanvas.resolution = iTexRes;
|
||||
var oDstCtx = oTexCanvas.getContext("2d");
|
||||
oDstCtx.fillStyle = "rgb(255,0,255)";
|
||||
oDstCtx.fillRect(0,0,iTexWidth,iTexHeight);
|
||||
|
||||
var oDstDataObj = oDstCtx.getImageData(0, 0, iTexWidth, iTexHeight);
|
||||
var aDstData = oDstDataObj.data;
|
||||
|
||||
var oContext = oTexCanvas.getContext("2d");
|
||||
|
||||
//uncomment to see how the texture is prepared
|
||||
//document.body.appendChild(oSource);
|
||||
//document.body.appendChild(oTexCanvas);
|
||||
|
||||
var iTexOffsetX = iTexRes;
|
||||
|
||||
do {
|
||||
var oFace = aTexFaces[f-1];
|
||||
|
||||
var oCoords = this._aTexCoords[oFace.idx];
|
||||
|
||||
var oTexPoint1 = oCoords[1];
|
||||
var oTexPoint2 = oCoords[2];
|
||||
var oTexPoint3 = oCoords[0];
|
||||
|
||||
var x1 = oTexPoint1[0] * iSrcWidth;
|
||||
var y1 = (1 - oTexPoint1[1]) * iSrcHeight;
|
||||
var x3 = oTexPoint2[0] * iSrcWidth;
|
||||
var y3 = (1 - oTexPoint2[1]) * iSrcHeight;
|
||||
var x2 = oTexPoint3[0] * iSrcWidth;
|
||||
var y2 = (1 - oTexPoint3[1]) * iSrcHeight;
|
||||
|
||||
var fUnitAX = (x2 - x1);
|
||||
var fUnitAY = (y2 - y1);
|
||||
|
||||
var fUnitBX = (x3 - x2);
|
||||
var fUnitBY = (y3 - y2);
|
||||
|
||||
var iOffsetX = 0;
|
||||
|
||||
var iDstXOffset = (iTexWidth - iTexOffsetX - (fc-f)*2-2);
|
||||
|
||||
// we paint the triangular texture with a 1px margin on each side and let the texture spill over into this margin.
|
||||
// this is to prevent small transparent gaps to appear between the triangles when they are rotated and scaled into place during rendering.
|
||||
|
||||
var y = iTexRes+2;
|
||||
do {
|
||||
var iDstY = iTexRes+2-y;
|
||||
var fStepY = (iTexRes+1-y) / iTexRes;
|
||||
|
||||
var fStepYUnitBX = fStepY*fUnitBX;
|
||||
var fStepYUnitBY = fStepY*fUnitBY;
|
||||
|
||||
var iDstYOffset = iDstY*iTexWidth*4;
|
||||
|
||||
var x = iTexRes+2 - iOffsetX;
|
||||
do {
|
||||
var iDstX = x + iDstXOffset - 1;
|
||||
var fStepX = (x-1 + iOffsetX) / iTexRes;
|
||||
|
||||
var iSrcX = Math.floor(x1 + fStepX*fUnitAX + fStepYUnitBX);
|
||||
var iSrcY = Math.floor(y1 + fStepX*fUnitAY + fStepYUnitBY);
|
||||
|
||||
if (iSrcX < 0) iSrcX = 0;
|
||||
if (iSrcY < 0) iSrcY = 0;
|
||||
|
||||
if (iSrcX >= iSrcWidth) iSrcX = iSrcWidth-1;
|
||||
if (iSrcY >= iSrcHeight) iSrcY = iSrcHeight-1;
|
||||
|
||||
var iDstPixOffset = iDstYOffset + iDstX*4;
|
||||
var iSrcPixOffset = (iSrcY*iSrcWidth + iSrcX)*4;
|
||||
|
||||
aDstData[iDstPixOffset] = aSrcData[iSrcPixOffset];
|
||||
aDstData[iDstPixOffset+1] = aSrcData[iSrcPixOffset+1];
|
||||
aDstData[iDstPixOffset+2] = aSrcData[iSrcPixOffset+2];
|
||||
|
||||
aDstData[iDstPixOffset+3] = oMat.texalpha ? aSrcData[iSrcPixOffset+3] : 255;
|
||||
|
||||
} while (--x);
|
||||
|
||||
iOffsetX++;
|
||||
iDstXOffset++;
|
||||
|
||||
} while (--y);
|
||||
|
||||
iTexOffsetX += iTexRes;
|
||||
|
||||
} while (--f);
|
||||
|
||||
oDstCtx.putImageData(oDstDataObj, 0, 0);
|
||||
oDstCtx.fillRect(0,0,0,0); // Opera doesn't update until we draw something?
|
||||
oMat.facecanvas = oTexCanvas;
|
||||
}
|
||||
|
||||
var fncZSort = function(a, b) {
|
||||
return a.transcenter.z - b.transcenter.z;
|
||||
}
|
||||
|
||||
// math and misc shortcuts
|
||||
var sin = Math.sin;
|
||||
var cos = Math.cos;
|
||||
var asin = Math.asin;
|
||||
var acos = Math.acos;
|
||||
var pow = Math.pow;
|
||||
var sqrt = Math.sqrt;
|
||||
|
||||
var fRadDeg = 180 / Math.PI;
|
||||
var fDegRad = Math.PI / 180;
|
||||
var fDegRad45 = fDegRad*45;
|
||||
var fDegRad90 = fDegRad*90;
|
||||
var fDegRad180 = fDegRad*180;
|
||||
var fSqrt2Div2 = sqrt(2) / 2;
|
||||
|
||||
// this functions draws a textured (and shaded) triangle on the canvas
|
||||
// this is done by rotating/scaling a triangular section in place, setting up a clipping path and drawing the image.
|
||||
// if UV coords are enabled, only the correct part of the triangle-strip texture is drawn
|
||||
// if not, the entire texture is drawn for each face
|
||||
// some of the code used for skewing the image was inspired by the AS function found here:
|
||||
// http://www.senocular.com/flash/actionscript.php?file=ActionScript_1.0/Prototypes/MovieClip/skew.as
|
||||
|
||||
Canvas3D.Mesh.prototype._drawTextureTriangle = function(oContext, oMat, oPoint1, oPoint2, oPoint3, iOffsetX, iOffsetY, fShade, oNormal, iIdx) {
|
||||
if (!oMat.image) {
|
||||
return;
|
||||
}
|
||||
if (!oMat.image.complete) {
|
||||
return;
|
||||
}
|
||||
|
||||
var oMatImage = oMat.image;
|
||||
|
||||
if (!oMatImage.canvas) {
|
||||
// first time around, we paint the texture image to a canvas
|
||||
// drawing the triangle later on is slightly faster using another canvas object rather than an image object
|
||||
// this should be moved to someplace else
|
||||
|
||||
var iTexWidth = 50;
|
||||
var iTexHeight = 50;
|
||||
|
||||
var oTextureCanvas = document.createElement("canvas");
|
||||
|
||||
oTextureCanvas.width = iTexWidth;
|
||||
oTextureCanvas.height = iTexHeight;
|
||||
|
||||
oTextureCanvas.style.width = iTexWidth + "px";
|
||||
oTextureCanvas.style.height = iTexHeight + "px";
|
||||
|
||||
var oTexCtx = oTextureCanvas.getContext("2d");
|
||||
oTexCtx.drawImage(oMatImage, 0, 0, iTexWidth, iTexHeight);
|
||||
|
||||
oMatImage.canvas = oTextureCanvas;
|
||||
}
|
||||
|
||||
var x1 = oPoint1.x;
|
||||
var y1 = oPoint1.y;
|
||||
var x2 = oPoint2.x;
|
||||
var y2 = oPoint2.y;
|
||||
var x3 = oPoint3.x;
|
||||
var y3 = oPoint3.y;
|
||||
|
||||
// trig to calc the angle we need to rotate in order get our texturetriangle in place
|
||||
var dx = x3 - x2;
|
||||
var dy = y3 - y2;
|
||||
var a = sqrt((dx*dx + dy*dy));
|
||||
|
||||
dx = x3 - x1;
|
||||
dy = y3 - y1;
|
||||
var b = sqrt((dx*dx + dy*dy));
|
||||
|
||||
dx = x2 - x1;
|
||||
dy = y2 - y1;
|
||||
var c = sqrt((dx*dx + dy*dy));
|
||||
|
||||
var aa = a*a, bb = b*b, cc = c*c;
|
||||
|
||||
var fCosB = (aa + cc - bb) / (2*a*c);
|
||||
var fAngleB = acos(fCosB);
|
||||
if (isNaN(fAngleB)) return;
|
||||
|
||||
var fCosC = (aa + bb - cc) / (2*a*b);
|
||||
var fAngleC = acos(fCosC);
|
||||
if (isNaN(fAngleC)) return;
|
||||
|
||||
if ((fAngleB + fAngleC) == 0) return;
|
||||
|
||||
var fSkewX = -(fDegRad90 - (fAngleB + fAngleC));
|
||||
|
||||
var fTriRotation = -(asin((y2 - y1) / c));
|
||||
|
||||
if (x2 > x1) { // rotate the other way around if triangle is flipped
|
||||
fTriRotation = fDegRad180 - fTriRotation;
|
||||
}
|
||||
|
||||
if (fSkewX == fDegRad90) fSkewX = fDegRad*89.99;
|
||||
if (fSkewX == -fDegRad90) fSkewX = -fDegRad*89.99;
|
||||
|
||||
var fCosX = cos(fSkewX);
|
||||
|
||||
var fRotation = fDegRad45 + fSkewX * 0.5;
|
||||
|
||||
var fDiv = 1 / (sin(fRotation) * fSqrt2Div2);
|
||||
|
||||
var fScaleX = fCosX * fDiv;
|
||||
var fScaleY = (sin(fSkewX) + 1) * fDiv;
|
||||
|
||||
// setup the clipping path, so only texture within the triangle is drawn.
|
||||
var iClipX1 = x1 + iOffsetX;
|
||||
var iClipY1 = y1 + iOffsetY;
|
||||
|
||||
var iClipX2 = x2 + iOffsetX;
|
||||
var iClipY2 = y2 + iOffsetY;
|
||||
|
||||
var iClipX3 = x3 + iOffsetX;
|
||||
var iClipY3 = y3 + iOffsetY;
|
||||
|
||||
// here we try to expand the clip path by 1 pixel to get rid of (some of the) gaps between the triangles
|
||||
// we do this simply by moving the topmost point 1px up, the leftmost point 1px left, and so on.
|
||||
// later, we also render the triangle itself 1 px too big
|
||||
// drawbacks are that the contour of the object will appear a bit "pointy".
|
||||
if (this._bExpandClipPath && false) {
|
||||
if (iClipY1 < iClipY2 && iClipY1 < iClipY3)
|
||||
iClipY1--;
|
||||
else if (iClipY2 < iClipY1 && iClipY2 < iClipY3)
|
||||
iClipY2--;
|
||||
else if (iClipY3 < iClipY1 && iClipY3 < iClipY2)
|
||||
iClipY3--;
|
||||
|
||||
if (iClipY1 > iClipY2 && iClipY1 > iClipY3)
|
||||
iClipY1++;
|
||||
else if (iClipY2 > iClipY1 && iClipY2 > iClipY3)
|
||||
iClipY2++;
|
||||
else if (iClipY3 > iClipY1 && iClipY3 > iClipY2)
|
||||
iClipY3++;
|
||||
|
||||
if (iClipX1 < iClipX2 && iClipX1 < iClipX3)
|
||||
iClipX1--;
|
||||
else if (iClipX2 < iClipX1 && iClipX2 < iClipX3)
|
||||
iClipX2--;
|
||||
else if (iClipX3 < iClipX1 && iClipX3 < iClipX2)
|
||||
iClipX3--;
|
||||
|
||||
if (iClipX1 > iClipX2 && iClipX1 > iClipX3)
|
||||
iClipX1++;
|
||||
else if (iClipX2 > iClipX1 && iClipX2 > iClipX3)
|
||||
iClipX2++;
|
||||
else if (iClipX3 > iClipX1 && iClipX3 > iClipX2)
|
||||
iClipX3++;
|
||||
}
|
||||
|
||||
oContext.save();
|
||||
|
||||
// do the clip path
|
||||
oContext.beginPath();
|
||||
oContext.moveTo(iClipX1, iClipY1);
|
||||
oContext.lineTo(iClipX2, iClipY2);
|
||||
oContext.lineTo(iClipX3, iClipY3);
|
||||
oContext.closePath();
|
||||
oContext.clip();
|
||||
|
||||
// setup the skew/rotation transformation
|
||||
oContext.translate(x2 + iOffsetX, y2 + iOffsetY);
|
||||
oContext.rotate(fRotation + fTriRotation);
|
||||
oContext.scale(fScaleX, fScaleY);
|
||||
oContext.rotate(-fDegRad45);
|
||||
|
||||
var fTriScaleX = c / 2; // 100 * 50;
|
||||
var fTriScaleY = b / 2; // 100 * 50;
|
||||
|
||||
if (oMat.uv) {
|
||||
// we are using UV coordinates for texturing
|
||||
if (this._bCanTextureUV && oMat.facecanvas) {
|
||||
var iTexRes = oMat.facecanvas.resolution;
|
||||
// draw our texture
|
||||
// there will be a small gap between the triangles. Drawing the texture at offset (-1,-1) gets rid of some of it.
|
||||
oContext.drawImage(
|
||||
oMat.facecanvas,
|
||||
iIdx * iTexRes + iIdx*2+1, 1, iTexRes, iTexRes,
|
||||
-1, -1,
|
||||
fTriScaleX + 2,
|
||||
fTriScaleY + 2
|
||||
);
|
||||
}
|
||||
} else {
|
||||
// no UV, just draw the same texture for all faces
|
||||
oContext.drawImage(
|
||||
oMatImage.canvas,
|
||||
-1, -1,
|
||||
fTriScaleX + 2,
|
||||
fTriScaleY + 2
|
||||
);
|
||||
}
|
||||
|
||||
oContext.restore();
|
||||
|
||||
// if shading is turned on, render a semi-transparent black triangle on top.
|
||||
// that means that a fully lit triangle will just be the raw texture, and the less lit a triangle is, the darker it gets.
|
||||
// we could render semi-transparent white on top to make it brighter, but it doesn't look right, so we settle for that.
|
||||
if (this._bTextureShading && fShade > 0) {
|
||||
oContext.beginPath();
|
||||
oContext.moveTo(iClipX1, iClipY1);
|
||||
oContext.lineTo(iClipX2, iClipY2);
|
||||
oContext.lineTo(iClipX3, iClipY3);
|
||||
oContext.closePath();
|
||||
|
||||
oContext.fillStyle = "rgba(0,0,0," + (fShade*0.5) + ")";
|
||||
oContext.fill();
|
||||
}
|
||||
}
|
||||
|
||||
// draw the mesh on the oContext canvas context, at offset [iOffsetX, iOffsetY]
|
||||
Canvas3D.Mesh.prototype.draw = function(oContext, iOffsetX, iOffsetY) {
|
||||
if (!this._bVisible) return;
|
||||
|
||||
var oScene = this._oScene;
|
||||
|
||||
var oCam = oScene.getActiveCamera();
|
||||
var oAmbient = oScene.getAmbientLight()
|
||||
|
||||
// if shading is enabled, calculate the direction vectors to all light sources
|
||||
var bLightDirty = false;
|
||||
if (this._bShading && this._bFill) {
|
||||
var aLights = oScene.getLights();
|
||||
var aLightDirections = [];
|
||||
for (var l=0;l<aLights.length;l++) {
|
||||
// todo: this should be position relative to mesh
|
||||
var oLightPos = aLights[l].getPosition();
|
||||
var oLightDirection = oLightPos.unit();
|
||||
aLightDirections.push(oLightDirection);
|
||||
|
||||
if (aLights[l].getDirty())
|
||||
bLightDirty = true;
|
||||
}
|
||||
}
|
||||
|
||||
var aVertices = this._aGlobalVertices;
|
||||
var aFaces = this._aFaces;
|
||||
|
||||
if (aVertices.length < 3 || aFaces.length < 1) {
|
||||
// nothing to draw
|
||||
return;
|
||||
}
|
||||
|
||||
// let the camera transform all vertices and project them to 2D.
|
||||
var aPoints2D = [];
|
||||
var aTransVertices = [];
|
||||
var v = aVertices.length;
|
||||
do {
|
||||
var oVertex = aVertices[v-1];
|
||||
|
||||
var oVec = oCam.transformPoint(oVertex);
|
||||
aTransVertices[v-1] = oVec;
|
||||
|
||||
var oPoint2D = oCam.project(oVec);
|
||||
aPoints2D[v-1] = oPoint2D;
|
||||
} while (--v);
|
||||
|
||||
var aSortedFaces;
|
||||
|
||||
// if the faces are filled, we need to do z-sorting
|
||||
if (this._bFill && this._bZSort) {
|
||||
var f = aFaces.length;
|
||||
do {
|
||||
var oFace = aFaces[f-1];
|
||||
oFace.transcenter = oCam.transformPoint(oFace.center);
|
||||
} while (--f);
|
||||
|
||||
aSortedFaces = aFaces.sort(fncZSort);
|
||||
|
||||
// if not, just use the raw list
|
||||
} else {
|
||||
|
||||
aSortedFaces = aFaces;
|
||||
}
|
||||
|
||||
f = aSortedFaces.length;
|
||||
if (f < 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
// run through all faces
|
||||
do {
|
||||
var oFace = aSortedFaces[f-1];
|
||||
|
||||
var oPoint1 = aPoints2D[oFace.a];
|
||||
var oPoint2 = aPoints2D[oFace.b];
|
||||
var oPoint3 = aPoints2D[oFace.c];
|
||||
|
||||
var oNormal = oFace.normal;
|
||||
|
||||
var bDraw = false;
|
||||
|
||||
// do backface culling in screen space
|
||||
if (this._bBackfaceCull) {
|
||||
// screen space backface culling adapted from http://www.kirupa.com/developer/actionscript/backface_culling.htm
|
||||
if (((oPoint3.y-oPoint1.y)/(oPoint3.x-oPoint1.x) - (oPoint2.y-oPoint1.y)/(oPoint2.x-oPoint1.x) <= 0) ^ (oPoint1.x <= oPoint3.x == oPoint1.x > oPoint2.x)){
|
||||
bDraw = true;
|
||||
}
|
||||
} else {
|
||||
bDraw = true;
|
||||
}
|
||||
|
||||
if (oCam.clip(aTransVertices[oFace.a]) || oCam.clip(aTransVertices[oFace.b]) || oCam.clip(aTransVertices[oFace.c])) {
|
||||
bDraw = false;
|
||||
}
|
||||
|
||||
|
||||
// if triangle is facing camera, draw it
|
||||
if (bDraw) {
|
||||
|
||||
// get the material for this face
|
||||
var oFaceMat = this._aMaterials[oFace.mat];
|
||||
if (oFaceMat) {
|
||||
oFaceColor = oFaceMat;
|
||||
} else {
|
||||
oFaceMat = this._oDefaultMaterial;
|
||||
oFaceColor = this._oDefaultColor;
|
||||
}
|
||||
var bFaceTexture = this._bTexture && oFaceMat.t;
|
||||
|
||||
// save the original color
|
||||
var oFaceOrgColor = {r:oFaceColor.r, g:oFaceColor.g, b:oFaceColor.b};
|
||||
|
||||
var fLight = 0;
|
||||
var fShade = 1;
|
||||
|
||||
if (this._bFill) {
|
||||
// setup ambient face color
|
||||
if (!bFaceTexture) {
|
||||
if (bLightDirty || this._bDirty) {
|
||||
var oFaceColorAmb = {
|
||||
r:(oAmbient.r / 255) * oFaceColor.r,
|
||||
g:(oAmbient.g / 255) * oFaceColor.g,
|
||||
b:(oAmbient.b / 255) * oFaceColor.b
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// do lighting
|
||||
if (this._bShading) {
|
||||
if (bLightDirty || this._bDirty) {
|
||||
for (var l=0;l<aLights.length;l++) {
|
||||
|
||||
var oLightPos = aLights[l].getPosition();
|
||||
var oLightDir = new Canvas3D.Vec3(
|
||||
oLightPos.x - oFace.center.x,
|
||||
oLightPos.y - oFace.center.y,
|
||||
oLightPos.z - oFace.center.z
|
||||
).unit();
|
||||
|
||||
var fDot = -oLightDir.dot(oNormal);
|
||||
|
||||
// is the face facing the light source
|
||||
if (fDot > 0) {
|
||||
//fDot = Math.sqrt(fDot);
|
||||
fLight = fDot * aLights[l].getIntensity();
|
||||
fShade = fShade - fLight;
|
||||
|
||||
// lighten the face by the light intensity
|
||||
if (!bFaceTexture) {
|
||||
oFaceColorAmb = {
|
||||
r: oFaceColorAmb.r + oFaceColor.r * fLight,
|
||||
g: oFaceColorAmb.g + oFaceColor.g * fLight,
|
||||
b: oFaceColorAmb.b + oFaceColor.b * fLight
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
oFaceColorAmb.r = Math.floor(oFaceColorAmb.r);
|
||||
oFaceColorAmb.g = Math.floor(oFaceColorAmb.g);
|
||||
oFaceColorAmb.b = Math.floor(oFaceColorAmb.b);
|
||||
|
||||
if (oFaceColorAmb.r < 0) oFaceColorAmb.r = 0;
|
||||
if (oFaceColorAmb.g < 0) oFaceColorAmb.g = 0;
|
||||
if (oFaceColorAmb.b < 0) oFaceColorAmb.b = 0;
|
||||
|
||||
if (oFaceColorAmb.r > 255) oFaceColorAmb.r = 255;
|
||||
if (oFaceColorAmb.g > 255) oFaceColorAmb.g = 255;
|
||||
if (oFaceColorAmb.b > 255) oFaceColorAmb.b = 255;
|
||||
|
||||
oFace.calccolor = oFaceColorAmb;
|
||||
oFace.shade = fShade;
|
||||
}
|
||||
oFaceColorAmb = oFace.calccolor;
|
||||
fShade = oFace.shade;
|
||||
}
|
||||
if (!bFaceTexture) {
|
||||
oFaceColor = oFaceColorAmb;
|
||||
}
|
||||
}
|
||||
|
||||
oContext.beginPath();
|
||||
oContext.moveTo(oPoint1.x + iOffsetX, oPoint1.y + iOffsetY);
|
||||
oContext.lineTo(oPoint2.x + iOffsetX, oPoint2.y + iOffsetY)
|
||||
oContext.lineTo(oPoint3.x + iOffsetX, oPoint3.y + iOffsetY)
|
||||
oContext.closePath();
|
||||
|
||||
if (this._bFill) {
|
||||
if (this._bCanTexture && this._bTexture && oFaceMat.image) {
|
||||
this._drawTextureTriangle(oContext, oFaceMat, oPoint1, oPoint2, oPoint3, iOffsetX, iOffsetY, fShade, oNormal, oFace.texidx);
|
||||
} else {
|
||||
oContext.fillStyle = "rgb(" + oFaceColor.r + "," + oFaceColor.g + "," + oFaceColor.b + ")";
|
||||
oContext.fill();
|
||||
if (!this._bWire) {
|
||||
oContext.lineWidth = 0.7;
|
||||
oContext.strokeStyle = "rgb(" + oFaceColor.r + "," + oFaceColor.g + "," + oFaceColor.b + ")";
|
||||
oContext.stroke();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (this._bWire) {
|
||||
oFaceOrgColor.r = Math.min(Math.max(Math.round(oFaceOrgColor.r),0),255);
|
||||
oFaceOrgColor.g = Math.min(Math.max(Math.round(oFaceOrgColor.g),0),255);
|
||||
oFaceOrgColor.b = Math.min(Math.max(Math.round(oFaceOrgColor.b),0),255);
|
||||
|
||||
oContext.lineWidth = 1;
|
||||
oContext.strokeStyle = "rgb(" + oFaceOrgColor.r + "," + oFaceOrgColor.g + "," + oFaceOrgColor.b + ")";
|
||||
oContext.stroke();
|
||||
}
|
||||
|
||||
}
|
||||
} while (--f);
|
||||
this._bDirty = false;
|
||||
}
|
||||
|
||||
Canvas3D.Mesh.prototype.setScene = function(oScene) {
|
||||
if (this._oScene != oScene) {
|
||||
this._oScene = oScene;
|
||||
}
|
||||
}
|
||||
|
||||
Canvas3D.Mesh.prototype.setLighting = function(bEnable) {
|
||||
this._bShading = bEnable;
|
||||
}
|
||||
|
||||
Canvas3D.Mesh.prototype.setBackfaceCull = function(bEnable) {
|
||||
this._bBackfaceCull = bEnable;
|
||||
}
|
||||
|
||||
Canvas3D.Mesh.prototype.setZSort = function(bEnable) {
|
||||
this._bZSort = bEnable;
|
||||
}
|
||||
|
||||
Canvas3D.Mesh.prototype.setFill = function(bEnable) {
|
||||
this._bFill = bEnable;
|
||||
}
|
||||
|
||||
Canvas3D.Mesh.prototype.setWire = function(bEnable) {
|
||||
this._bWire = bEnable;
|
||||
}
|
||||
|
||||
Canvas3D.Mesh.prototype.setTexture = function(bEnable) {
|
||||
this._bTexture = bEnable;
|
||||
}
|
||||
|
||||
Canvas3D.Mesh.prototype.setTextureShading = function(bEnable) {
|
||||
this._bTextureShading = bEnable;
|
||||
}
|
||||
|
||||
Canvas3D.Mesh.prototype._updateGlobalVertices = function() {
|
||||
var oRot = this._oRotation;
|
||||
var oPos = this._oPosition;
|
||||
|
||||
for (var i = 0; i < this._aVertices.length; i++) {
|
||||
var oRotatedVertex = new Canvas3D.Vec3(
|
||||
this._aVertices[i].x,
|
||||
this._aVertices[i].y,
|
||||
this._aVertices[i].z
|
||||
);
|
||||
|
||||
if (oRot.x)
|
||||
oRotatedVertex.rotateX(oRot.x);
|
||||
if (oRot.y)
|
||||
oRotatedVertex.rotateY(oRot.y);
|
||||
if (oRot.z)
|
||||
oRotatedVertex.rotateZ(oRot.z);
|
||||
|
||||
this._aGlobalVertices[i].x = oRotatedVertex.x * this._fScale + oPos.x;
|
||||
this._aGlobalVertices[i].y = oRotatedVertex.y * this._fScale + oPos.y;
|
||||
this._aGlobalVertices[i].z = oRotatedVertex.z * this._fScale + oPos.z;
|
||||
}
|
||||
|
||||
this._recalcNormals();
|
||||
}
|
||||
|
||||
Canvas3D.Mesh.prototype._recalcNormals = function() {
|
||||
for (var f = 0; f < this._aFaces.length; f++) {
|
||||
var oFace = this._aFaces[f];
|
||||
|
||||
var oPoint1 = this._aGlobalVertices[oFace.a];
|
||||
var oPoint2 = this._aGlobalVertices[oFace.b];
|
||||
var oPoint3 = this._aGlobalVertices[oFace.c];
|
||||
|
||||
var oCenter = new Canvas3D.Vec3(
|
||||
(oPoint1.x + oPoint2.x + oPoint3.x) / 3,
|
||||
(oPoint1.y + oPoint2.y + oPoint3.y) / 3,
|
||||
(oPoint1.z + oPoint2.z + oPoint3.z) / 3
|
||||
);
|
||||
|
||||
oFace.center = oCenter;
|
||||
|
||||
var oNormal = new Canvas3D.Vec3(
|
||||
((oPoint1.y - oPoint2.y) * (oPoint1.z - oPoint3.z)) - ((oPoint1.z - oPoint2.z) * (oPoint1.y - oPoint3.y)),
|
||||
((oPoint1.z - oPoint2.z) * (oPoint1.x - oPoint3.x)) - ((oPoint1.x - oPoint2.x) * (oPoint1.z - oPoint3.z)),
|
||||
((oPoint1.x - oPoint2.x) * (oPoint1.y - oPoint3.y)) - ((oPoint1.y - oPoint2.y) * (oPoint1.x - oPoint3.x))
|
||||
).unit();
|
||||
oFace.normal = oNormal;
|
||||
}
|
||||
}
|
||||
|
||||
Canvas3D.Mesh.prototype.setPosition = function(oVec) {
|
||||
if (oVec.x != this._oPosition.x || oVec.y != this._oPosition.y || oVec.z != this._oPosition.z) {
|
||||
this._oPosition = oVec;
|
||||
this._updateGlobalVertices();
|
||||
this._bDirty = true;
|
||||
}
|
||||
}
|
||||
|
||||
Canvas3D.Mesh.prototype.setRotation = function(oVec) {
|
||||
this._oRotation = oVec;
|
||||
this._updateGlobalVertices();
|
||||
|
||||
this._bDirty = true;
|
||||
|
||||
}
|
||||
|
||||
Canvas3D.Mesh.prototype.getPosition = function(oVec) {
|
||||
return this._oPosition;
|
||||
}
|
||||
|
||||
Canvas3D.Mesh.prototype.setForcedZ = function(iZ) {
|
||||
this._iForcedZ = iZ;
|
||||
}
|
||||
|
||||
Canvas3D.Mesh.prototype.getForcedZ = function() {
|
||||
return this._iForcedZ;
|
||||
}
|
||||
|
||||
Canvas3D.Mesh.prototype.getHideWhenRotating = function() {
|
||||
return this._bHideWhenRotating;
|
||||
}
|
||||
|
||||
Canvas3D.Mesh.prototype.setHideWhenRotating = function(bEnable) {
|
||||
this._bHideWhenRotating = bEnable;
|
||||
}
|
||||
|
||||
Canvas3D.Mesh.prototype.getDirty = function() {
|
||||
return this._bDirty;
|
||||
}
|
||||
|
||||
Canvas3D.Mesh.prototype.hide = function() {
|
||||
this._bVisible = false;
|
||||
this._bDirty = true;
|
||||
}
|
||||
|
||||
Canvas3D.Mesh.prototype.show = function() {
|
||||
this._bVisible = true;
|
||||
this._bDirty = true;
|
||||
}
|
||||
|
||||
Canvas3D.Mesh.prototype.isVisible = function() {
|
||||
return this._bVisible;
|
||||
}
|
||||
|
||||
Canvas3D.Mesh.prototype.setScale = function(fScale) {
|
||||
this._fScale = fScale;
|
||||
this._bDirty = true;
|
||||
this._updateGlobalVertices();
|
||||
}
|
||||
|
||||
Canvas3D.Mesh.prototype.getScale = function() {
|
||||
return this._fScale;
|
||||
}
|
|
@ -1,290 +0,0 @@
|
|||
/*
|
||||
* Javascript/Canvas Textured 3D Renderer v0.3.1
|
||||
* Copyright (c) 2008 Jacob Seidelin, cupboy@gmail.com
|
||||
* This software is free to use for non-commercial purposes. For anything else, please contact the author.
|
||||
* This is a version modified by Stefano Gioffre'.
|
||||
*/
|
||||
|
||||
Canvas3D.Scene = function(oContainer, iWidth, iHeight, bObjectCanvas) {
|
||||
this._oContainer = oContainer;
|
||||
this._iWidth = iWidth;
|
||||
this._iHeight = iHeight;
|
||||
var oCanvas = this._oDrawCanvas = document.createElement("canvas");
|
||||
this._oDrawContext = oCanvas.getContext("2d");
|
||||
Canvas3D.addEvent(oCanvas, "selectstart", function() { return(false); });
|
||||
oCanvas.style.position = "absolute";
|
||||
|
||||
this._oDrawCanvas.width = iWidth;
|
||||
this._oDrawCanvas.height = iHeight;
|
||||
this._oDrawCanvas.style.width = iWidth + "px";
|
||||
this._oDrawCanvas.style.height = iHeight + "px";
|
||||
|
||||
oContainer.appendChild(this._oDrawCanvas);
|
||||
|
||||
this._oActiveCamera = null;
|
||||
|
||||
this._aObjects = [];
|
||||
|
||||
this._bRunning = false;
|
||||
|
||||
// if true, each object will be rendered on its own canvas
|
||||
this._bUseObjectCanvas = bObjectCanvas;
|
||||
|
||||
this._bMouseRotate = true;
|
||||
this._bMouseRotateY = true;
|
||||
this._bMouseRotateX = true;
|
||||
|
||||
this._oUpVector = new Canvas3D.Vec3(0,1,0);
|
||||
|
||||
this._oAmbientLight = {r:50,g:50,b:50};
|
||||
|
||||
this._bDrawLights = false;
|
||||
this._aLights = [];
|
||||
|
||||
this._iMaxZ = 10000000;
|
||||
|
||||
var oInputOverlay = this._oInputOverlay = document.createElement("span");
|
||||
oInputOverlay.style.width = iWidth + "px";
|
||||
oInputOverlay.style.height = iHeight + "px";
|
||||
oInputOverlay.style.zIndex = this._iMaxZ + 10000000;
|
||||
oInputOverlay.style.position = "absolute";
|
||||
this._oContainer.appendChild(oInputOverlay);
|
||||
|
||||
Canvas3D.addEvent(oInputOverlay, "selectstart", function() { return(false); });
|
||||
|
||||
};
|
||||
|
||||
Canvas3D.Scene.prototype.getInputLayer = function() { return(this._oInputOverlay); };
|
||||
|
||||
Canvas3D.Scene.prototype.setUpVector = function(oVec) { this._oUpVector = oVec; };
|
||||
|
||||
Canvas3D.Scene.prototype.getUpVector = function() { return(this._oUpVector); };
|
||||
|
||||
Canvas3D.Scene.prototype.getAmbientLight = function() { return(this._oAmbientLight); };
|
||||
|
||||
Canvas3D.Scene.prototype.zoomCamera = function(fZoom) { this.getActiveCamera().moveForward(fZoom); };
|
||||
|
||||
Canvas3D.Scene.prototype.getObjects = function() { return(this._aObjects); };
|
||||
|
||||
Canvas3D.Scene.prototype.addObject = function(obj) {
|
||||
if (this._bUseObjectCanvas) {
|
||||
var oObjectCanvas = document.createElement("canvas");
|
||||
if (!oObjectCanvas.getContext) return;
|
||||
|
||||
var oObjectContext = oObjectCanvas.getContext("2d");
|
||||
|
||||
Canvas3D.addEvent(oObjectCanvas, "selectstart", function() { return(false); });
|
||||
|
||||
oObjectCanvas.width = this._iWidth;
|
||||
oObjectCanvas.height = this._iHeight;
|
||||
|
||||
oObjectCanvas.style.width = this._iWidth + "px";
|
||||
oObjectCanvas.style.height = this._iHeight + "px";
|
||||
|
||||
oObjectCanvas.style.position = "absolute";
|
||||
this._oContainer.appendChild(oObjectCanvas);
|
||||
|
||||
this._aObjects.push({
|
||||
"canvas": oObjectCanvas,
|
||||
"context": oObjectContext,
|
||||
"object": obj
|
||||
|
||||
});
|
||||
} else {
|
||||
this._aObjects.push({ "object": obj });
|
||||
}
|
||||
obj.setScene(this);
|
||||
this.setDirty(true);
|
||||
return(obj);
|
||||
};
|
||||
/*
|
||||
Canvas3D.Scene.prototype.setWidth = function(iWidth) {
|
||||
for (var iCnvsObj = 0; iCnvsObj < this._aObjects.length; iCnvsObj++) {
|
||||
if (this._aObjects[iCnvsObj].hasOwnProperty("canvas")) {
|
||||
this._aObjects[iCnvsObj].canvas.width = iWidth;
|
||||
this._aObjects[iCnvsObj].canvas.style.width = iWidth + "px";
|
||||
}
|
||||
}
|
||||
this._iWidth = iWidth;
|
||||
this._oDrawCanvas.width = iWidth;
|
||||
this._oDrawCanvas.style.width = iWidth + "px";
|
||||
this._oInputOverlay.style.width = iWidth + "px";
|
||||
|
||||
};
|
||||
|
||||
Canvas3D.Scene.prototype.setHeight = function(iHeight) {
|
||||
for (var iCnvsObj = 0; iCnvsObj < this._aObjects.length; iCnvsObj++) {
|
||||
if (this._aObjects[iCnvsObj].hasOwnProperty("canvas")) {
|
||||
this._aObjects[iCnvsObj].canvas.height = iHeight;
|
||||
this._aObjects[iCnvsObj].canvas.style.height = iHeight + "px";
|
||||
}
|
||||
}
|
||||
this._iHeight = iHeight;
|
||||
this._oDrawCanvas.height = iHeight;
|
||||
this._oDrawCanvas.style.height = iHeight + "px";
|
||||
this._oInputOverlay.style.height = iHeight + "px";
|
||||
};
|
||||
*/
|
||||
Canvas3D.Scene.prototype.setDimensions = function(iWidth, iHeight) {
|
||||
for (var iCnvsObj = 0; iCnvsObj < this._aObjects.length; iCnvsObj++) {
|
||||
if (this._aObjects[iCnvsObj].hasOwnProperty("canvas")) {
|
||||
this._aObjects[iCnvsObj].canvas.width = iWidth;
|
||||
this._aObjects[iCnvsObj].canvas.height = iHeight;
|
||||
this._aObjects[iCnvsObj].canvas.style.width = iWidth + "px";
|
||||
this._aObjects[iCnvsObj].canvas.style.height = iHeight + "px";
|
||||
}
|
||||
}
|
||||
this._iWidth = iWidth;
|
||||
this._iHeight = iHeight;
|
||||
this._oDrawCanvas.height = iHeight;
|
||||
this._oDrawCanvas.width = iWidth;
|
||||
this._oDrawCanvas.style.width = iWidth + "px";
|
||||
this._oDrawCanvas.style.height = iHeight + "px";
|
||||
this._oInputOverlay.style.width = iWidth + "px";
|
||||
this._oInputOverlay.style.height = iHeight + "px";
|
||||
};
|
||||
|
||||
Canvas3D.Scene.prototype.removeObject = function(oObject) {
|
||||
for (var i=0;i<this._aObjects.length;i++) {
|
||||
if (this._aObjects[i].object === oObject) {
|
||||
if (this._bUseObjectCanvas) {
|
||||
this._oContainer.removeChild(this._aObjects[i].canvas);
|
||||
}
|
||||
this._aObjects.splice(i, 1);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Canvas3D.Scene.prototype.removeAllObjects = function() {
|
||||
if (this._bUseObjectCanvas) {
|
||||
for (var i=0;i<this._aObjects.length;i++) {
|
||||
this._oContainer.removeChild(this._aObjects[i].canvas);
|
||||
}
|
||||
}
|
||||
this._aObjects.splice(0);
|
||||
};
|
||||
|
||||
Canvas3D.Scene.prototype.addLight = function(oLight) {
|
||||
oLight.setScene(this);
|
||||
return(this._aLights.push(oLight));
|
||||
};
|
||||
|
||||
Canvas3D.Scene.prototype.getLights = function() { return(this._aLights); };
|
||||
|
||||
Canvas3D.Scene.prototype.clearObjects = function() { this._aObjects.splice(0); };
|
||||
|
||||
Canvas3D.Scene.prototype.setActiveCamera = function(oCam) { this._oActiveCamera = oCam; };
|
||||
|
||||
Canvas3D.Scene.prototype.getActiveCamera = function() { return(this._oActiveCamera); };
|
||||
|
||||
Canvas3D.Scene.prototype.begin = function() {
|
||||
this._bRunning = true;
|
||||
this.getActiveCamera().setDirty(true);
|
||||
this.drawAll();
|
||||
var me = this;
|
||||
this._iInterval = setInterval(function() { me.drawAll(); }, 1000 / 30);
|
||||
};
|
||||
|
||||
Canvas3D.Scene.prototype.end = function() {
|
||||
this._bRunning = false;
|
||||
clearInterval(this._iInterval);
|
||||
};
|
||||
|
||||
Canvas3D.Scene.prototype.setDirty = function(bDirty) {
|
||||
this._bDirty = bDirty;
|
||||
};
|
||||
|
||||
Canvas3D.Scene.prototype.getDirty = function() { return(this._bDirty); };
|
||||
|
||||
Canvas3D.Scene.prototype.getWidth = function() { return(this._iWidth); };
|
||||
|
||||
Canvas3D.Scene.prototype.getHeight = function() { return(this._iHeight); };
|
||||
|
||||
Canvas3D.Scene.prototype.drawAll = function() {
|
||||
if (!this._bRunning) return;
|
||||
|
||||
var oCam = this.getActiveCamera();
|
||||
|
||||
var iOffsetX = Math.floor(this._iWidth / 2);
|
||||
var iOffsetY = Math.floor(this._iHeight / 2);
|
||||
|
||||
var aObjects = this._aObjects;
|
||||
var bCamDirty = oCam.getDirty();
|
||||
var iObjDrawn = 0;
|
||||
|
||||
var bObjDirty = false;
|
||||
for (var c=0;c<aObjects.length;c++) {
|
||||
if (aObjects[c].object.getDirty()) {
|
||||
bObjDirty = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (bCamDirty || this.getDirty() || bObjDirty) {
|
||||
if (bCamDirty || this.getDirty()) {
|
||||
this._oDrawContext.clearRect(0,0,this._iWidth,this._iHeight);
|
||||
}
|
||||
|
||||
var aObjPos = [];
|
||||
for (var c=0;c<aObjects.length;c++) {
|
||||
if (aObjects[c].object.getSortPosition)
|
||||
var oPos = aObjects[c].object.getSortPosition();
|
||||
else
|
||||
var oPos = aObjects[c].object.getPosition();
|
||||
|
||||
var oObjectPos = oCam.transformPoint(oPos);
|
||||
aObjPos[c] = [aObjects[c], oObjectPos.z];
|
||||
}
|
||||
|
||||
var aSortObj = aObjPos.sort(
|
||||
function(a,b) {
|
||||
return(b[1] - a[1]);
|
||||
}
|
||||
);
|
||||
aObjects = aSortObj;
|
||||
|
||||
for (var c=0;c<aObjects.length;c++) {
|
||||
var oObject = aObjects[c][0];
|
||||
if (oObject.object.isVisible()) {
|
||||
if (this._bUseObjectCanvas) {
|
||||
if (bCamDirty || this.getDirty() || oObject.object.getDirty()) {
|
||||
if (oObject.object.getForcedZ() > -1) {
|
||||
oObject.canvas.style.zIndex = oObject.object.getForcedZ();
|
||||
} else {
|
||||
var oObjectPos = oCam.transformPoint(oObject.object.getPosition());
|
||||
oObject.canvas.style.zIndex = 10000000 - Math.round(oObjectPos.z*100);
|
||||
}
|
||||
oObject.context.clearRect(0,0,this._iWidth,this._iHeight);
|
||||
if (oObject.object.draw(oObject.context, iOffsetX, iOffsetY)) {
|
||||
iObjDrawn++;
|
||||
}
|
||||
oObject.canvas.style.display = "block";
|
||||
}
|
||||
} else {
|
||||
if (bCamDirty || this.getDirty()) {
|
||||
if (oObject.object.draw(this._oDrawContext, iOffsetX, iOffsetY)) {
|
||||
iObjDrawn++;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (this._bUseObjectCanvas) {
|
||||
oObject.canvas.style.display = "none";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (this._bDrawLights) {
|
||||
for (var c=0;c<this._aLights.length;c++) {
|
||||
var oLight = this._aLights[c];
|
||||
oLight.draw(this._oLightContext, iOffsetX, iOffsetY);
|
||||
}
|
||||
}
|
||||
|
||||
for (var c=0;c<this._aLights.length;c++) {
|
||||
this._aLights[c].setDirty(false);
|
||||
}
|
||||
oCam.setDirty(false);
|
||||
this.setDirty(false);
|
||||
|
||||
};
|
|
@ -1,105 +0,0 @@
|
|||
/*
|
||||
* Javascript/Canvas Textured 3D Renderer v0.3
|
||||
* Copyright (c) 2008 Jacob Seidelin, cupboy@gmail.com
|
||||
* This software is free to use for non-commercial purposes. For anything else, please contact the author.
|
||||
* This is a version modified by Stefano Gioffre'.
|
||||
*/
|
||||
|
||||
Canvas3D.Vec3 = function(vx, vy, vz) {
|
||||
this.x = vx;
|
||||
this.y = vy;
|
||||
this.z = vz;
|
||||
}
|
||||
|
||||
Canvas3D.Vec3.prototype.set = function(vx, vy, vz) {
|
||||
this.x = vx;
|
||||
this.y = vy;
|
||||
this.z = vz;
|
||||
}
|
||||
|
||||
Canvas3D.Vec3.prototype.addVector = function(V) {
|
||||
this.x += V.x;
|
||||
this.y += V.y;
|
||||
this.z += V.z;
|
||||
return this;
|
||||
}
|
||||
|
||||
Canvas3D.Vec3.prototype.multiply = function(fScalar) {
|
||||
this.x *= fScalar;
|
||||
this.y *= fScalar;
|
||||
this.z *= fScalar;
|
||||
return this;
|
||||
}
|
||||
|
||||
Canvas3D.Vec3.prototype.subVector = function(V) {
|
||||
this.x -= V.x;
|
||||
this.y -= V.y;
|
||||
this.z -= V.z;
|
||||
return this;
|
||||
}
|
||||
|
||||
Canvas3D.Vec3.prototype.returnAdd = function(V) {
|
||||
return new Canvas3D.Vec3(this.x + V.x, this.y + V.y, this.z + V.z);
|
||||
}
|
||||
|
||||
Canvas3D.Vec3.prototype.returnSub = function(V) {
|
||||
return new Canvas3D.Vec3(this.x - V.x, this.y - V.y, this.z - V.z);
|
||||
}
|
||||
|
||||
Canvas3D.Vec3.prototype.clone = function() {
|
||||
return new Canvas3D.Vec3(this.x, this.y, this.z);
|
||||
}
|
||||
|
||||
Canvas3D.Vec3.prototype.dot = function(V) {
|
||||
return ((this.x * V.x) + (this.y * V.y) + (this.z * V.z));
|
||||
}
|
||||
|
||||
Canvas3D.Vec3.prototype.cross = function(V) {
|
||||
var vx = V.x;
|
||||
var vy = V.y;
|
||||
var vz = V.z;
|
||||
return new Canvas3D.Vec3((this.y * vz) - (this.z * vy), (this.z * vx) - (this.x * vz), (this.x * vy) - (this.y * vx));
|
||||
}
|
||||
|
||||
Canvas3D.Vec3.prototype.length = function() {
|
||||
return Math.sqrt((this.x * this.x) + (this.y * this.y) + (this.z * this.z));
|
||||
}
|
||||
|
||||
Canvas3D.Vec3.prototype.unit = function() {
|
||||
var l = 1/Math.sqrt((this.x * this.x) + (this.y * this.y) + (this.z * this.z));
|
||||
return new Canvas3D.Vec3(this.x * l, this.y * l, this.z * l);
|
||||
}
|
||||
|
||||
Canvas3D.Vec3.prototype.rotateX = function(a) {
|
||||
var ry = this.y;
|
||||
var rz = this.z;
|
||||
var c = Math.cos(a);
|
||||
var s = Math.sin(a);
|
||||
this.y = c * ry - s * rz;
|
||||
this.z = s * ry + c * rz;
|
||||
}
|
||||
|
||||
Canvas3D.Vec3.prototype.rotateY = function(a) {
|
||||
var rx = this.x;
|
||||
var rz = this.z;
|
||||
var c = Math.cos(a);
|
||||
var s = Math.sin(a);
|
||||
this.x = c * rx - s * rz;
|
||||
this.z = s * rx + c * rz;
|
||||
}
|
||||
|
||||
Canvas3D.Vec3.prototype.rotateZ = function(a) {
|
||||
var rx = this.x;
|
||||
var ry = this.y;
|
||||
var c = Math.cos(a);
|
||||
var s = Math.sin(a);
|
||||
this.x = c * rx - s * ry;
|
||||
this.y = s * rx + c * ry;
|
||||
}
|
||||
|
||||
Canvas3D.Vec3.prototype.dist = function(oVec) {
|
||||
var x = oVec.x - this.x;
|
||||
var y = oVec.y - this.y;
|
||||
var z = oVec.z - this.z;
|
||||
return Math.sqrt(x*x + y*y + z*z);
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
|
||||
// retrieves a file via XMLHTTPRequest, calls fncCallback when done or fncError on error.
|
||||
|
||||
function XHR(strURL, fncCallback /*, argumentToPass1, argumentToPass2, etc. */) {
|
||||
var oHTTP, argsArr = Array.prototype.slice.call(arguments, 2);
|
||||
if (window.XMLHttpRequest) { oHTTP = new XMLHttpRequest(); }
|
||||
else if (window.ActiveXObject) { oHTTP = new ActiveXObject("Microsoft.XMLHTTP"); }
|
||||
if (oHTTP) {
|
||||
if (fncCallback) {
|
||||
if (typeof(oHTTP.onload) !== "undefined")
|
||||
oHTTP.onload = function() {
|
||||
fncCallback.apply(oHTTP, argsArr);
|
||||
oHTTP = null;
|
||||
};
|
||||
else {
|
||||
oHTTP.onreadystatechange = function() {
|
||||
if (oHTTP.readyState === 4) {
|
||||
fncCallback.apply(oHTTP, argsArr);
|
||||
oHTTP = null;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
oHTTP.open("GET", strURL, true);
|
||||
oHTTP.setRequestHeader("Content-Type", "text/plain");
|
||||
oHTTP.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
|
||||
oHTTP.send(null);
|
||||
}
|
||||
}
|
||||
|
||||
function setAttribs() { for (var iAttr = 0; iAttr < arguments.length; iAttr++) { this[arguments[iAttr][0]] = arguments[iAttr][1]; } return(this); }
|
||||
function setStyles() { for (var iPropr = 0; iPropr < arguments.length; iPropr++) { this.style[arguments[iPropr][0]] = arguments[iPropr][1]; } return(this); }
|
|
@ -1,339 +0,0 @@
|
|||
body {
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
span.intLink, #chessClosePanel {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
a.chessCtrlBtn:link, span.chessCtrlBtn {
|
||||
margin: 0 20px;
|
||||
text-decoration: none;
|
||||
-moz-user-select: none;
|
||||
color: #000000;
|
||||
cursor: default;
|
||||
height: 21px;
|
||||
padding: 0 8px;
|
||||
font: 13px / 20px "Lucida Grande", sans-serif;
|
||||
-moz-border-radius: 10px;
|
||||
-webkit-border-radius: 10px;
|
||||
border-radius: 10px;
|
||||
background: rgb(235, 235, 235);
|
||||
-moz-box-shadow:
|
||||
0 1px 0 rgba(0, 0, 0, 0.15),
|
||||
inset 0 1px 0 rgba(0, 0, 0, 0.2),
|
||||
inset 0 0 1px rgba(0, 0, 0, 0.8),
|
||||
inset 0 0 1px #000,
|
||||
inset 0 10px 5px -5px rgba(255, 255, 255, 1),
|
||||
inset 0 -20px 10px -10px rgba(255, 255, 255, 0.8),
|
||||
inset 0 -13px rgba(0, 0, 0, 0.1);
|
||||
-webkit-box-shadow:
|
||||
0 1px 0 rgba(0, 0, 0, 0.15),
|
||||
inset 0 1px 0 rgba(0, 0, 0, 0.2),
|
||||
inset 0 0 1px rgba(0, 0, 0, 0.8),
|
||||
inset 0 0 1px #000,
|
||||
inset 0 10px 5px -5px rgba(255, 255, 255, 1),
|
||||
inset 0 -20px 10px -10px rgba(255, 255, 255, 0.8),
|
||||
inset 0 -13px rgba(0, 0, 0, 0.1);
|
||||
box-shadow:
|
||||
0 1px 0 rgba(0, 0, 0, 0.15),
|
||||
inset 0 1px 0 rgba(0, 0, 0, 0.2),
|
||||
inset 0 0 1px rgba(0, 0, 0, 0.8),
|
||||
inset 0 0 1px #000,
|
||||
inset 0 10px 5px -5px rgba(255, 255, 255, 1),
|
||||
inset 0 -20px 10px -10px rgba(255, 255, 255, 0.8),
|
||||
inset 0 -13px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
a.chessCtrlBtn:active:hover, span.chessCtrlBtn:active:hover {
|
||||
background-color: #79A7D5;
|
||||
-moz-box-shadow:
|
||||
0 1px 0 rgba(0, 0, 0, 0.15),
|
||||
inset 0 1px 0 rgba(0, 0, 0, 0.2),
|
||||
inset 0 0 1px rgba(0, 0, 0, 0.8),
|
||||
inset 0 0 1px #000,
|
||||
inset 0 10px 5px -5px rgba(255, 255, 255, 0.4),
|
||||
inset 0 -20px 10px -10px #A4D6F1,
|
||||
inset 0 -13px #387CC0;
|
||||
-webkit-box-shadow:
|
||||
0 1px 0 rgba(0, 0, 0, 0.15),
|
||||
inset 0 1px 0 rgba(0, 0, 0, 0.2),
|
||||
inset 0 0 1px rgba(0, 0, 0, 0.8),
|
||||
inset 0 0 1px #000,
|
||||
inset 0 10px 5px -5px rgba(255, 255, 255, 0.4),
|
||||
inset 0 -20px 10px -10px #A4D6F1,
|
||||
inset 0 -13px #387CC0;
|
||||
box-shadow:
|
||||
0 1px 0 rgba(0, 0, 0, 0.15),
|
||||
inset 0 1px 0 rgba(0, 0, 0, 0.2),
|
||||
inset 0 0 1px rgba(0, 0, 0, 0.8),
|
||||
inset 0 0 1px #000,
|
||||
inset 0 10px 5px -5px rgba(255, 255, 255, 0.4),
|
||||
inset 0 -20px 10px -10px #A4D6F1,
|
||||
inset 0 -13px #387CC0;
|
||||
}
|
||||
div.chessFilmBox {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
border: 1px #000000 solid;
|
||||
background-color: #ffffaa;
|
||||
opacity: 0.5;
|
||||
filter: alpha(opacity=50);
|
||||
border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
-webkit-border-radius: 5px;
|
||||
z-index: 10000000;
|
||||
}
|
||||
|
||||
div.gnotify {
|
||||
padding: 10px;
|
||||
z-index: 10000001;
|
||||
}
|
||||
|
||||
/** Normal Style Positions **/
|
||||
div.gnotify { position: fixed; }
|
||||
|
||||
div.gnotify.top-left {
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
div.gnotify.top-right {
|
||||
right: 0;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
div.gnotify.bottom-left {
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
div.gnotify.bottom-right {
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
div.gnotify.center {
|
||||
top: 0;
|
||||
width: 50%;
|
||||
left: 25%;
|
||||
}
|
||||
|
||||
div.gnotify-message span.intLink, div.gnotify-message a, div.gnotify-message a:link, div.gnotify-message a:visited, div.gnotify-message a:hover {
|
||||
font-weight: bold;
|
||||
text-decoration: inherit;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
/** Cross Browser Styling **/
|
||||
div.center div.gnotify-notification, div.center div.gnotify-closer {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
div.gnotify div.gnotify-notification, div.gnotify div.gnotify-closer {
|
||||
background-color: #000000;
|
||||
color: #ffffff;
|
||||
opacity: 0.85;
|
||||
filter: alpha(opacity=85);
|
||||
width: 235px;
|
||||
padding: 10px;
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
font-family: Tahoma, Arial, Helvetica, sans-serif;
|
||||
font-size: 12px;
|
||||
text-align: left;
|
||||
display: none;
|
||||
border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
-webkit-border-radius: 5px;
|
||||
}
|
||||
|
||||
div.gnotify div.gnotify-notification { min-height: 40px; }
|
||||
|
||||
div.gnotify div.gnotify-notification div.header {
|
||||
font-weight: bold;
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
div.gnotify div.gnotify-notification div.close {
|
||||
float: right;
|
||||
font-weight: bold;
|
||||
font-size: 12px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
div.gnotify div.gnotify-closer {
|
||||
height: 15px;
|
||||
padding-top: 4px;
|
||||
padding-bottom: 4px;
|
||||
cursor: pointer;
|
||||
font-size: 11px;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#chessboardsBox {
|
||||
position: relative;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
left: 0;
|
||||
top: 0;
|
||||
clear: both;
|
||||
overflow: visible;
|
||||
background-color: #87a1c0;
|
||||
border: 1px #76808C solid;
|
||||
-moz-border-radius: 5px;
|
||||
-webkit-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
/*
|
||||
-moz-box-shadow:
|
||||
0 0 20px black,
|
||||
20px 15px 30px yellow,
|
||||
-20px 15px 30px lime,
|
||||
-20px -15px 30px blue,
|
||||
20px -15px 30px red;
|
||||
-webkit-box-shadow:
|
||||
0 0 20px black,
|
||||
20px 15px 30px yellow,
|
||||
-20px 15px 30px lime,
|
||||
-20px -15px 30px blue,
|
||||
20px -15px 30px red;
|
||||
box-shadow:
|
||||
0 0 20px black,
|
||||
20px 15px 30px yellow,
|
||||
-20px 15px 30px lime,
|
||||
-20px -15px 30px blue,
|
||||
20px -15px 30px red;
|
||||
*/
|
||||
}
|
||||
#chessSizeHandle {
|
||||
background-color: transparent;
|
||||
color: #333333;
|
||||
font-size: 24px;
|
||||
line-height: 24px;
|
||||
width: auto;
|
||||
height: auto;
|
||||
position: absolute;
|
||||
right: -12px;
|
||||
bottom: -12px;
|
||||
float: right;
|
||||
margin-top: auto;
|
||||
cursor: se-resize;
|
||||
}
|
||||
|
||||
#chess3DBox {
|
||||
/**
|
||||
* width: [DYNAMIC VALUE];
|
||||
* height: [DYNAMIC VALUE];
|
||||
*/
|
||||
float: left;
|
||||
}
|
||||
|
||||
#chess2DBox {
|
||||
/**
|
||||
* width: [DYNAMIC VALUE];
|
||||
* height: [DYNAMIC VALUE];
|
||||
*/
|
||||
float: right;
|
||||
}
|
||||
#chessCtrlPanel, #chessCtrlPanel select, #chessCtrlPanel input[type=text] {
|
||||
-moz-border-radius: 5px;
|
||||
-webkit-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
#chessCtrlPanel {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
width: 140px;
|
||||
height: auto;
|
||||
overflow: hidden;
|
||||
background-color: #404d4f;
|
||||
color: #ffffff;
|
||||
font-size: 12px;
|
||||
font-family: Tahoma, Arial, Verdana, Helvetica;
|
||||
-moz-box-shadow: 3px 3px red, -8px -2px 8px #2d3637;
|
||||
-webkit-box-shadow: 3px 3px red, -8px -2px 8px #2d3637;
|
||||
box-shadow: 3px 3px red, -8px -2px 8px #2d3637;
|
||||
}
|
||||
|
||||
#chessCtrlPanel form {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
#chessClosePanel {
|
||||
width: auto;
|
||||
height: auto;
|
||||
margin: 0 12px 1px auto;
|
||||
float: right;
|
||||
}
|
||||
|
||||
#chessCtrlPanel p {
|
||||
margin-top: 6px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#chessInfo span.intLink {
|
||||
color: #ffffff;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
span.infoKey, span.infoVal {
|
||||
color: #ffffff;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
span.infoKey {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#chessMoves {
|
||||
width: 92%;
|
||||
height: 120px;
|
||||
padding: 4px;
|
||||
font-family: Courier New, Courier;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
#chessMoves, #chessAlgebraic {
|
||||
border: 1px solid #778284;
|
||||
background-color: transparent;
|
||||
color: #ffffff;
|
||||
-moz-box-shadow: inset 2px 2px 5px black, 2px 2px 5px black;
|
||||
-webkit-box-shadow: inset 2px 2px 5px black, 2px 2px 5px black;
|
||||
box-shadow: inset 2px 2px 5px black, 2px 2px 5px black;
|
||||
}
|
||||
|
||||
#chessAlgebraic {
|
||||
width: 90%;
|
||||
margin-top: 3px;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
#chessInfo p {
|
||||
text-align: center;
|
||||
margin: 6px 4px 6px 4px;
|
||||
}
|
||||
|
||||
#chessCurtain {
|
||||
display:table;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
background-color: #000000;
|
||||
opacity: 0.5;
|
||||
filter: alpha(opacity=50);
|
||||
z-index: 10000002;
|
||||
}
|
||||
|
||||
#chessLoading {
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
text-align: center;
|
||||
border: 1px #000000 solid;
|
||||
color: #ffff00;
|
||||
}
|
Before Width: | Height: | Size: 777 B |
Before Width: | Height: | Size: 808 B |
Before Width: | Height: | Size: 810 B |
Before Width: | Height: | Size: 816 B |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 914 B |
Before Width: | Height: | Size: 849 B |
Before Width: | Height: | Size: 843 B |
Before Width: | Height: | Size: 815 B |
Before Width: | Height: | Size: 298 B |
|
@ -1,184 +0,0 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
|
||||
<script type="text/ecmascript" src="common/xhr.js"></script>
|
||||
<script type="text/ecmascript" src="chess.js"></script>
|
||||
<link type="text/css" rel="stylesheet" href="css/chess.css" />
|
||||
<link type="text/css" rel="stylesheet" href="skins/gnomechess.css" />
|
||||
<title>Chess</title>
|
||||
<script type="text/javascript">
|
||||
var nVwPressed = false;
|
||||
function pressVwBtn(nBtnId) {
|
||||
if (nVwPressed) { document.getElementById("viewBtn" + nVwPressed).className = ""; }
|
||||
document.getElementById("viewBtn" + nBtnId).className = "pressedBtn";
|
||||
nVwPressed = nBtnId;
|
||||
}
|
||||
|
||||
// Firefox only
|
||||
function onPGNLoaded(frEvnt) {
|
||||
var sFBody = frEvnt.target.result;
|
||||
chess.readPGN(sFBody, document.chessCtrl3.plyerClr2[1].checked);
|
||||
}
|
||||
|
||||
// Firefox only
|
||||
function loadPGNFile() {
|
||||
var oFile = document.getElementById("PGNFileData").files[0];
|
||||
if (oFile) {
|
||||
var oFReader = new FileReader();
|
||||
oFReader.onload = onPGNLoaded;
|
||||
oFReader.readAsText(oFile);
|
||||
}
|
||||
}
|
||||
|
||||
function initChess() {
|
||||
chess.useAI(document.chessCtrl1.useAI.checked);
|
||||
chess.setPromotion(document.chessCtrl1.selPromo.selectedIndex);
|
||||
chess.setFrameRate(Math.abs(Number(document.chessCtrl2.frameRateCtrl.value)) || 1000);
|
||||
chess.setSide(document.chessCtrl2.selSide.selectedIndex);
|
||||
chess.useKeyboard(document.chessCtrl2.KeybCtrl.checked);
|
||||
chess.placeById("chessDesk");
|
||||
document.chessCtrl1.plyDepthCtrl.value = "0";
|
||||
chess.setView(1);
|
||||
pressVwBtn(1);
|
||||
}
|
||||
</script>
|
||||
<style type="text/css">
|
||||
hr {
|
||||
width: 30%;
|
||||
margin-top: 32px;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
img.tbBtn {
|
||||
cursor: pointer;
|
||||
margin: 1px 3px 1px 3px;
|
||||
}
|
||||
|
||||
#pgnTable {
|
||||
width: auto;
|
||||
height: auto;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
border-collapse: collapse;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
#pgnTable tr td { padding: 2px; }
|
||||
|
||||
#chessCtrlPanel {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#chessDesk {
|
||||
clear: both;
|
||||
width: auto;
|
||||
height: auto;
|
||||
margin-top: 32px;
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
|
||||
#chessToolBar {
|
||||
width: 550px;
|
||||
height: auto;
|
||||
margin: 12px auto;
|
||||
background-color: #969696;
|
||||
-moz-box-shadow: inset 0 25px 27px -10px #BDBDBD;
|
||||
-webkit-box-shadow: inset 0 25px 27px -10px #BDBDBD;
|
||||
box-shadow: inset 0 25px 27px -10px #BDBDBD;
|
||||
border: 2px solid #424242;
|
||||
border-radius:4px;
|
||||
text-align:center;
|
||||
padding: 6px 3px 2px 3px;
|
||||
}
|
||||
|
||||
#setViewBtns {
|
||||
width: auto;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#setViewBtns span {
|
||||
margin: 0 3px;
|
||||
display: inline-block;
|
||||
font: 12px / 13px "Lucida Grande", sans-serif;
|
||||
text-shadow: rgba(255, 255, 255, 0.4) 0 1px;
|
||||
padding: 3px 6px;
|
||||
border: 1px solid rgba(0, 0, 0, 0.6);
|
||||
background-color: #969696;
|
||||
cursor: default;
|
||||
-moz-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
-moz-box-shadow: rgba(255, 255, 255, 0.4) 0 1px, inset 0 20px 20px -10px white;
|
||||
-webkit-box-shadow: rgba(255, 255, 255, 0.4) 0 1px, inset 0 20px 20px -10px white;
|
||||
box-shadow: rgba(255, 255, 255, 0.4) 0 1px, inset 0 20px 20px -10px white;
|
||||
}
|
||||
#setViewBtns span.pressedBtn {
|
||||
background: #B5B5B5;
|
||||
-moz-box-shadow: inset rgba(0, 0, 0, 0.4) 0 -5px 12px, inset rgba(0, 0, 0, 1) 0 1px 3px, rgba(255, 255, 255, 0.4) 0 1px;
|
||||
-webkit-box-shadow: inset rgba(0, 0, 0, 0.4) 0 -5px 12px, inset rgba(0, 0, 0, 1) 0 1px 3px, rgba(255, 255, 255, 0.4) 0 1px;
|
||||
box-shadow: inset rgba(0, 0, 0, 0.4) 0 -5px 12px, inset rgba(0, 0, 0, 1) 0 1px 3px, rgba(255, 255, 255, 0.4) 0 1px;
|
||||
}
|
||||
.configitem {
|
||||
border:2px solid #424242;
|
||||
border-radius:4px;
|
||||
padding:6px;
|
||||
margin:8px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body onload="initChess();">
|
||||
|
||||
<form name="chessCtrl1" onsubmit="return(false);">
|
||||
<p style="text-align:center;">
|
||||
<input type="button" name="strtBtn" value="New game" onclick="chess.organize(this.form.plyerClr1[1].checked);" />
|
||||
<span class="configitem"><input id="useAIAsk" name="useAI" type="checkbox" onclick="chess.useAI(this.checked);" checked /> <label for="useAIAsk">Against machine</label></span>
|
||||
<span class="configitem">Pawn Promotion to: <select onchange="chess.setPromotion(this.selectedIndex);" name="selPromo"><option>Queen</option><option>Rook</option><option>Bishop</option><option>Knight</option></select></span>
|
||||
<span class="configitem">Player: <input type="radio" name="plyerClr1" id="white1" checked /> <label for="white1">white</label> <input type="radio" name="plyerClr1" id="black1" /> <label for="black1">black</label></span>
|
||||
<span class="configitem">Machine "think time" (press enter to save): <input type="text" name="plyDepthCtrl" value="0" size="2" onkeypress=";if(event.keyCode===13&&chess.setPlyDepth(this.value)){alert('Ply depth setted.' + (Number(this.value) > 2 ? '\nAttention! The game could be very slow.' : ' Good game :)'));}" /></span></p>
|
||||
|
||||
<div id="chessToolBar"><div id="setViewBtns"><span id="viewBtn2" onclick="chess.setView(2);pressVwBtn(2);" onmousedown="return(false);">3D view</span><span id="viewBtn1" onclick="chess.setView(1);pressVwBtn(1);" onmousedown="return(false);">2D view</span><span id="viewBtn3" onclick="chess.setView(3);pressVwBtn(3);" onmousedown="return(false);">Both</span></div>
|
||||
<img class="tbBtn" src="icons/skip-backward.png" title="" onclick="chess.backToStart();" />
|
||||
<img class="tbBtn" src="icons/backward.png" title="" onclick="chess.navigate(-10, true);" />
|
||||
<img class="tbBtn" src="icons/reverse-play.png" title="" onclick="chess.navigate(-1, true);" />
|
||||
<img class="tbBtn" src="icons/stop.png" title="" onclick="chess.stopMotion();" />
|
||||
<img class="tbBtn" src="icons/play.png" title="" onclick="chess.navigate(1, true);" />
|
||||
<img class="tbBtn" src="icons/forward.png" title="" onclick="chess.navigate(10, true);" />
|
||||
<img class="tbBtn" src="icons/skip-forward.png" title="" onclick="chess.returnToEnd();" />
|
||||
<img class="tbBtn" src="icons/go-previous.png" title="" onclick="chess.navigate(-1);">
|
||||
<img class="tbBtn" src="icons/go-next.png" title="" onclick="chess.navigate(1);" />
|
||||
<img class="tbBtn" src="icons/help-hint.png" title="" onclick="chess.help();" />
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div id="chessDesk"></div>
|
||||
|
||||
<form name="chessCtrl2" onsubmit="return(false);">
|
||||
<p style="text-align:center;">
|
||||
<span class="configitem">View side: <select onchange="chess.setSide(this.selectedIndex);" name="selSide"><option>White</option><option>Black</option><option selected>Human side</option></select></span>
|
||||
<span class="configitem"><input id="useKeybAsk" name="KeybCtrl" type="checkbox" onclick="chess.useKeyboard(this.checked);" checked /> <label for="useKeybAsk">Enable keyboard</label></span>
|
||||
<span class="configitem">Motion frame rate: <input type="text" name="frameRateCtrl" value="1000" size="5" onchange="var nMs=new Number(this.value);if(!isNaN(nMs)&&nMs>0){chess.setFrameRate(nMs);}" /> ms</p></span>
|
||||
</form>
|
||||
<!--
|
||||
<hr />
|
||||
<h3 style="text-align:center;">Running code within the "chess" object.</h3>
|
||||
<p style="text-align:center;">Please uncomment the function chess.runInside(<em>sCode</em>) to execute your code.<br />
|
||||
<textarea rows="10" cols="55" id="debugArea" onkeyup="if(event.ctrlKey&&event.shiftKey&&event.keyCode===32){chess.runInside(this.value);}">
|
||||
/**
|
||||
* Javascript Console.
|
||||
* Press Ctrl+Shift+Space to run code
|
||||
* within the "chess" object.
|
||||
*/
|
||||
|
||||
var sRappr = "";
|
||||
for (nBoardX = 0; nBoardX < 12; nBoardX++) {
|
||||
var nBoardY = 0;
|
||||
for (nBoardY = 0; nBoardY < 10; nBoardY++) { sRappr += (etc.aBoard[nBoardX * 10 + nBoardY]) + ", "; }
|
||||
sRappr = sRappr.substr(0, sRappr.length - 2) + "\n";
|
||||
}
|
||||
alert("This is the numeric rappresentation of the chessboard:\n\n" + sRappr);
|
||||
</textarea></p>
|
||||
-->
|
||||
</body>
|
||||
</html>
|
|
@ -1,833 +0,0 @@
|
|||
this.obj = [{
|
||||
"vrt": [
|
||||
[2.6393, 0.1425, -2.6346],
|
||||
[2.6459, 1.6177, -2.6412],
|
||||
[1.3795, 2.7277, -1.3748],
|
||||
[1.8809, 3.5641, -1.4595],
|
||||
[0.8151, 7.6582, -0.8103],
|
||||
[1.3146, 8.2446, -1.3098],
|
||||
[0.7789, 9.0617, -0.7692],
|
||||
[2.6393, 0.1425, 2.6394],
|
||||
[2.6459, 1.6177, 2.646],
|
||||
[1.3795, 2.7277, 1.3796],
|
||||
[1.8809, 3.5641, 1.4643],
|
||||
[0.8151, 7.6582, 0.8152],
|
||||
[1.3146, 8.2446, 1.3146],
|
||||
[0.7709, 9.0669, 0.7723],
|
||||
[-2.6346, 0.1425, 2.6394],
|
||||
[-2.6412, 1.6177, 2.646],
|
||||
[-1.3748, 2.7277, 1.3796],
|
||||
[-1.8762, 3.5641, 1.4643],
|
||||
[-0.8104, 7.6582, 0.8152],
|
||||
[-1.3098, 8.2446, 1.3146],
|
||||
[-0.7647, 9.0659, 0.7767],
|
||||
[-2.6346, 0.1425, -2.6346],
|
||||
[-2.6412, 1.6177, -2.6412],
|
||||
[-1.3748, 2.7277, -1.3748],
|
||||
[-1.8762, 3.5641, -1.4595],
|
||||
[-0.8104, 7.6582, -0.8103],
|
||||
[-1.3098, 8.2446, -1.3098],
|
||||
[-0.7614, 9.0669, -0.7681],
|
||||
[-1.291, 11.103, 1.2177],
|
||||
[0.0046, 11.103, 1.8867],
|
||||
[1.3002, 11.103, 1.2177],
|
||||
[-0.9301, 12.4285, 0.8711],
|
||||
[0.0046, 12.9403, 1.2177],
|
||||
[0.8991, 12.461, 0.8731],
|
||||
[-1.291, 11.103, -1.2711],
|
||||
[0.0046, 11.103, -1.9402],
|
||||
[1.3002, 11.103, -1.2711],
|
||||
[-0.9301, 12.4285, -0.9245],
|
||||
[0.0046, 12.9403, -1.2711],
|
||||
[0.8991, 12.461, -0.9265],
|
||||
[1.9969, 11.103, -0.0267],
|
||||
[1.14, 12.756, -0.0267],
|
||||
[0.0011, 13.3749, -0.032],
|
||||
[-1.1562, 12.7491, -0.0267],
|
||||
[-1.9876, 11.103, -0.0267],
|
||||
[0.5079, 11.6252, 1.5359],
|
||||
[1.0116, 12.1284, 0.9614],
|
||||
[1.0116, 12.1284, -1.0149],
|
||||
[0.5079, 11.6252, -1.5894],
|
||||
[1.3173, 12.4506, -0.0267],
|
||||
[0.2755, 11.8212, -1.6275],
|
||||
[0.2755, 11.8212, 1.574],
|
||||
[-0.4713, 13.97, -0.3942],
|
||||
[0.4614, 13.97, -0.3942],
|
||||
[0.4614, 13.97, 0.3199],
|
||||
[-0.4713, 13.97, 0.3199],
|
||||
[-0.005, 14.3261, -0.0372]
|
||||
],
|
||||
"fac": [
|
||||
[0, 8, 1, 0],
|
||||
[0, 7, 8, 0],
|
||||
[1, 9, 2, 0],
|
||||
[1, 8, 9, 0],
|
||||
[2, 10, 3, 0],
|
||||
[2, 9, 10, 0],
|
||||
[3, 11, 4, 0],
|
||||
[3, 10, 11, 0],
|
||||
[4, 12, 5, 0],
|
||||
[4, 11, 12, 0],
|
||||
[5, 13, 6, 0],
|
||||
[5, 12, 13, 0],
|
||||
[7, 15, 8, 0],
|
||||
[7, 14, 15, 0],
|
||||
[8, 16, 9, 0],
|
||||
[8, 15, 16, 0],
|
||||
[9, 17, 10, 0],
|
||||
[9, 16, 17, 0],
|
||||
[10, 18, 11, 0],
|
||||
[10, 17, 18, 0],
|
||||
[11, 19, 12, 0],
|
||||
[11, 18, 19, 0],
|
||||
[12, 20, 13, 0],
|
||||
[12, 19, 20, 0],
|
||||
[7, 21, 14, 0],
|
||||
[14, 22, 15, 0],
|
||||
[14, 21, 22, 0],
|
||||
[15, 23, 16, 0],
|
||||
[15, 22, 23, 0],
|
||||
[16, 24, 17, 0],
|
||||
[16, 23, 24, 0],
|
||||
[17, 25, 18, 0],
|
||||
[17, 24, 25, 0],
|
||||
[18, 26, 19, 0],
|
||||
[18, 25, 26, 0],
|
||||
[19, 27, 20, 0],
|
||||
[19, 26, 27, 0],
|
||||
[7, 0, 21, 0],
|
||||
[21, 1, 22, 0],
|
||||
[21, 0, 1, 0],
|
||||
[22, 2, 23, 0],
|
||||
[22, 1, 2, 0],
|
||||
[23, 3, 24, 0],
|
||||
[23, 2, 3, 0],
|
||||
[24, 4, 25, 0],
|
||||
[24, 3, 4, 0],
|
||||
[25, 5, 26, 0],
|
||||
[25, 4, 5, 0],
|
||||
[26, 6, 27, 0],
|
||||
[26, 5, 6, 0],
|
||||
[20, 28, 29, 1],
|
||||
[32, 29, 28, 1],
|
||||
[28, 31, 32, 1],
|
||||
[35, 34, 27, 0],
|
||||
[27, 6, 35, 0],
|
||||
[36, 35, 6, 0],
|
||||
[38, 37, 34, 0],
|
||||
[34, 35, 38, 0],
|
||||
[50, 39, 38, 0],
|
||||
[50, 38, 35, 0],
|
||||
[48, 50, 35, 0],
|
||||
[48, 35, 36, 0],
|
||||
[48, 36, 47, 0],
|
||||
[13, 30, 40, 0],
|
||||
[46, 49, 40, 0],
|
||||
[40, 30, 46, 0],
|
||||
[42, 41, 33, 0],
|
||||
[33, 32, 42, 0],
|
||||
[37, 38, 42, 0],
|
||||
[42, 43, 37, 0],
|
||||
[34, 37, 43, 0],
|
||||
[43, 44, 34, 0],
|
||||
[27, 34, 44, 0],
|
||||
[32, 33, 51, 1],
|
||||
[45, 46, 30, 1],
|
||||
[45, 30, 29, 1],
|
||||
[51, 45, 29, 1],
|
||||
[32, 51, 29, 1],
|
||||
[47, 36, 40, 0],
|
||||
[40, 49, 47, 0],
|
||||
[53, 52, 42, 0],
|
||||
[54, 53, 42, 0],
|
||||
[55, 54, 42, 0],
|
||||
[52, 55, 42, 0],
|
||||
[53, 56, 52, 0],
|
||||
[54, 56, 53, 0],
|
||||
[55, 56, 54, 0],
|
||||
[52, 56, 55, 0],
|
||||
[13, 40, 6, 0],
|
||||
[6, 40, 36, 0],
|
||||
[20, 29, 13, 0],
|
||||
[13, 29, 30, 0],
|
||||
[27, 44, 20, 0],
|
||||
[20, 44, 28, 0],
|
||||
[44, 43, 28, 0],
|
||||
[28, 43, 31, 0],
|
||||
[31, 43, 42, 0],
|
||||
[31, 42, 32, 0],
|
||||
[41, 42, 39, 0],
|
||||
[39, 42, 38, 0],
|
||||
[51, 50, 45, 0],
|
||||
[45, 50, 48, 0],
|
||||
[51, 33, 50, 0],
|
||||
[33, 41, 50, 0],
|
||||
[41, 39, 50, 0],
|
||||
[45, 48, 46, 0],
|
||||
[46, 48, 49, 0],
|
||||
[49, 48, 47, 0]
|
||||
],
|
||||
"nrm": [
|
||||
[0.7071, -0.7071, -0.0045],
|
||||
[0.7071, -0.7071, -0.0045],
|
||||
[0.4661, -0.4661, 0.752],
|
||||
[0.4661, -0.4661, 0.752],
|
||||
[0.6065, -0.6065, -0.5142],
|
||||
[0.6065, -0.6065, -0.5142],
|
||||
[0.6843, -0.6843, 0.2519],
|
||||
[0.6843, -0.6843, 0.2519],
|
||||
[0.5383, -0.5383, -0.6484],
|
||||
[0.5383, -0.5383, -0.6484],
|
||||
[0.5901, -0.5936, 0.5472],
|
||||
[0.5898, -0.5898, 0.5515],
|
||||
[-0.7071, -0.7071, -0.0045],
|
||||
[-0.7071, -0.7071, -0.0045],
|
||||
[-0.4661, -0.4661, 0.752],
|
||||
[-0.4661, -0.4661, 0.752],
|
||||
[-0.7035, -0.7035, -0.1008],
|
||||
[-0.7035, -0.7035, -0.1008],
|
||||
[-0.6984, -0.6984, 0.1566],
|
||||
[-0.6984, -0.6984, 0.1566],
|
||||
[-0.5383, -0.5383, -0.6484],
|
||||
[-0.5383, -0.5383, -0.6484],
|
||||
[-0.5884, -0.5913, 0.5515],
|
||||
[-0.5915, -0.5915, 0.5479],
|
||||
[-0, 0, -1],
|
||||
[-0.7071, 0.7071, -0.0045],
|
||||
[-0.7071, 0.7071, -0.0045],
|
||||
[-0.4661, 0.4661, 0.752],
|
||||
[-0.4661, 0.4661, 0.752],
|
||||
[-0.6065, 0.6065, -0.5142],
|
||||
[-0.6065, 0.6065, -0.5142],
|
||||
[-0.6843, 0.6843, 0.2519],
|
||||
[-0.6843, 0.6843, 0.2519],
|
||||
[-0.5383, 0.5383, -0.6484],
|
||||
[-0.5383, 0.5383, -0.6484],
|
||||
[-0.5884, 0.5904, 0.5524],
|
||||
[-0.5882, 0.5882, 0.5549],
|
||||
[0, 0, -1],
|
||||
[0.7071, 0.7071, -0.0045],
|
||||
[0.7071, 0.7071, -0.0045],
|
||||
[0.4661, 0.4661, 0.752],
|
||||
[0.4661, 0.4661, 0.752],
|
||||
[0.7035, 0.7035, -0.1008],
|
||||
[0.7035, 0.7035, -0.1008],
|
||||
[0.6984, 0.6984, 0.1566],
|
||||
[0.6984, 0.6984, 0.1566],
|
||||
[0.5383, 0.5383, -0.6484],
|
||||
[0.5383, 0.5383, -0.6484],
|
||||
[0.5917, 0.5899, 0.5496],
|
||||
[0.5897, 0.5897, 0.5518],
|
||||
[-0.9098, -0.2901, -0.2969],
|
||||
[-0.9065, -0.2891, 0.3078],
|
||||
[-0.9121, -0.2252, 0.3425],
|
||||
[0.2878, 0.9023, -0.321],
|
||||
[0.6114, 0.6147, -0.4983],
|
||||
[0.9032, 0.288, -0.3182],
|
||||
[0.2252, 0.9121, 0.3425],
|
||||
[0.2891, 0.9065, 0.3078],
|
||||
[0.9071, 0.2001, 0.3703],
|
||||
[0.7778, 0.5306, 0.3369],
|
||||
[0.8899, 0.3787, 0.2543],
|
||||
[0.9415, 0.3003, 0.1528],
|
||||
[0.9243, 0.1661, 0.3436],
|
||||
[0.2576, -0.9129, -0.3166],
|
||||
[0.306, -0.857, 0.4147],
|
||||
[0.2549, -0.9033, 0.3451],
|
||||
[0.0394, -0.5822, 0.8121],
|
||||
[0.1825, -0.5733, 0.7988],
|
||||
[-0.1829, 0.5791, 0.7945],
|
||||
[-0.028, 0.591, 0.8062],
|
||||
[-0.3833, 0.8632, 0.3287],
|
||||
[-0.2485, 0.8807, 0.4033],
|
||||
[-0.2565, 0.909, -0.3284],
|
||||
[-0.2001, -0.9071, 0.3703],
|
||||
[-0.1661, -0.9243, 0.3436],
|
||||
[-0.3003, -0.9415, 0.1528],
|
||||
[-0.3787, -0.8899, 0.2543],
|
||||
[-0.5306, -0.7778, 0.3369],
|
||||
[0.9033, -0.2549, 0.3451],
|
||||
[0.857, -0.306, 0.4147],
|
||||
[0.604, 0.604, -0.52],
|
||||
[0.5593, -0.5593, -0.6118],
|
||||
[-0.6087, -0.6087, -0.5089],
|
||||
[-0.5538, 0.5538, -0.6218],
|
||||
[0.4993, 0.4993, 0.708],
|
||||
[0.4291, -0.4291, 0.7948],
|
||||
[-0.4993, -0.4993, 0.708],
|
||||
[-0.4291, 0.4291, 0.7948],
|
||||
[0.6021, -0.6109, -0.514],
|
||||
[0.9104, -0.2569, -0.3244],
|
||||
[-0.6186, -0.6226, -0.4793],
|
||||
[-0.2899, -0.9091, -0.2993],
|
||||
[-0.6044, 0.6075, -0.5153],
|
||||
[-0.9136, 0.2578, -0.3144],
|
||||
[-0.8807, 0.2485, 0.4033],
|
||||
[-0.8632, 0.3833, 0.3287],
|
||||
[-0.589, 0.0261, 0.8077],
|
||||
[-0.5775, 0.1841, 0.7954],
|
||||
[0.5843, -0.0411, 0.8105],
|
||||
[0.5749, -0.1813, 0.7979],
|
||||
[0.4558, -0.4558, 0.7645],
|
||||
[0.4558, -0.4558, 0.7645],
|
||||
[0.5064, -0.5064, -0.698],
|
||||
[0.5413, -0.5172, -0.663],
|
||||
[0.4445, -0.5228, -0.7274],
|
||||
[-0.4998, 0.4998, 0.7074],
|
||||
[-0.5112, 0.5047, 0.6957],
|
||||
[-0.4789, 0.5054, 0.7178]
|
||||
],
|
||||
"tex": [
|
||||
[
|
||||
[7.2839, -24.849],
|
||||
[-12.017, -17.2137],
|
||||
[7.3321, -17.2137]
|
||||
],
|
||||
[
|
||||
[7.2839, -24.849],
|
||||
[-12.017, -24.849],
|
||||
[-12.017, -17.2137]
|
||||
],
|
||||
[
|
||||
[7.3321, -17.2137],
|
||||
[-12.017, -11.4689],
|
||||
[-1.9372, -11.4688]
|
||||
],
|
||||
[
|
||||
[7.3321, -17.2137],
|
||||
[-12.017, -17.2137],
|
||||
[-12.017, -11.4689]
|
||||
],
|
||||
[
|
||||
[-1.9372, -11.4688],
|
||||
[-12.017, -5.1848],
|
||||
[-1.3167, -5.1847]
|
||||
],
|
||||
[
|
||||
[-1.9372, -11.4688],
|
||||
[-12.017, -11.4689],
|
||||
[-12.017, -5.1848]
|
||||
],
|
||||
[
|
||||
[-1.3167, -5.1847],
|
||||
[-12.017, 17.728],
|
||||
[-6.0682, 17.728]
|
||||
],
|
||||
[
|
||||
[-1.3167, -5.1847],
|
||||
[-12.017, -5.1848],
|
||||
[-12.017, 17.728]
|
||||
],
|
||||
[
|
||||
[-6.0682, 17.728],
|
||||
[-12.017, 20.7633],
|
||||
[-2.4126, 20.7633]
|
||||
],
|
||||
[
|
||||
[-6.0682, 17.728],
|
||||
[-12.017, 17.728],
|
||||
[-12.017, 20.7633]
|
||||
],
|
||||
[
|
||||
[-2.4126, 20.7633],
|
||||
[-12.017, 24.996],
|
||||
[-4.9863, 24.996]
|
||||
],
|
||||
[
|
||||
[-2.4126, 20.7633],
|
||||
[-12.017, 20.7633],
|
||||
[-12.017, 24.996]
|
||||
],
|
||||
[
|
||||
[-12.017, -24.849],
|
||||
[-31.3662, -17.2137],
|
||||
[-12.017, -17.2137]
|
||||
],
|
||||
[
|
||||
[-12.017, -24.849],
|
||||
[-31.318, -24.849],
|
||||
[-31.3662, -17.2137]
|
||||
],
|
||||
[
|
||||
[-12.017, -17.2137],
|
||||
[-22.0969, -11.4688],
|
||||
[-12.017, -11.4689]
|
||||
],
|
||||
[
|
||||
[-12.017, -17.2137],
|
||||
[-31.3662, -17.2137],
|
||||
[-22.0969, -11.4688]
|
||||
],
|
||||
[
|
||||
[-12.017, -11.4689],
|
||||
[-22.7174, -5.1847],
|
||||
[-12.017, -5.1848]
|
||||
],
|
||||
[
|
||||
[-12.017, -11.4689],
|
||||
[-22.0969, -11.4688],
|
||||
[-22.7174, -5.1847]
|
||||
],
|
||||
[
|
||||
[-12.017, -5.1848],
|
||||
[-17.9659, 17.728],
|
||||
[-12.017, 17.728]
|
||||
],
|
||||
[
|
||||
[-12.017, -5.1848],
|
||||
[-22.7174, -5.1847],
|
||||
[-17.9659, 17.728]
|
||||
],
|
||||
[
|
||||
[-12.017, 17.728],
|
||||
[-21.6214, 20.7633],
|
||||
[-12.017, 20.7633]
|
||||
],
|
||||
[
|
||||
[-12.017, 17.728],
|
||||
[-17.9659, 17.728],
|
||||
[-21.6214, 20.7633]
|
||||
],
|
||||
[
|
||||
[-12.017, 20.7633],
|
||||
[-19.0478, 24.996],
|
||||
[-12.017, 24.996]
|
||||
],
|
||||
[
|
||||
[-12.017, 20.7633],
|
||||
[-21.6214, 20.7633],
|
||||
[-19.0478, 24.996]
|
||||
],
|
||||
[
|
||||
[-12.017, -24.849],
|
||||
[-12.017, -24.849],
|
||||
[-31.318, -24.849]
|
||||
],
|
||||
[
|
||||
[-31.318, -24.849],
|
||||
[-12.017, -17.2137],
|
||||
[-31.3662, -17.2137]
|
||||
],
|
||||
[
|
||||
[-31.318, -24.849],
|
||||
[-12.017, -24.849],
|
||||
[-12.017, -17.2137]
|
||||
],
|
||||
[
|
||||
[-31.3662, -17.2137],
|
||||
[-12.017, -11.4688],
|
||||
[-22.0969, -11.4688]
|
||||
],
|
||||
[
|
||||
[-31.3662, -17.2137],
|
||||
[-12.017, -17.2137],
|
||||
[-12.017, -11.4688]
|
||||
],
|
||||
[
|
||||
[-22.0969, -11.4688],
|
||||
[-12.017, -5.1847],
|
||||
[-22.7174, -5.1847]
|
||||
],
|
||||
[
|
||||
[-22.0969, -11.4688],
|
||||
[-12.017, -11.4688],
|
||||
[-12.017, -5.1847]
|
||||
],
|
||||
[
|
||||
[-22.7174, -5.1847],
|
||||
[-12.017, 17.728],
|
||||
[-17.9659, 17.728]
|
||||
],
|
||||
[
|
||||
[-22.7174, -5.1847],
|
||||
[-12.017, -5.1847],
|
||||
[-12.017, 17.728]
|
||||
],
|
||||
[
|
||||
[-17.9659, 17.728],
|
||||
[-12.017, 20.7633],
|
||||
[-21.6214, 20.7633]
|
||||
],
|
||||
[
|
||||
[-17.9659, 17.728],
|
||||
[-12.017, 17.728],
|
||||
[-12.017, 20.7633]
|
||||
],
|
||||
[
|
||||
[-21.6214, 20.7633],
|
||||
[-12.017, 24.996],
|
||||
[-19.0478, 24.996]
|
||||
],
|
||||
[
|
||||
[-21.6214, 20.7633],
|
||||
[-12.017, 20.7633],
|
||||
[-12.017, 24.996]
|
||||
],
|
||||
[
|
||||
[-12.017, -24.849],
|
||||
[7.2839, -24.849],
|
||||
[-12.017, -24.849]
|
||||
],
|
||||
[
|
||||
[-12.017, -24.849],
|
||||
[7.3321, -17.2137],
|
||||
[-12.017, -17.2137]
|
||||
],
|
||||
[
|
||||
[-12.017, -24.849],
|
||||
[7.2839, -24.849],
|
||||
[7.3321, -17.2137]
|
||||
],
|
||||
[
|
||||
[-12.017, -17.2137],
|
||||
[-1.9372, -11.4688],
|
||||
[-12.017, -11.4688]
|
||||
],
|
||||
[
|
||||
[-12.017, -17.2137],
|
||||
[7.3321, -17.2137],
|
||||
[-1.9372, -11.4688]
|
||||
],
|
||||
[
|
||||
[-12.017, -11.4688],
|
||||
[-1.3167, -5.1847],
|
||||
[-12.017, -5.1847]
|
||||
],
|
||||
[
|
||||
[-12.017, -11.4688],
|
||||
[-1.9372, -11.4688],
|
||||
[-1.3167, -5.1847]
|
||||
],
|
||||
[
|
||||
[-12.017, -5.1847],
|
||||
[-6.0682, 17.728],
|
||||
[-12.017, 17.728]
|
||||
],
|
||||
[
|
||||
[-12.017, -5.1847],
|
||||
[-1.3167, -5.1847],
|
||||
[-6.0682, 17.728]
|
||||
],
|
||||
[
|
||||
[-12.017, 17.728],
|
||||
[-2.4126, 20.7633],
|
||||
[-12.017, 20.7633]
|
||||
],
|
||||
[
|
||||
[-12.017, 17.728],
|
||||
[-6.0682, 17.728],
|
||||
[-2.4126, 20.7633]
|
||||
],
|
||||
[
|
||||
[-12.017, 20.7633],
|
||||
[-4.9863, 24.996],
|
||||
[-12.017, 24.996]
|
||||
],
|
||||
[
|
||||
[-12.017, 20.7633],
|
||||
[-2.4126, 20.7633],
|
||||
[-4.9863, 24.996]
|
||||
],
|
||||
[
|
||||
[1, 0],
|
||||
[1, 0.5],
|
||||
[0.5, 0.5]
|
||||
],
|
||||
[
|
||||
[0.5, 1],
|
||||
[0.5, 0.5],
|
||||
[1, 0.5]
|
||||
],
|
||||
[
|
||||
[1, 0.5],
|
||||
[1, 1],
|
||||
[0.5, 1]
|
||||
],
|
||||
[
|
||||
[0.5, 0.5],
|
||||
[0, 0.5],
|
||||
[0, 0]
|
||||
],
|
||||
[
|
||||
[0, 0],
|
||||
[0.5, 0],
|
||||
[0.5, 0.5]
|
||||
],
|
||||
[
|
||||
[1, 0.5],
|
||||
[0.5, 0.5],
|
||||
[0.5, 0]
|
||||
],
|
||||
[
|
||||
[0.5, 1],
|
||||
[0, 1],
|
||||
[0, 0.5]
|
||||
],
|
||||
[
|
||||
[0, 0.5],
|
||||
[0.5, 0.5],
|
||||
[0.5, 1]
|
||||
],
|
||||
[
|
||||
[0.6018, 0.6679],
|
||||
[1, 0.9941],
|
||||
[0.5, 1]
|
||||
],
|
||||
[
|
||||
[0.6018, 0.6679],
|
||||
[0.5, 1],
|
||||
[0.5, 0.5]
|
||||
],
|
||||
[
|
||||
[0.7009, 0.6308],
|
||||
[0.6018, 0.6679],
|
||||
[0.5, 0.5]
|
||||
],
|
||||
[
|
||||
[0.7009, 0.6308],
|
||||
[0.5, 0.5],
|
||||
[1, 0.5]
|
||||
],
|
||||
[
|
||||
[0.7009, 0.6308],
|
||||
[1, 0.5],
|
||||
[1, 0.8697]
|
||||
],
|
||||
[
|
||||
[0, 0],
|
||||
[0.5, 0],
|
||||
[0.5, 0.5]
|
||||
],
|
||||
[
|
||||
[0.8697, 0],
|
||||
[0.8955, 0.5],
|
||||
[0.5, 0.5]
|
||||
],
|
||||
[
|
||||
[0.5, 0.5],
|
||||
[0.5, 0],
|
||||
[0.8697, 0]
|
||||
],
|
||||
[
|
||||
[0.5, 0.5],
|
||||
[0, 0.5],
|
||||
[0, 0]
|
||||
],
|
||||
[
|
||||
[0, 0],
|
||||
[0.5, 0],
|
||||
[0.5, 0.5]
|
||||
],
|
||||
[
|
||||
[1, 1],
|
||||
[0.5, 1],
|
||||
[0.5, 0.5]
|
||||
],
|
||||
[
|
||||
[0.5, 0.5],
|
||||
[1, 0.5],
|
||||
[1, 1]
|
||||
],
|
||||
[
|
||||
[0.5, 1],
|
||||
[0, 1],
|
||||
[0, 0.5]
|
||||
],
|
||||
[
|
||||
[0, 0.5],
|
||||
[0.5, 0.5],
|
||||
[0.5, 1]
|
||||
],
|
||||
[
|
||||
[1, 1],
|
||||
[0.5, 1],
|
||||
[0.5, 0.5]
|
||||
],
|
||||
[
|
||||
[0.5, 1],
|
||||
[0, 0.9941],
|
||||
[0.3952, 0.6709]
|
||||
],
|
||||
[
|
||||
[0.2991, 0.6308],
|
||||
[0, 0.8697],
|
||||
[0, 0.5]
|
||||
],
|
||||
[
|
||||
[0.2991, 0.6308],
|
||||
[0, 0.5],
|
||||
[0.5, 0.5]
|
||||
],
|
||||
[
|
||||
[0.3952, 0.6709],
|
||||
[0.2991, 0.6308],
|
||||
[0.5, 0.5]
|
||||
],
|
||||
[
|
||||
[0.5, 1],
|
||||
[0.3952, 0.6709],
|
||||
[0.5, 0.5]
|
||||
],
|
||||
[
|
||||
[0.8697, 1],
|
||||
[0.5, 1],
|
||||
[0.5, 0.5]
|
||||
],
|
||||
[
|
||||
[0.5, 0.5],
|
||||
[0.8955, 0.5],
|
||||
[0.8697, 1]
|
||||
],
|
||||
[
|
||||
[1, -0],
|
||||
[0, -0],
|
||||
[0.5, 1]
|
||||
],
|
||||
[
|
||||
[1, -0],
|
||||
[0, -0],
|
||||
[0.5, 1]
|
||||
],
|
||||
[
|
||||
[1, -0],
|
||||
[0, -0],
|
||||
[0.5, 1]
|
||||
],
|
||||
[
|
||||
[1, -0],
|
||||
[0, -0],
|
||||
[0.5, 1]
|
||||
],
|
||||
[
|
||||
[1, 1],
|
||||
[0.5, 0.5],
|
||||
[0, 1]
|
||||
],
|
||||
[
|
||||
[1, 0],
|
||||
[0.5, 0.5],
|
||||
[1, 1]
|
||||
],
|
||||
[
|
||||
[0, 0],
|
||||
[0.5, 0.5],
|
||||
[1, 0]
|
||||
],
|
||||
[
|
||||
[0, 1],
|
||||
[0.5, 0.5],
|
||||
[0, 0]
|
||||
],
|
||||
[
|
||||
[-12.017, 24.996],
|
||||
[0.5, 0.5],
|
||||
[-4.9863, 24.996]
|
||||
],
|
||||
[
|
||||
[-4.9863, 24.996],
|
||||
[0.5, 0.5],
|
||||
[1, 0.5]
|
||||
],
|
||||
[
|
||||
[-19.0478, 24.996],
|
||||
[0.5, 0.5],
|
||||
[-12.017, 24.996]
|
||||
],
|
||||
[
|
||||
[-12.017, 24.996],
|
||||
[0.5, 0.5],
|
||||
[0, 0.5]
|
||||
],
|
||||
[
|
||||
[-12.017, 24.996],
|
||||
[0.5, 0.5],
|
||||
[-19.0478, 24.996]
|
||||
],
|
||||
[
|
||||
[-19.0478, 24.996],
|
||||
[0.5, 0.5],
|
||||
[1, 0.5]
|
||||
],
|
||||
[
|
||||
[0.5, 0.5],
|
||||
[1, 0.5],
|
||||
[1, 0.5]
|
||||
],
|
||||
[
|
||||
[1, 0.5],
|
||||
[1, 0.5],
|
||||
[1, 1]
|
||||
],
|
||||
[
|
||||
[1, 1],
|
||||
[1, 0.5],
|
||||
[0.5, 0.5]
|
||||
],
|
||||
[
|
||||
[1, 1],
|
||||
[0.5, 0.5],
|
||||
[0.5, 1]
|
||||
],
|
||||
[
|
||||
[1, 0.5],
|
||||
[0.5, 0.5],
|
||||
[1, 1]
|
||||
],
|
||||
[
|
||||
[1, 1],
|
||||
[0.5, 0.5],
|
||||
[0.5, 1]
|
||||
],
|
||||
[
|
||||
[0.3952, 0.6709],
|
||||
[0.6018, 0.6679],
|
||||
[0.2991, 0.6308]
|
||||
],
|
||||
[
|
||||
[0.2991, 0.6308],
|
||||
[0.6018, 0.6679],
|
||||
[0.7009, 0.6308]
|
||||
],
|
||||
[
|
||||
[0.3952, 0.6709],
|
||||
[0, 0],
|
||||
[0.6018, 0.6679]
|
||||
],
|
||||
[
|
||||
[0, 0],
|
||||
[1, 0.5],
|
||||
[0.6018, 0.6679]
|
||||
],
|
||||
[
|
||||
[1, 0.5],
|
||||
[1, 1],
|
||||
[0.6018, 0.6679]
|
||||
],
|
||||
[
|
||||
[0.2991, 0.6308],
|
||||
[0.7009, 0.6308],
|
||||
[0.8697, 0]
|
||||
],
|
||||
[
|
||||
[0.8697, 0],
|
||||
[0.7009, 0.6308],
|
||||
[0.8955, 0.5]
|
||||
],
|
||||
[
|
||||
[0.8955, 0.5],
|
||||
[0.7009, 0.6308],
|
||||
[1, 0.8697]
|
||||
]
|
||||
]
|
||||
}];
|
||||
this.mat = [{
|
||||
"r": 150,
|
||||
"g": 150,
|
||||
"b": 150
|
||||
},
|
||||
{
|
||||
"r": 150,
|
||||
"g": 150,
|
||||
"b": 150
|
||||
}];
|
|
@ -1,999 +0,0 @@
|
|||
{
|
||||
"obj": [{
|
||||
"vrt": [
|
||||
[-40, 0, -40],
|
||||
[-30, 0, -40],
|
||||
[-20, 0, -40],
|
||||
[-10, 0, -40],
|
||||
[0, 0, -40],
|
||||
[10, 0, -40],
|
||||
[20, 0, -40],
|
||||
[30, 0, -40],
|
||||
[40, 0, -40],
|
||||
[-40, 0, -30],
|
||||
[-30, 0, -30],
|
||||
[-20, 0, -30],
|
||||
[-10, 0, -30],
|
||||
[0, 0, -30],
|
||||
[10, 0, -30],
|
||||
[20, 0, -30],
|
||||
[30, 0, -30],
|
||||
[40, 0, -30],
|
||||
[-40, 0, -20],
|
||||
[-30, 0, -20],
|
||||
[-20, 0, -20],
|
||||
[-10, 0, -20],
|
||||
[0, 0, -20],
|
||||
[10, 0, -20],
|
||||
[20, 0, -20],
|
||||
[30, 0, -20],
|
||||
[40, 0, -20],
|
||||
[-40, 0, -10],
|
||||
[-30, 0, -10],
|
||||
[-20, 0, -10],
|
||||
[-10, 0, -10],
|
||||
[0, 0, -10],
|
||||
[10, 0, -10],
|
||||
[20, 0, -10],
|
||||
[30, 0, -10],
|
||||
[40, 0, -10],
|
||||
[-40, 0, 0],
|
||||
[-30, 0, 0],
|
||||
[-20, 0, 0],
|
||||
[-10, 0, 0],
|
||||
[0, 0, 0],
|
||||
[10, 0, 0],
|
||||
[20, 0, 0],
|
||||
[30, 0, 0],
|
||||
[40, 0, 0],
|
||||
[-40, 0, 10],
|
||||
[-30, 0, 10],
|
||||
[-20, 0, 10],
|
||||
[-10, 0, 10],
|
||||
[0, 0, 10],
|
||||
[10, 0, 10],
|
||||
[20, 0, 10],
|
||||
[30, 0, 10],
|
||||
[40, 0, 10],
|
||||
[-40, 0, 20],
|
||||
[-30, 0, 20],
|
||||
[-20, 0, 20],
|
||||
[-10, 0, 20],
|
||||
[0, 0, 20],
|
||||
[10, 0, 20],
|
||||
[20, 0, 20],
|
||||
[30, 0, 20],
|
||||
[40, 0, 20],
|
||||
[-40, 0, 30],
|
||||
[-30, 0, 30],
|
||||
[-20, 0, 30],
|
||||
[-10, 0, 30],
|
||||
[0, 0, 30],
|
||||
[10, 0, 30],
|
||||
[20, 0, 30],
|
||||
[30, 0, 30],
|
||||
[40, 0, 30],
|
||||
[-40, 0, 40],
|
||||
[-30, 0, 40],
|
||||
[-20, 0, 40],
|
||||
[-10, 0, 40],
|
||||
[0, 0, 40],
|
||||
[10, 0, 40],
|
||||
[20, 0, 40],
|
||||
[30, 0, 40],
|
||||
[40, 0, 40]
|
||||
],
|
||||
"fac": [
|
||||
[9, 0, 10, 0],
|
||||
[1, 10, 0, 0],
|
||||
[10, 1, 11, 1],
|
||||
[2, 11, 1, 1],
|
||||
[11, 2, 12, 0],
|
||||
[3, 12, 2, 0],
|
||||
[12, 3, 13, 1],
|
||||
[4, 13, 3, 1],
|
||||
[13, 4, 14, 0],
|
||||
[5, 14, 4, 0],
|
||||
[14, 5, 15, 1],
|
||||
[6, 15, 5, 1],
|
||||
[15, 6, 16, 0],
|
||||
[7, 16, 6, 0],
|
||||
[16, 7, 17, 1],
|
||||
[8, 17, 7, 1],
|
||||
[18, 9, 19, 1],
|
||||
[10, 19, 9, 1],
|
||||
[19, 10, 20, 0],
|
||||
[11, 20, 10, 0],
|
||||
[20, 11, 21, 1],
|
||||
[12, 21, 11, 1],
|
||||
[21, 12, 22, 0],
|
||||
[13, 22, 12, 0],
|
||||
[22, 13, 23, 1],
|
||||
[14, 23, 13, 1],
|
||||
[23, 14, 24, 0],
|
||||
[15, 24, 14, 0],
|
||||
[24, 15, 25, 1],
|
||||
[16, 25, 15, 1],
|
||||
[25, 16, 26, 0],
|
||||
[17, 26, 16, 0],
|
||||
[27, 18, 28, 0],
|
||||
[19, 28, 18, 0],
|
||||
[28, 19, 29, 1],
|
||||
[20, 29, 19, 1],
|
||||
[29, 20, 30, 0],
|
||||
[21, 30, 20, 0],
|
||||
[30, 21, 31, 1],
|
||||
[22, 31, 21, 1],
|
||||
[31, 22, 32, 0],
|
||||
[23, 32, 22, 0],
|
||||
[32, 23, 33, 1],
|
||||
[24, 33, 23, 1],
|
||||
[33, 24, 34, 0],
|
||||
[25, 34, 24, 0],
|
||||
[34, 25, 35, 1],
|
||||
[26, 35, 25, 1],
|
||||
[36, 27, 37, 1],
|
||||
[28, 37, 27, 1],
|
||||
[37, 28, 38, 0],
|
||||
[29, 38, 28, 0],
|
||||
[38, 29, 39, 1],
|
||||
[30, 39, 29, 1],
|
||||
[39, 30, 40, 0],
|
||||
[31, 40, 30, 0],
|
||||
[40, 31, 41, 1],
|
||||
[32, 41, 31, 1],
|
||||
[41, 32, 42, 0],
|
||||
[33, 42, 32, 0],
|
||||
[42, 33, 43, 1],
|
||||
[34, 43, 33, 1],
|
||||
[43, 34, 44, 0],
|
||||
[35, 44, 34, 0],
|
||||
[45, 36, 46, 0],
|
||||
[37, 46, 36, 0],
|
||||
[46, 37, 47, 1],
|
||||
[38, 47, 37, 1],
|
||||
[47, 38, 48, 0],
|
||||
[39, 48, 38, 0],
|
||||
[48, 39, 49, 1],
|
||||
[40, 49, 39, 1],
|
||||
[49, 40, 50, 0],
|
||||
[41, 50, 40, 0],
|
||||
[50, 41, 51, 1],
|
||||
[42, 51, 41, 1],
|
||||
[51, 42, 52, 0],
|
||||
[43, 52, 42, 0],
|
||||
[52, 43, 53, 1],
|
||||
[44, 53, 43, 1],
|
||||
[54, 45, 55, 1],
|
||||
[46, 55, 45, 1],
|
||||
[55, 46, 56, 0],
|
||||
[47, 56, 46, 0],
|
||||
[56, 47, 57, 1],
|
||||
[48, 57, 47, 1],
|
||||
[57, 48, 58, 0],
|
||||
[49, 58, 48, 0],
|
||||
[58, 49, 59, 1],
|
||||
[50, 59, 49, 1],
|
||||
[59, 50, 60, 0],
|
||||
[51, 60, 50, 0],
|
||||
[60, 51, 61, 1],
|
||||
[52, 61, 51, 1],
|
||||
[61, 52, 62, 0],
|
||||
[53, 62, 52, 0],
|
||||
[63, 54, 64, 0],
|
||||
[55, 64, 54, 0],
|
||||
[64, 55, 65, 1],
|
||||
[56, 65, 55, 1],
|
||||
[65, 56, 66, 0],
|
||||
[57, 66, 56, 0],
|
||||
[66, 57, 67, 1],
|
||||
[58, 67, 57, 1],
|
||||
[67, 58, 68, 0],
|
||||
[59, 68, 58, 0],
|
||||
[68, 59, 69, 1],
|
||||
[60, 69, 59, 1],
|
||||
[69, 60, 70, 0],
|
||||
[61, 70, 60, 0],
|
||||
[70, 61, 71, 1],
|
||||
[62, 71, 61, 1],
|
||||
[72, 63, 73, 1],
|
||||
[64, 73, 63, 1],
|
||||
[73, 64, 74, 0],
|
||||
[65, 74, 64, 0],
|
||||
[74, 65, 75, 1],
|
||||
[66, 75, 65, 1],
|
||||
[75, 66, 76, 0],
|
||||
[67, 76, 66, 0],
|
||||
[76, 67, 77, 1],
|
||||
[68, 77, 67, 1],
|
||||
[77, 68, 78, 0],
|
||||
[69, 78, 68, 0],
|
||||
[78, 69, 79, 1],
|
||||
[70, 79, 69, 1],
|
||||
[79, 70, 80, 0],
|
||||
[71, 80, 70, 0]
|
||||
],
|
||||
"nrm": [
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0],
|
||||
[0, 1, 0]
|
||||
],
|
||||
"tex": [
|
||||
[
|
||||
[0, 0.125],
|
||||
[0, 0],
|
||||
[0.125, 0.125]
|
||||
],
|
||||
[
|
||||
[0.125, 0],
|
||||
[0.125, 0.125],
|
||||
[0, 0]
|
||||
],
|
||||
[
|
||||
[0.125, 0.125],
|
||||
[0.125, 0],
|
||||
[0.25, 0.125]
|
||||
],
|
||||
[
|
||||
[0.25, 0],
|
||||
[0.25, 0.125],
|
||||
[0.125, 0]
|
||||
],
|
||||
[
|
||||
[0.25, 0.125],
|
||||
[0.25, 0],
|
||||
[0.375, 0.125]
|
||||
],
|
||||
[
|
||||
[0.375, 0],
|
||||
[0.375, 0.125],
|
||||
[0.25, 0]
|
||||
],
|
||||
[
|
||||
[0.375, 0.125],
|
||||
[0.375, 0],
|
||||
[0.5, 0.125]
|
||||
],
|
||||
[
|
||||
[0.5, 0],
|
||||
[0.5, 0.125],
|
||||
[0.375, 0]
|
||||
],
|
||||
[
|
||||
[0.5, 0.125],
|
||||
[0.5, 0],
|
||||
[0.625, 0.125]
|
||||
],
|
||||
[
|
||||
[0.625, 0],
|
||||
[0.625, 0.125],
|
||||
[0.5, 0]
|
||||
],
|
||||
[
|
||||
[0.625, 0.125],
|
||||
[0.625, 0],
|
||||
[0.75, 0.125]
|
||||
],
|
||||
[
|
||||
[0.75, 0],
|
||||
[0.75, 0.125],
|
||||
[0.625, 0]
|
||||
],
|
||||
[
|
||||
[0.75, 0.125],
|
||||
[0.75, 0],
|
||||
[0.875, 0.125]
|
||||
],
|
||||
[
|
||||
[0.875, 0],
|
||||
[0.875, 0.125],
|
||||
[0.75, 0]
|
||||
],
|
||||
[
|
||||
[0.875, 0.125],
|
||||
[0.875, 0],
|
||||
[1, 0.125]
|
||||
],
|
||||
[
|
||||
[1, 0],
|
||||
[1, 0.125],
|
||||
[0.875, 0]
|
||||
],
|
||||
[
|
||||
[0, 0.25],
|
||||
[0, 0.125],
|
||||
[0.125, 0.25]
|
||||
],
|
||||
[
|
||||
[0.125, 0.125],
|
||||
[0.125, 0.25],
|
||||
[0, 0.125]
|
||||
],
|
||||
[
|
||||
[0.125, 0.25],
|
||||
[0.125, 0.125],
|
||||
[0.25, 0.25]
|
||||
],
|
||||
[
|
||||
[0.25, 0.125],
|
||||
[0.25, 0.25],
|
||||
[0.125, 0.125]
|
||||
],
|
||||
[
|
||||
[0.25, 0.25],
|
||||
[0.25, 0.125],
|
||||
[0.375, 0.25]
|
||||
],
|
||||
[
|
||||
[0.375, 0.125],
|
||||
[0.375, 0.25],
|
||||
[0.25, 0.125]
|
||||
],
|
||||
[
|
||||
[0.375, 0.25],
|
||||
[0.375, 0.125],
|
||||
[0.5, 0.25]
|
||||
],
|
||||
[
|
||||
[0.5, 0.125],
|
||||
[0.5, 0.25],
|
||||
[0.375, 0.125]
|
||||
],
|
||||
[
|
||||
[0.5, 0.25],
|
||||
[0.5, 0.125],
|
||||
[0.625, 0.25]
|
||||
],
|
||||
[
|
||||
[0.625, 0.125],
|
||||
[0.625, 0.25],
|
||||
[0.5, 0.125]
|
||||
],
|
||||
[
|
||||
[0.625, 0.25],
|
||||
[0.625, 0.125],
|
||||
[0.75, 0.25]
|
||||
],
|
||||
[
|
||||
[0.75, 0.125],
|
||||
[0.75, 0.25],
|
||||
[0.625, 0.125]
|
||||
],
|
||||
[
|
||||
[0.75, 0.25],
|
||||
[0.75, 0.125],
|
||||
[0.875, 0.25]
|
||||
],
|
||||
[
|
||||
[0.875, 0.125],
|
||||
[0.875, 0.25],
|
||||
[0.75, 0.125]
|
||||
],
|
||||
[
|
||||
[0.875, 0.25],
|
||||
[0.875, 0.125],
|
||||
[1, 0.25]
|
||||
],
|
||||
[
|
||||
[1, 0.125],
|
||||
[1, 0.25],
|
||||
[0.875, 0.125]
|
||||
],
|
||||
[
|
||||
[0, 0.375],
|
||||
[0, 0.25],
|
||||
[0.125, 0.375]
|
||||
],
|
||||
[
|
||||
[0.125, 0.25],
|
||||
[0.125, 0.375],
|
||||
[0, 0.25]
|
||||
],
|
||||
[
|
||||
[0.125, 0.375],
|
||||
[0.125, 0.25],
|
||||
[0.25, 0.375]
|
||||
],
|
||||
[
|
||||
[0.25, 0.25],
|
||||
[0.25, 0.375],
|
||||
[0.125, 0.25]
|
||||
],
|
||||
[
|
||||
[0.25, 0.375],
|
||||
[0.25, 0.25],
|
||||
[0.375, 0.375]
|
||||
],
|
||||
[
|
||||
[0.375, 0.25],
|
||||
[0.375, 0.375],
|
||||
[0.25, 0.25]
|
||||
],
|
||||
[
|
||||
[0.375, 0.375],
|
||||
[0.375, 0.25],
|
||||
[0.5, 0.375]
|
||||
],
|
||||
[
|
||||
[0.5, 0.25],
|
||||
[0.5, 0.375],
|
||||
[0.375, 0.25]
|
||||
],
|
||||
[
|
||||
[0.5, 0.375],
|
||||
[0.5, 0.25],
|
||||
[0.625, 0.375]
|
||||
],
|
||||
[
|
||||
[0.625, 0.25],
|
||||
[0.625, 0.375],
|
||||
[0.5, 0.25]
|
||||
],
|
||||
[
|
||||
[0.625, 0.375],
|
||||
[0.625, 0.25],
|
||||
[0.75, 0.375]
|
||||
],
|
||||
[
|
||||
[0.75, 0.25],
|
||||
[0.75, 0.375],
|
||||
[0.625, 0.25]
|
||||
],
|
||||
[
|
||||
[0.75, 0.375],
|
||||
[0.75, 0.25],
|
||||
[0.875, 0.375]
|
||||
],
|
||||
[
|
||||
[0.875, 0.25],
|
||||
[0.875, 0.375],
|
||||
[0.75, 0.25]
|
||||
],
|
||||
[
|
||||
[0.875, 0.375],
|
||||
[0.875, 0.25],
|
||||
[1, 0.375]
|
||||
],
|
||||
[
|
||||
[1, 0.25],
|
||||
[1, 0.375],
|
||||
[0.875, 0.25]
|
||||
],
|
||||
[
|
||||
[0, 0.5],
|
||||
[0, 0.375],
|
||||
[0.125, 0.5]
|
||||
],
|
||||
[
|
||||
[0.125, 0.375],
|
||||
[0.125, 0.5],
|
||||
[0, 0.375]
|
||||
],
|
||||
[
|
||||
[0.125, 0.5],
|
||||
[0.125, 0.375],
|
||||
[0.25, 0.5]
|
||||
],
|
||||
[
|
||||
[0.25, 0.375],
|
||||
[0.25, 0.5],
|
||||
[0.125, 0.375]
|
||||
],
|
||||
[
|
||||
[0.25, 0.5],
|
||||
[0.25, 0.375],
|
||||
[0.375, 0.5]
|
||||
],
|
||||
[
|
||||
[0.375, 0.375],
|
||||
[0.375, 0.5],
|
||||
[0.25, 0.375]
|
||||
],
|
||||
[
|
||||
[0.375, 0.5],
|
||||
[0.375, 0.375],
|
||||
[0.5, 0.5]
|
||||
],
|
||||
[
|
||||
[0.5, 0.375],
|
||||
[0.5, 0.5],
|
||||
[0.375, 0.375]
|
||||
],
|
||||
[
|
||||
[0.5, 0.5],
|
||||
[0.5, 0.375],
|
||||
[0.625, 0.5]
|
||||
],
|
||||
[
|
||||
[0.625, 0.375],
|
||||
[0.625, 0.5],
|
||||
[0.5, 0.375]
|
||||
],
|
||||
[
|
||||
[0.625, 0.5],
|
||||
[0.625, 0.375],
|
||||
[0.75, 0.5]
|
||||
],
|
||||
[
|
||||
[0.75, 0.375],
|
||||
[0.75, 0.5],
|
||||
[0.625, 0.375]
|
||||
],
|
||||
[
|
||||
[0.75, 0.5],
|
||||
[0.75, 0.375],
|
||||
[0.875, 0.5]
|
||||
],
|
||||
[
|
||||
[0.875, 0.375],
|
||||
[0.875, 0.5],
|
||||
[0.75, 0.375]
|
||||
],
|
||||
[
|
||||
[0.875, 0.5],
|
||||
[0.875, 0.375],
|
||||
[1, 0.5]
|
||||
],
|
||||
[
|
||||
[1, 0.375],
|
||||
[1, 0.5],
|
||||
[0.875, 0.375]
|
||||
],
|
||||
[
|
||||
[0, 0.625],
|
||||
[0, 0.5],
|
||||
[0.125, 0.625]
|
||||
],
|
||||
[
|
||||
[0.125, 0.5],
|
||||
[0.125, 0.625],
|
||||
[0, 0.5]
|
||||
],
|
||||
[
|
||||
[0.125, 0.625],
|
||||
[0.125, 0.5],
|
||||
[0.25, 0.625]
|
||||
],
|
||||
[
|
||||
[0.25, 0.5],
|
||||
[0.25, 0.625],
|
||||
[0.125, 0.5]
|
||||
],
|
||||
[
|
||||
[0.25, 0.625],
|
||||
[0.25, 0.5],
|
||||
[0.375, 0.625]
|
||||
],
|
||||
[
|
||||
[0.375, 0.5],
|
||||
[0.375, 0.625],
|
||||
[0.25, 0.5]
|
||||
],
|
||||
[
|
||||
[0.375, 0.625],
|
||||
[0.375, 0.5],
|
||||
[0.5, 0.625]
|
||||
],
|
||||
[
|
||||
[0.5, 0.5],
|
||||
[0.5, 0.625],
|
||||
[0.375, 0.5]
|
||||
],
|
||||
[
|
||||
[0.5, 0.625],
|
||||
[0.5, 0.5],
|
||||
[0.625, 0.625]
|
||||
],
|
||||
[
|
||||
[0.625, 0.5],
|
||||
[0.625, 0.625],
|
||||
[0.5, 0.5]
|
||||
],
|
||||
[
|
||||
[0.625, 0.625],
|
||||
[0.625, 0.5],
|
||||
[0.75, 0.625]
|
||||
],
|
||||
[
|
||||
[0.75, 0.5],
|
||||
[0.75, 0.625],
|
||||
[0.625, 0.5]
|
||||
],
|
||||
[
|
||||
[0.75, 0.625],
|
||||
[0.75, 0.5],
|
||||
[0.875, 0.625]
|
||||
],
|
||||
[
|
||||
[0.875, 0.5],
|
||||
[0.875, 0.625],
|
||||
[0.75, 0.5]
|
||||
],
|
||||
[
|
||||
[0.875, 0.625],
|
||||
[0.875, 0.5],
|
||||
[1, 0.625]
|
||||
],
|
||||
[
|
||||
[1, 0.5],
|
||||
[1, 0.625],
|
||||
[0.875, 0.5]
|
||||
],
|
||||
[
|
||||
[0, 0.75],
|
||||
[0, 0.625],
|
||||
[0.125, 0.75]
|
||||
],
|
||||
[
|
||||
[0.125, 0.625],
|
||||
[0.125, 0.75],
|
||||
[0, 0.625]
|
||||
],
|
||||
[
|
||||
[0.125, 0.75],
|
||||
[0.125, 0.625],
|
||||
[0.25, 0.75]
|
||||
],
|
||||
[
|
||||
[0.25, 0.625],
|
||||
[0.25, 0.75],
|
||||
[0.125, 0.625]
|
||||
],
|
||||
[
|
||||
[0.25, 0.75],
|
||||
[0.25, 0.625],
|
||||
[0.375, 0.75]
|
||||
],
|
||||
[
|
||||
[0.375, 0.625],
|
||||
[0.375, 0.75],
|
||||
[0.25, 0.625]
|
||||
],
|
||||
[
|
||||
[0.375, 0.75],
|
||||
[0.375, 0.625],
|
||||
[0.5, 0.75]
|
||||
],
|
||||
[
|
||||
[0.5, 0.625],
|
||||
[0.5, 0.75],
|
||||
[0.375, 0.625]
|
||||
],
|
||||
[
|
||||
[0.5, 0.75],
|
||||
[0.5, 0.625],
|
||||
[0.625, 0.75]
|
||||
],
|
||||
[
|
||||
[0.625, 0.625],
|
||||
[0.625, 0.75],
|
||||
[0.5, 0.625]
|
||||
],
|
||||
[
|
||||
[0.625, 0.75],
|
||||
[0.625, 0.625],
|
||||
[0.75, 0.75]
|
||||
],
|
||||
[
|
||||
[0.75, 0.625],
|
||||
[0.75, 0.75],
|
||||
[0.625, 0.625]
|
||||
],
|
||||
[
|
||||
[0.75, 0.75],
|
||||
[0.75, 0.625],
|
||||
[0.875, 0.75]
|
||||
],
|
||||
[
|
||||
[0.875, 0.625],
|
||||
[0.875, 0.75],
|
||||
[0.75, 0.625]
|
||||
],
|
||||
[
|
||||
[0.875, 0.75],
|
||||
[0.875, 0.625],
|
||||
[1, 0.75]
|
||||
],
|
||||
[
|
||||
[1, 0.625],
|
||||
[1, 0.75],
|
||||
[0.875, 0.625]
|
||||
],
|
||||
[
|
||||
[0, 0.875],
|
||||
[0, 0.75],
|
||||
[0.125, 0.875]
|
||||
],
|
||||
[
|
||||
[0.125, 0.75],
|
||||
[0.125, 0.875],
|
||||
[0, 0.75]
|
||||
],
|
||||
[
|
||||
[0.125, 0.875],
|
||||
[0.125, 0.75],
|
||||
[0.25, 0.875]
|
||||
],
|
||||
[
|
||||
[0.25, 0.75],
|
||||
[0.25, 0.875],
|
||||
[0.125, 0.75]
|
||||
],
|
||||
[
|
||||
[0.25, 0.875],
|
||||
[0.25, 0.75],
|
||||
[0.375, 0.875]
|
||||
],
|
||||
[
|
||||
[0.375, 0.75],
|
||||
[0.375, 0.875],
|
||||
[0.25, 0.75]
|
||||
],
|
||||
[
|
||||
[0.375, 0.875],
|
||||
[0.375, 0.75],
|
||||
[0.5, 0.875]
|
||||
],
|
||||
[
|
||||
[0.5, 0.75],
|
||||
[0.5, 0.875],
|
||||
[0.375, 0.75]
|
||||
],
|
||||
[
|
||||
[0.5, 0.875],
|
||||
[0.5, 0.75],
|
||||
[0.625, 0.875]
|
||||
],
|
||||
[
|
||||
[0.625, 0.75],
|
||||
[0.625, 0.875],
|
||||
[0.5, 0.75]
|
||||
],
|
||||
[
|
||||
[0.625, 0.875],
|
||||
[0.625, 0.75],
|
||||
[0.75, 0.875]
|
||||
],
|
||||
[
|
||||
[0.75, 0.75],
|
||||
[0.75, 0.875],
|
||||
[0.625, 0.75]
|
||||
],
|
||||
[
|
||||
[0.75, 0.875],
|
||||
[0.75, 0.75],
|
||||
[0.875, 0.875]
|
||||
],
|
||||
[
|
||||
[0.875, 0.75],
|
||||
[0.875, 0.875],
|
||||
[0.75, 0.75]
|
||||
],
|
||||
[
|
||||
[0.875, 0.875],
|
||||
[0.875, 0.75],
|
||||
[1, 0.875]
|
||||
],
|
||||
[
|
||||
[1, 0.75],
|
||||
[1, 0.875],
|
||||
[0.875, 0.75]
|
||||
],
|
||||
[
|
||||
[0, 1],
|
||||
[0, 0.875],
|
||||
[0.125, 1]
|
||||
],
|
||||
[
|
||||
[0.125, 0.875],
|
||||
[0.125, 1],
|
||||
[0, 0.875]
|
||||
],
|
||||
[
|
||||
[0.125, 1],
|
||||
[0.125, 0.875],
|
||||
[0.25, 1]
|
||||
],
|
||||
[
|
||||
[0.25, 0.875],
|
||||
[0.25, 1],
|
||||
[0.125, 0.875]
|
||||
],
|
||||
[
|
||||
[0.25, 1],
|
||||
[0.25, 0.875],
|
||||
[0.375, 1]
|
||||
],
|
||||
[
|
||||
[0.375, 0.875],
|
||||
[0.375, 1],
|
||||
[0.25, 0.875]
|
||||
],
|
||||
[
|
||||
[0.375, 1],
|
||||
[0.375, 0.875],
|
||||
[0.5, 1]
|
||||
],
|
||||
[
|
||||
[0.5, 0.875],
|
||||
[0.5, 1],
|
||||
[0.375, 0.875]
|
||||
],
|
||||
[
|
||||
[0.5, 1],
|
||||
[0.5, 0.875],
|
||||
[0.625, 1]
|
||||
],
|
||||
[
|
||||
[0.625, 0.875],
|
||||
[0.625, 1],
|
||||
[0.5, 0.875]
|
||||
],
|
||||
[
|
||||
[0.625, 1],
|
||||
[0.625, 0.875],
|
||||
[0.75, 1]
|
||||
],
|
||||
[
|
||||
[0.75, 0.875],
|
||||
[0.75, 1],
|
||||
[0.625, 0.875]
|
||||
],
|
||||
[
|
||||
[0.75, 1],
|
||||
[0.75, 0.875],
|
||||
[0.875, 1]
|
||||
],
|
||||
[
|
||||
[0.875, 0.875],
|
||||
[0.875, 1],
|
||||
[0.75, 0.875]
|
||||
],
|
||||
[
|
||||
[0.875, 1],
|
||||
[0.875, 0.875],
|
||||
[1, 1]
|
||||
],
|
||||
[
|
||||
[1, 0.875],
|
||||
[1, 1],
|
||||
[0.875, 0.875]
|
||||
]
|
||||
]
|
||||
}],
|
||||
"mat": [{
|
||||
"r": 226,
|
||||
"g": 226,
|
||||
"b": 226
|
||||
},
|
||||
{
|
||||
"r": 132,
|
||||
"g": 74,
|
||||
"b": 74
|
||||
}]
|
||||
}
|
|
@ -1,308 +0,0 @@
|
|||
this.obj = [{
|
||||
"vrt": [
|
||||
[2.7897, 0.1612, -2.7847],
|
||||
[2.7967, 1.7205, -2.7916],
|
||||
[1.4581, 2.8937, -1.4531],
|
||||
[1.9454, 3.4599, -1.5194],
|
||||
[0.8431, 8.8174, -0.8434],
|
||||
[2.0425, 9.5848, -2.0509],
|
||||
[0.8057, 10.654, -0.8005],
|
||||
[2.7897, 0.1612, 2.7897],
|
||||
[2.7966, 1.7205, 2.7967],
|
||||
[1.4581, 2.8937, 1.4581],
|
||||
[1.9454, 3.4599, 1.5253],
|
||||
[0.8431, 8.8174, 0.8493],
|
||||
[2.0425, 9.5848, 2.0568],
|
||||
[0.7974, 10.6608, 0.8046],
|
||||
[-2.7847, 0.1612, 2.7897],
|
||||
[-2.7917, 1.7205, 2.7967],
|
||||
[-1.4531, 2.8937, 1.4581],
|
||||
[-1.9403, 3.4599, 1.5253],
|
||||
[-0.838, 8.8174, 0.8493],
|
||||
[-2.0373, 9.5848, 2.0568],
|
||||
[-0.7907, 10.6595, 0.8092],
|
||||
[-2.7847, 0.1612, -2.7847],
|
||||
[-2.7917, 1.7205, -2.7916],
|
||||
[-1.4531, 2.8937, -1.4531],
|
||||
[-1.9403, 3.4599, -1.5194],
|
||||
[-0.838, 8.8174, -0.8434],
|
||||
[-2.0373, 9.5848, -2.0509],
|
||||
[-0.7873, 10.6608, -0.7993],
|
||||
[-1.4205, 12.2998, 1.3925],
|
||||
[0.0023, 12.2998, 2.0575],
|
||||
[1.4251, 12.2998, 1.3925],
|
||||
[-1.4205, 12.2998, -1.417],
|
||||
[0.0023, 12.2998, -2.0821],
|
||||
[1.4251, 12.2998, -1.417],
|
||||
[2.1005, 12.2998, -0.0123],
|
||||
[-2.0959, 12.2998, -0.0123],
|
||||
[2.8745, 14.7876, -0.0007],
|
||||
[2.0327, 14.7876, 2.0455],
|
||||
[0.0003, 14.7876, 2.8931],
|
||||
[-2.032, 14.7876, 2.0455],
|
||||
[-2.8738, 14.7876, -0.0007],
|
||||
[-2.032, 14.7876, -2.0469],
|
||||
[0.0003, 14.7876, -2.8945],
|
||||
[2.0327, 14.7876, -2.0469],
|
||||
[-0.0003, 15.6364, 0.0008],
|
||||
[-0.2099, 16.942, -0.2376],
|
||||
[-0.0003, 15.6199, -0.0134],
|
||||
[0.215, 16.942, -0.2376],
|
||||
[-0.6387, 16.8372, -0.0134],
|
||||
[0.6382, 16.8372, -0.0134],
|
||||
[-0.6387, 17.4438, -0.0134],
|
||||
[-0.2099, 17.3345, -0.2376],
|
||||
[0.2097, 17.3345, -0.2376],
|
||||
[0.6382, 17.4438, -0.0134],
|
||||
[-0.2619, 17.8473, -0.0134],
|
||||
[0.2614, 17.8473, -0.0134],
|
||||
[-0.2099, 16.942, 0.2109],
|
||||
[0.215, 16.942, 0.2109],
|
||||
[-0.2099, 17.3345, 0.2109],
|
||||
[0.2097, 17.3345, 0.2109]
|
||||
],
|
||||
"fac": [
|
||||
[0, 8, 1, 0],
|
||||
[0, 7, 8, 0],
|
||||
[1, 9, 2, 0],
|
||||
[1, 8, 9, 0],
|
||||
[2, 10, 3, 0],
|
||||
[2, 9, 10, 0],
|
||||
[3, 11, 4, 0],
|
||||
[3, 10, 11, 0],
|
||||
[4, 12, 5, 0],
|
||||
[4, 11, 12, 0],
|
||||
[5, 13, 6, 0],
|
||||
[5, 12, 13, 0],
|
||||
[7, 15, 8, 0],
|
||||
[7, 14, 15, 0],
|
||||
[8, 16, 9, 0],
|
||||
[8, 15, 16, 0],
|
||||
[9, 17, 10, 0],
|
||||
[9, 16, 17, 0],
|
||||
[10, 18, 11, 0],
|
||||
[10, 17, 18, 0],
|
||||
[11, 19, 12, 0],
|
||||
[11, 18, 19, 0],
|
||||
[12, 20, 13, 0],
|
||||
[12, 19, 20, 0],
|
||||
[7, 21, 14, 0],
|
||||
[14, 22, 15, 0],
|
||||
[14, 21, 22, 0],
|
||||
[15, 23, 16, 0],
|
||||
[15, 22, 23, 0],
|
||||
[16, 24, 17, 0],
|
||||
[16, 23, 24, 0],
|
||||
[17, 25, 18, 0],
|
||||
[17, 24, 25, 0],
|
||||
[18, 26, 19, 0],
|
||||
[18, 25, 26, 0],
|
||||
[19, 27, 20, 0],
|
||||
[19, 26, 27, 0],
|
||||
[7, 0, 21, 0],
|
||||
[21, 1, 22, 0],
|
||||
[21, 0, 1, 0],
|
||||
[22, 2, 23, 0],
|
||||
[22, 1, 2, 0],
|
||||
[23, 3, 24, 0],
|
||||
[23, 2, 3, 0],
|
||||
[24, 4, 25, 0],
|
||||
[24, 3, 4, 0],
|
||||
[25, 5, 26, 0],
|
||||
[25, 4, 5, 0],
|
||||
[26, 6, 27, 0],
|
||||
[26, 5, 6, 0],
|
||||
[20, 28, 29, 0],
|
||||
[32, 31, 27, 0],
|
||||
[27, 6, 32, 0],
|
||||
[33, 32, 6, 0],
|
||||
[13, 30, 34, 0],
|
||||
[27, 31, 35, 0],
|
||||
[34, 37, 36, 0],
|
||||
[34, 30, 37, 0],
|
||||
[30, 38, 37, 0],
|
||||
[30, 29, 38, 0],
|
||||
[29, 39, 38, 0],
|
||||
[29, 28, 39, 0],
|
||||
[28, 40, 39, 0],
|
||||
[28, 35, 40, 0],
|
||||
[35, 41, 40, 0],
|
||||
[35, 31, 41, 0],
|
||||
[31, 42, 41, 0],
|
||||
[31, 32, 42, 0],
|
||||
[32, 43, 42, 0],
|
||||
[32, 33, 43, 0],
|
||||
[33, 36, 43, 0],
|
||||
[33, 34, 36, 0],
|
||||
[36, 37, 44, 0],
|
||||
[37, 38, 44, 0],
|
||||
[38, 39, 44, 0],
|
||||
[39, 40, 44, 0],
|
||||
[40, 41, 44, 0],
|
||||
[41, 42, 44, 0],
|
||||
[42, 43, 44, 0],
|
||||
[43, 36, 44, 0],
|
||||
[45, 46, 47, 0],
|
||||
[50, 48, 51, 0],
|
||||
[45, 51, 48, 0],
|
||||
[51, 45, 52, 0],
|
||||
[47, 52, 45, 0],
|
||||
[52, 47, 53, 0],
|
||||
[49, 53, 47, 0],
|
||||
[54, 51, 55, 0],
|
||||
[52, 55, 51, 0],
|
||||
[56, 57, 46, 0],
|
||||
[56, 48, 58, 0],
|
||||
[50, 58, 48, 0],
|
||||
[57, 56, 59, 0],
|
||||
[58, 59, 56, 0],
|
||||
[49, 57, 53, 0],
|
||||
[59, 53, 57, 0],
|
||||
[59, 58, 55, 0],
|
||||
[54, 55, 58, 0],
|
||||
[56, 46, 45, 0],
|
||||
[47, 46, 57, 0],
|
||||
[57, 49, 47, 0],
|
||||
[52, 53, 59, 0],
|
||||
[59, 55, 52, 0],
|
||||
[51, 54, 58, 0],
|
||||
[58, 50, 51, 0],
|
||||
[45, 48, 56, 0],
|
||||
[13, 34, 6, 0],
|
||||
[6, 34, 33, 0],
|
||||
[20, 29, 13, 0],
|
||||
[13, 29, 30, 0],
|
||||
[27, 35, 20, 0],
|
||||
[35, 28, 20, 0]
|
||||
],
|
||||
"nrm": [
|
||||
[0.7071, -0.7071, -0.0045],
|
||||
[0.7071, -0.7071, -0.0045],
|
||||
[0.4661, -0.4661, 0.752],
|
||||
[0.4661, -0.4661, 0.752],
|
||||
[0.5359, -0.5359, -0.6524],
|
||||
[0.5359, -0.5359, -0.6524],
|
||||
[0.6926, -0.6926, 0.2015],
|
||||
[0.6926, -0.6926, 0.2015],
|
||||
[0.3811, -0.3811, -0.8423],
|
||||
[0.3811, -0.3811, -0.8423],
|
||||
[0.4624, -0.4626, 0.7565],
|
||||
[0.4624, -0.4624, 0.7566],
|
||||
[-0.7071, -0.7071, -0.0045],
|
||||
[-0.7071, -0.7071, -0.0045],
|
||||
[-0.4661, -0.4661, 0.752],
|
||||
[-0.4661, -0.4661, 0.752],
|
||||
[-0.7022, -0.7022, -0.1177],
|
||||
[-0.7022, -0.7022, -0.1177],
|
||||
[-0.7015, -0.7015, 0.1252],
|
||||
[-0.7015, -0.7015, 0.1252],
|
||||
[-0.3793, -0.3793, -0.844],
|
||||
[-0.3793, -0.3793, -0.844],
|
||||
[-0.4595, -0.4612, 0.759],
|
||||
[-0.4615, -0.4615, 0.7577],
|
||||
[-0, 0, -1],
|
||||
[-0.7071, 0.7071, -0.0045],
|
||||
[-0.7071, 0.7071, -0.0045],
|
||||
[-0.4661, 0.4661, 0.752],
|
||||
[-0.4661, 0.4661, 0.752],
|
||||
[-0.536, 0.536, -0.6523],
|
||||
[-0.536, 0.536, -0.6523],
|
||||
[-0.6926, 0.6926, 0.2015],
|
||||
[-0.6926, 0.6926, 0.2015],
|
||||
[-0.3811, 0.3811, -0.8423],
|
||||
[-0.3811, 0.3811, -0.8423],
|
||||
[-0.4615, 0.4625, 0.757],
|
||||
[-0.4613, 0.4613, 0.7579],
|
||||
[0, 0, -1],
|
||||
[0.7071, 0.7071, -0.0045],
|
||||
[0.7071, 0.7071, -0.0045],
|
||||
[0.4661, 0.4661, 0.752],
|
||||
[0.4661, 0.4661, 0.752],
|
||||
[0.7023, 0.7023, -0.1163],
|
||||
[0.7023, 0.7023, -0.1163],
|
||||
[0.7015, 0.7015, 0.1252],
|
||||
[0.7015, 0.7015, 0.1252],
|
||||
[0.3793, 0.3793, -0.844],
|
||||
[0.3793, 0.3793, -0.844],
|
||||
[0.4641, 0.4601, 0.7569],
|
||||
[0.4595, 0.4595, 0.76],
|
||||
[-0.8459, -0.307, -0.4361],
|
||||
[0.3045, 0.8391, -0.4508],
|
||||
[0.5551, 0.5597, -0.6154],
|
||||
[0.8412, 0.3053, -0.4463],
|
||||
[0.2959, -0.8438, -0.4476],
|
||||
[-0.2946, 0.8401, -0.4554],
|
||||
[0.3697, -0.8866, -0.2781],
|
||||
[0.3139, -0.8951, -0.3167],
|
||||
[-0.3606, -0.8766, -0.3187],
|
||||
[-0.3264, -0.8994, -0.2908],
|
||||
[-0.8833, -0.3634, -0.2963],
|
||||
[-0.8895, -0.3228, -0.3235],
|
||||
[-0.8772, 0.3658, -0.311],
|
||||
[-0.9078, 0.3183, -0.2731],
|
||||
[-0.3699, 0.887, -0.2762],
|
||||
[-0.3141, 0.8958, -0.3144],
|
||||
[0.3615, 0.8787, -0.3119],
|
||||
[0.3271, 0.9013, -0.284],
|
||||
[0.8855, 0.3643, -0.2883],
|
||||
[0.8919, 0.3237, -0.3158],
|
||||
[0.8785, -0.3664, -0.3067],
|
||||
[0.9091, -0.3188, -0.2682],
|
||||
[0.1171, -0.2808, 0.9526],
|
||||
[-0.1153, -0.2802, 0.953],
|
||||
[-0.2803, -0.1153, 0.953],
|
||||
[-0.2809, 0.1171, 0.9526],
|
||||
[-0.1171, 0.2808, 0.9526],
|
||||
[0.1152, 0.28, 0.9531],
|
||||
[0.2799, 0.1152, 0.9531],
|
||||
[0.2807, -0.117, 0.9526],
|
||||
[0.6972, 0.6972, -0.1672],
|
||||
[0.2989, 0.9543, -0],
|
||||
[0.2989, 0.9543, 0],
|
||||
[0.7071, 0.7071, -0],
|
||||
[0.7071, 0.7071, -0],
|
||||
[0.9539, 0.3, 0.0062],
|
||||
[0.9559, 0.2938, 0],
|
||||
[0.6479, 0.6479, 0.4007],
|
||||
[0.6479, 0.6479, 0.4007],
|
||||
[-0.6972, -0.6972, -0.1672],
|
||||
[-0.9543, -0.2989, 0],
|
||||
[-0.9543, -0.2989, -0],
|
||||
[-0.7071, -0.7071, -0],
|
||||
[-0.7071, -0.7071, 0],
|
||||
[-0.2938, -0.9559, -0],
|
||||
[-0.3, -0.9539, 0.0062],
|
||||
[-0.6479, -0.6479, 0.4007],
|
||||
[-0.6479, -0.6479, 0.4007],
|
||||
[-0.6984, 0.6984, -0.1566],
|
||||
[0.6979, -0.6979, -0.1607],
|
||||
[-0.1699, 0.1699, -0.9707],
|
||||
[-0.1747, 0.1747, 0.969],
|
||||
[0.7035, -0.7035, -0.1003],
|
||||
[-0.7035, 0.7035, -0.1009],
|
||||
[0.1746, -0.1746, 0.969],
|
||||
[0.1679, -0.1679, -0.9714],
|
||||
[0.5499, -0.5594, -0.6203],
|
||||
[0.8435, -0.2958, -0.4483],
|
||||
[-0.5602, -0.5642, -0.6065],
|
||||
[-0.3067, -0.8451, -0.4379],
|
||||
[-0.5514, 0.5545, -0.6233],
|
||||
[-0.844, 0.296, -0.4472]
|
||||
],
|
||||
"tex": []
|
||||
}];
|
||||
this.mat = [{
|
||||
"r": 150,
|
||||
"g": 150,
|
||||
"b": 150
|
||||
},
|
||||
{
|
||||
"r": 150,
|
||||
"g": 150,
|
||||
"b": 150
|
||||
},
|
||||
{
|
||||
"r": 150,
|
||||
"g": 150,
|
||||
"b": 150
|
||||
}];
|
|
@ -1,803 +0,0 @@
|
|||
this.obj = [{
|
||||
"vrt": [
|
||||
[2.3018, 0.1682, -2.3073],
|
||||
[2.308, 1.544, -2.3135],
|
||||
[1.1022, 2.5891, -1.127],
|
||||
[2.3018, 0.1682, 2.6109],
|
||||
[2.308, 1.544, 2.6171],
|
||||
[1.1022, 2.5891, 1.4138],
|
||||
[-2.6164, 0.1682, 2.6109],
|
||||
[-2.6226, 1.544, 2.6171],
|
||||
[-1.4316, 2.5891, 1.4138],
|
||||
[-2.6164, 0.1682, -2.3073],
|
||||
[-2.6226, 1.544, -2.3135],
|
||||
[-1.4316, 2.5891, -1.127],
|
||||
[2.8253, 2.659, 0.135],
|
||||
[-2.5136, 4.2087, -1.0635],
|
||||
[0.7837, 4.296, -0.6588],
|
||||
[1.1833, 4.3186, 0.135],
|
||||
[-2.5331, 6.0538, -1.0635],
|
||||
[0.7896, 6.1572, -0.6588],
|
||||
[1.2145, 6.123, 0.135],
|
||||
[2.1204, 6.038, 0.135],
|
||||
[-0.3684, 9.6308, -0.8447],
|
||||
[0.5998, 8.5154, -0.8447],
|
||||
[1.6342, 8.1577, 0.135],
|
||||
[2.8912, 7.7575, 0.135],
|
||||
[-3.2541, 9.4769, 0.135],
|
||||
[1.6342, 9.4769, 0.135],
|
||||
[3.531, 10.3924, 0.135],
|
||||
[-3.0046, 9.9761, -0.5044],
|
||||
[0.0672, 10.8094, -0.8447],
|
||||
[1.6342, 11.1963, 0.135],
|
||||
[2.9312, 12.627, 0.135],
|
||||
[-1.5947, 10.9615, 0.1342],
|
||||
[-0.1483, 11.8729, 0.1314],
|
||||
[0.6966, 12.009, -0.1456],
|
||||
[1.2014, 13.4221, -0.3015],
|
||||
[-2.5136, 4.2087, 1.3336],
|
||||
[0.7837, 4.296, 0.9288],
|
||||
[-2.5331, 6.0538, 1.3336],
|
||||
[0.7896, 6.1572, 0.9288],
|
||||
[-0.3684, 9.6308, 1.1147],
|
||||
[0.5998, 8.5154, 1.1147],
|
||||
[-3.0046, 9.9761, 0.8389],
|
||||
[0.0672, 10.8094, 1.1147],
|
||||
[0.6966, 12.009, 0.4148],
|
||||
[1.2014, 13.4221, 0.567],
|
||||
[-2.2913, 2.5992, 0.135],
|
||||
[-3.7136, 10.1352, 0.135],
|
||||
[-1.0793, 8.9545, 0.135],
|
||||
[-3.4963, 6.038, 0.135],
|
||||
[-3.4963, 4.3186, 0.135]
|
||||
],
|
||||
"fac": [
|
||||
[0, 4, 1, 0],
|
||||
[0, 3, 4, 0],
|
||||
[1, 5, 2, 0],
|
||||
[1, 4, 5, 0],
|
||||
[3, 7, 4, 0],
|
||||
[3, 6, 7, 0],
|
||||
[4, 8, 5, 0],
|
||||
[4, 7, 8, 0],
|
||||
[3, 9, 6, 0],
|
||||
[6, 10, 7, 0],
|
||||
[6, 9, 10, 0],
|
||||
[7, 11, 8, 0],
|
||||
[7, 10, 11, 0],
|
||||
[3, 0, 9, 0],
|
||||
[9, 1, 10, 0],
|
||||
[9, 0, 1, 0],
|
||||
[10, 2, 11, 0],
|
||||
[10, 1, 2, 0],
|
||||
[13, 11, 14, 1],
|
||||
[2, 14, 11, 1],
|
||||
[14, 2, 15, 1],
|
||||
[15, 2, 12, 1],
|
||||
[16, 13, 17, 1],
|
||||
[14, 17, 13, 1],
|
||||
[17, 14, 18, 1],
|
||||
[15, 18, 14, 1],
|
||||
[18, 15, 19, 1],
|
||||
[12, 19, 15, 1],
|
||||
[20, 16, 21, 1],
|
||||
[17, 21, 16, 1],
|
||||
[21, 17, 22, 1],
|
||||
[18, 22, 17, 1],
|
||||
[22, 18, 23, 1],
|
||||
[19, 23, 18, 1],
|
||||
[20, 21, 25, 1],
|
||||
[22, 25, 21, 1],
|
||||
[25, 22, 26, 1],
|
||||
[23, 26, 22, 1],
|
||||
[27, 24, 28, 1],
|
||||
[20, 28, 24, 1],
|
||||
[28, 20, 29, 1],
|
||||
[25, 29, 20, 1],
|
||||
[29, 25, 30, 1],
|
||||
[26, 30, 25, 1],
|
||||
[28, 31, 27, 1],
|
||||
[31, 28, 32, 1],
|
||||
[32, 28, 33, 1],
|
||||
[29, 33, 28, 1],
|
||||
[33, 29, 34, 1],
|
||||
[30, 34, 29, 1],
|
||||
[5, 8, 36, 1],
|
||||
[35, 36, 8, 1],
|
||||
[36, 15, 5, 1],
|
||||
[15, 12, 5, 1],
|
||||
[36, 35, 38, 1],
|
||||
[37, 38, 35, 1],
|
||||
[15, 36, 18, 1],
|
||||
[38, 18, 36, 1],
|
||||
[12, 15, 19, 1],
|
||||
[18, 19, 15, 1],
|
||||
[38, 37, 40, 1],
|
||||
[39, 40, 37, 1],
|
||||
[18, 38, 22, 1],
|
||||
[40, 22, 38, 1],
|
||||
[19, 18, 23, 1],
|
||||
[22, 23, 18, 1],
|
||||
[22, 40, 25, 1],
|
||||
[39, 25, 40, 1],
|
||||
[23, 22, 26, 1],
|
||||
[25, 26, 22, 1],
|
||||
[39, 24, 42, 1],
|
||||
[41, 42, 24, 1],
|
||||
[25, 39, 29, 1],
|
||||
[42, 29, 39, 1],
|
||||
[26, 25, 30, 1],
|
||||
[29, 30, 25, 1],
|
||||
[42, 41, 31, 1],
|
||||
[31, 32, 42, 1],
|
||||
[29, 42, 43, 1],
|
||||
[32, 43, 42, 1],
|
||||
[30, 29, 44, 1],
|
||||
[43, 44, 29, 1],
|
||||
[34, 30, 44, 1],
|
||||
[33, 34, 43, 1],
|
||||
[44, 43, 34, 1],
|
||||
[43, 32, 33, 1],
|
||||
[27, 31, 46, 1],
|
||||
[46, 24, 27, 1],
|
||||
[20, 24, 47, 1],
|
||||
[16, 20, 48, 1],
|
||||
[47, 48, 20, 1],
|
||||
[13, 16, 49, 1],
|
||||
[48, 49, 16, 1],
|
||||
[11, 13, 45, 1],
|
||||
[49, 45, 13, 1],
|
||||
[46, 31, 41, 1],
|
||||
[41, 24, 46, 1],
|
||||
[47, 24, 39, 1],
|
||||
[48, 47, 37, 1],
|
||||
[39, 37, 47, 1],
|
||||
[49, 48, 35, 1],
|
||||
[37, 35, 48, 1],
|
||||
[45, 49, 8, 1],
|
||||
[35, 8, 49, 1]
|
||||
],
|
||||
"nrm": [
|
||||
[0.7071, -0.7071, -0.0045],
|
||||
[0.7071, -0.7071, -0.0045],
|
||||
[0.4631, -0.4631, 0.7556],
|
||||
[0.4631, -0.4631, 0.7556],
|
||||
[-0.7071, -0.7071, -0.0045],
|
||||
[-0.7071, -0.7071, -0.0045],
|
||||
[-0.4637, -0.4637, 0.7549],
|
||||
[-0.4637, -0.4637, 0.755],
|
||||
[0, 0, -1],
|
||||
[-0.7071, 0.7071, -0.0045],
|
||||
[-0.7071, 0.7071, -0.0045],
|
||||
[-0.4664, 0.4664, 0.7516],
|
||||
[-0.4664, 0.4664, 0.7516],
|
||||
[0, 0, -1],
|
||||
[0.7071, 0.7071, -0.0045],
|
||||
[0.7071, 0.7071, -0.0045],
|
||||
[0.4674, 0.4674, 0.7504],
|
||||
[0.4674, 0.4674, 0.7504],
|
||||
[0.7806, 0.6139, 0.1174],
|
||||
[0.6819, 0.6819, 0.2646],
|
||||
[0.9139, -0.2944, 0.2796],
|
||||
[0.8561, 0.1486, 0.495],
|
||||
[0.7874, 0.6164, 0.0013],
|
||||
[0.788, 0.6157, -0.0004],
|
||||
[0.9571, -0.2896, -0.0028],
|
||||
[0.9493, -0.314, -0.0155],
|
||||
[0.7071, 0.7071, 0],
|
||||
[0.7071, 0.7071, -0],
|
||||
[0.7354, 0.6767, 0.036],
|
||||
[0.7869, 0.6133, -0.0682],
|
||||
[0.9996, 0.0277, -0.0019],
|
||||
[0.9437, -0.2786, -0.1783],
|
||||
[0.7071, 0.7071, -0],
|
||||
[0.7071, 0.7071, 0],
|
||||
[0.8854, 0.2764, 0.3738],
|
||||
[0.9996, 0.0272, -0],
|
||||
[0.7071, 0.7071, -0],
|
||||
[0.7071, 0.7071, -0],
|
||||
[0.5128, 0.2923, -0.8072],
|
||||
[0.4336, 0.8931, 0.1201],
|
||||
[0.9625, 0.178, -0.205],
|
||||
[0.9459, 0.3245, -0],
|
||||
[0.7071, 0.7071, 0],
|
||||
[0.7071, 0.7071, -0],
|
||||
[0.2186, 0.6038, 0.7666],
|
||||
[0.2473, 0.7716, 0.5861],
|
||||
[0.2773, 0.7509, 0.5994],
|
||||
[0.9309, 0.268, 0.2481],
|
||||
[0.7967, 0.5823, -0.1618],
|
||||
[0.81, 0.565, -0.157],
|
||||
[-0.6802, -0.6802, 0.2733],
|
||||
[-0.6133, -0.7795, 0.1273],
|
||||
[0.2939, -0.9128, 0.2836],
|
||||
[-0.1429, -0.8552, 0.4982],
|
||||
[-0.6157, -0.788, -0.0004],
|
||||
[-0.6164, -0.7874, 0.0013],
|
||||
[0.314, -0.9493, -0.0155],
|
||||
[0.2896, -0.9571, -0.0028],
|
||||
[-0.7071, -0.7071, 0],
|
||||
[-0.7071, -0.7071, -0],
|
||||
[-0.6133, -0.7869, -0.0682],
|
||||
[-0.6767, -0.7354, 0.036],
|
||||
[0.2786, -0.9437, -0.1783],
|
||||
[-0.0277, -0.9996, -0.0019],
|
||||
[-0.7071, -0.7071, -0],
|
||||
[-0.7071, -0.7071, 0],
|
||||
[-0.0272, -0.9996, 0],
|
||||
[-0.2764, -0.8854, 0.3738],
|
||||
[-0.7071, -0.7071, 0],
|
||||
[-0.7071, -0.7071, 0],
|
||||
[-0.8931, -0.4336, 0.1201],
|
||||
[-0.2462, -0.4983, -0.8313],
|
||||
[-0.3245, -0.9459, -0],
|
||||
[-0.178, -0.9625, -0.205],
|
||||
[-0.7071, -0.7071, 0],
|
||||
[-0.7071, -0.7071, -0],
|
||||
[-0.5864, -0.2148, 0.7811],
|
||||
[-0.7695, -0.2464, 0.5892],
|
||||
[-0.2681, -0.9307, 0.2487],
|
||||
[-0.752, -0.2717, 0.6005],
|
||||
[-0.5667, -0.8092, -0.1554],
|
||||
[-0.5816, -0.7976, -0.1596],
|
||||
[0.2953, -0.2953, 0.9086],
|
||||
[-0.6659, 0.6659, 0.3364],
|
||||
[-0.6659, 0.6659, 0.3364],
|
||||
[-0.1125, 0.1125, 0.9873],
|
||||
[0.162, 0.596, 0.7864],
|
||||
[-0.0299, 0.8904, -0.4542],
|
||||
[0.3286, 0.5815, -0.7443],
|
||||
[-0.101, 0.8844, 0.4556],
|
||||
[-0.4577, 0.6237, 0.6337],
|
||||
[-0.0991, 0.995, -0.0082],
|
||||
[-0.1083, 0.9941, 0],
|
||||
[-0.1675, 0.867, -0.4694],
|
||||
[-0.1204, 0.8645, -0.488],
|
||||
[-0.5756, -0.1307, 0.8072],
|
||||
[-0.88, 0.0716, -0.4696],
|
||||
[-0.5815, -0.3286, -0.7442],
|
||||
[-0.8331, 0.0964, 0.5447],
|
||||
[-0.754, 0.4101, 0.5131],
|
||||
[-0.9951, 0.0985, 0],
|
||||
[-0.9941, 0.1082, -0.0082],
|
||||
[-0.8471, 0.1694, -0.5037],
|
||||
[-0.8859, 0.1196, -0.4482]
|
||||
],
|
||||
"tex": [
|
||||
[
|
||||
[7.2839, -24.849],
|
||||
[-12.017, -17.2137],
|
||||
[7.3321, -17.2137]
|
||||
],
|
||||
[
|
||||
[7.2839, -24.849],
|
||||
[-12.017, -24.849],
|
||||
[-12.017, -17.2137]
|
||||
],
|
||||
[
|
||||
[7.3321, -17.2137],
|
||||
[-12.017, -11.4689],
|
||||
[-1.9372, -11.4688]
|
||||
],
|
||||
[
|
||||
[7.3321, -17.2137],
|
||||
[-12.017, -17.2137],
|
||||
[-12.017, -11.4689]
|
||||
],
|
||||
[
|
||||
[-12.017, -24.849],
|
||||
[-31.3662, -17.2137],
|
||||
[-12.017, -17.2137]
|
||||
],
|
||||
[
|
||||
[-12.017, -24.849],
|
||||
[-31.318, -24.849],
|
||||
[-31.3662, -17.2137]
|
||||
],
|
||||
[
|
||||
[-12.017, -17.2137],
|
||||
[-22.0969, -11.4688],
|
||||
[-12.017, -11.4689]
|
||||
],
|
||||
[
|
||||
[-12.017, -17.2137],
|
||||
[-31.3662, -17.2137],
|
||||
[-22.0969, -11.4688]
|
||||
],
|
||||
[
|
||||
[-12.017, -24.849],
|
||||
[-12.017, -24.849],
|
||||
[-31.318, -24.849]
|
||||
],
|
||||
[
|
||||
[-31.318, -24.849],
|
||||
[-12.017, -17.2137],
|
||||
[-31.3662, -17.2137]
|
||||
],
|
||||
[
|
||||
[-31.318, -24.849],
|
||||
[-12.017, -24.849],
|
||||
[-12.017, -17.2137]
|
||||
],
|
||||
[
|
||||
[-31.3662, -17.2137],
|
||||
[-12.017, -11.4688],
|
||||
[-22.0969, -11.4688]
|
||||
],
|
||||
[
|
||||
[-31.3662, -17.2137],
|
||||
[-12.017, -17.2137],
|
||||
[-12.017, -11.4688]
|
||||
],
|
||||
[
|
||||
[-12.017, -24.849],
|
||||
[7.2839, -24.849],
|
||||
[-12.017, -24.849]
|
||||
],
|
||||
[
|
||||
[-12.017, -24.849],
|
||||
[7.3321, -17.2137],
|
||||
[-12.017, -17.2137]
|
||||
],
|
||||
[
|
||||
[-12.017, -24.849],
|
||||
[7.2839, -24.849],
|
||||
[7.3321, -17.2137]
|
||||
],
|
||||
[
|
||||
[-12.017, -17.2137],
|
||||
[-1.9372, -11.4688],
|
||||
[-12.017, -11.4688]
|
||||
],
|
||||
[
|
||||
[-12.017, -17.2137],
|
||||
[7.3321, -17.2137],
|
||||
[-1.9372, -11.4688]
|
||||
],
|
||||
[
|
||||
[0.25, 0.1667],
|
||||
[0.25, 0],
|
||||
[0.5, 0.1667]
|
||||
],
|
||||
[
|
||||
[0.5, 0],
|
||||
[0.5, 0.1667],
|
||||
[0.25, 0]
|
||||
],
|
||||
[
|
||||
[0.5, 0.1667],
|
||||
[0.5, 0],
|
||||
[0.75, 0.1667]
|
||||
],
|
||||
[
|
||||
[0.75, 0.1667],
|
||||
[0.75, 0],
|
||||
[1, 0.1667]
|
||||
],
|
||||
[
|
||||
[0.25, 0.3333],
|
||||
[0.25, 0.1667],
|
||||
[0.5, 0.3333]
|
||||
],
|
||||
[
|
||||
[0.5, 0.1667],
|
||||
[0.5, 0.3333],
|
||||
[0.25, 0.1667]
|
||||
],
|
||||
[
|
||||
[0.5, 0.3333],
|
||||
[0.5, 0.1667],
|
||||
[0.75, 0.3333]
|
||||
],
|
||||
[
|
||||
[0.75, 0.1667],
|
||||
[0.75, 0.3333],
|
||||
[0.5, 0.1667]
|
||||
],
|
||||
[
|
||||
[0.75, 0.3333],
|
||||
[0.75, 0.1667],
|
||||
[1, 0.3333]
|
||||
],
|
||||
[
|
||||
[1, 0.1667],
|
||||
[1, 0.3333],
|
||||
[0.75, 0.1667]
|
||||
],
|
||||
[
|
||||
[0.25, 0.5],
|
||||
[0.25, 0.3333],
|
||||
[0.5, 0.5]
|
||||
],
|
||||
[
|
||||
[0.5, 0.3333],
|
||||
[0.5, 0.5],
|
||||
[0.25, 0.3333]
|
||||
],
|
||||
[
|
||||
[0.5, 0.5],
|
||||
[0.5, 0.3333],
|
||||
[0.75, 0.5]
|
||||
],
|
||||
[
|
||||
[0.75, 0.3333],
|
||||
[0.75, 0.5],
|
||||
[0.5, 0.3333]
|
||||
],
|
||||
[
|
||||
[0.75, 0.5],
|
||||
[0.75, 0.3333],
|
||||
[1, 0.5]
|
||||
],
|
||||
[
|
||||
[1, 0.3333],
|
||||
[1, 0.5],
|
||||
[0.75, 0.3333]
|
||||
],
|
||||
[
|
||||
[0.5, 0.6667],
|
||||
[0.5, 0.5],
|
||||
[0.75, 0.6667]
|
||||
],
|
||||
[
|
||||
[0.75, 0.5],
|
||||
[0.75, 0.6667],
|
||||
[0.5, 0.5]
|
||||
],
|
||||
[
|
||||
[0.75, 0.6667],
|
||||
[0.75, 0.5],
|
||||
[1, 0.6667]
|
||||
],
|
||||
[
|
||||
[1, 0.5],
|
||||
[1, 0.6667],
|
||||
[0.75, 0.5]
|
||||
],
|
||||
[
|
||||
[0, 0.8333],
|
||||
[0, 0.6667],
|
||||
[0.25, 0.8333]
|
||||
],
|
||||
[
|
||||
[0.25, 0.6667],
|
||||
[0.25, 0.8333],
|
||||
[0, 0.6667]
|
||||
],
|
||||
[
|
||||
[0.5, 0.8333],
|
||||
[0.5, 0.6667],
|
||||
[0.75, 0.8333]
|
||||
],
|
||||
[
|
||||
[0.75, 0.6667],
|
||||
[0.75, 0.8333],
|
||||
[0.5, 0.6667]
|
||||
],
|
||||
[
|
||||
[0.75, 0.8333],
|
||||
[0.75, 0.6667],
|
||||
[1, 0.8333]
|
||||
],
|
||||
[
|
||||
[1, 0.6667],
|
||||
[1, 0.8333],
|
||||
[0.75, 0.6667]
|
||||
],
|
||||
[
|
||||
[0.25, 0.8333],
|
||||
[0.25, 1],
|
||||
[0, 0.8333]
|
||||
],
|
||||
[
|
||||
[0.25, 1],
|
||||
[0.25, 0.8333],
|
||||
[0.5, 1]
|
||||
],
|
||||
[
|
||||
[0.5, 1],
|
||||
[0.5, 0.8333],
|
||||
[0.75, 1]
|
||||
],
|
||||
[
|
||||
[0.75, 0.8333],
|
||||
[0.75, 1],
|
||||
[0.5, 0.8333]
|
||||
],
|
||||
[
|
||||
[0.75, 1],
|
||||
[0.75, 0.8333],
|
||||
[1, 1]
|
||||
],
|
||||
[
|
||||
[1, 0.8333],
|
||||
[1, 1],
|
||||
[0.75, 0.8333]
|
||||
],
|
||||
[
|
||||
[0.5, 0],
|
||||
[0.75, 0],
|
||||
[0.5, 0.1667]
|
||||
],
|
||||
[
|
||||
[0.75, 0.1667],
|
||||
[0.5, 0.1667],
|
||||
[0.75, 0]
|
||||
],
|
||||
[
|
||||
[0.5, 0.1667],
|
||||
[0.25, 0.1667],
|
||||
[0.5, 0]
|
||||
],
|
||||
[
|
||||
[0.25, 0.1667],
|
||||
[0, 0.1667],
|
||||
[0.25, 0]
|
||||
],
|
||||
[
|
||||
[0.5, 0.1667],
|
||||
[0.75, 0.1667],
|
||||
[0.5, 0.3333]
|
||||
],
|
||||
[
|
||||
[0.75, 0.3333],
|
||||
[0.5, 0.3333],
|
||||
[0.75, 0.1667]
|
||||
],
|
||||
[
|
||||
[0.25, 0.1667],
|
||||
[0.5, 0.1667],
|
||||
[0.25, 0.3333]
|
||||
],
|
||||
[
|
||||
[0.5, 0.3333],
|
||||
[0.25, 0.3333],
|
||||
[0.5, 0.1667]
|
||||
],
|
||||
[
|
||||
[0, 0.1667],
|
||||
[0.25, 0.1667],
|
||||
[0, 0.3333]
|
||||
],
|
||||
[
|
||||
[0.25, 0.3333],
|
||||
[0, 0.3333],
|
||||
[0.25, 0.1667]
|
||||
],
|
||||
[
|
||||
[0.5, 0.3333],
|
||||
[0.75, 0.3333],
|
||||
[0.5, 0.5]
|
||||
],
|
||||
[
|
||||
[0.75, 0.5],
|
||||
[0.5, 0.5],
|
||||
[0.75, 0.3333]
|
||||
],
|
||||
[
|
||||
[0.25, 0.3333],
|
||||
[0.5, 0.3333],
|
||||
[0.25, 0.5]
|
||||
],
|
||||
[
|
||||
[0.5, 0.5],
|
||||
[0.25, 0.5],
|
||||
[0.5, 0.3333]
|
||||
],
|
||||
[
|
||||
[0, 0.3333],
|
||||
[0.25, 0.3333],
|
||||
[0, 0.5]
|
||||
],
|
||||
[
|
||||
[0.25, 0.5],
|
||||
[0, 0.5],
|
||||
[0.25, 0.3333]
|
||||
],
|
||||
[
|
||||
[0.25, 0.5],
|
||||
[0.5, 0.5],
|
||||
[0.25, 0.6667]
|
||||
],
|
||||
[
|
||||
[0.5, 0.6667],
|
||||
[0.25, 0.6667],
|
||||
[0.5, 0.5]
|
||||
],
|
||||
[
|
||||
[0, 0.5],
|
||||
[0.25, 0.5],
|
||||
[0, 0.6667]
|
||||
],
|
||||
[
|
||||
[0.25, 0.6667],
|
||||
[0, 0.6667],
|
||||
[0.25, 0.5]
|
||||
],
|
||||
[
|
||||
[0.75, 0.6667],
|
||||
[1, 0.6667],
|
||||
[0.75, 0.8333]
|
||||
],
|
||||
[
|
||||
[1, 0.8333],
|
||||
[0.75, 0.8333],
|
||||
[1, 0.6667]
|
||||
],
|
||||
[
|
||||
[0.25, 0.6667],
|
||||
[0.5, 0.6667],
|
||||
[0.25, 0.8333]
|
||||
],
|
||||
[
|
||||
[0.5, 0.8333],
|
||||
[0.25, 0.8333],
|
||||
[0.5, 0.6667]
|
||||
],
|
||||
[
|
||||
[0, 0.6667],
|
||||
[0.25, 0.6667],
|
||||
[0, 0.8333]
|
||||
],
|
||||
[
|
||||
[0.25, 0.8333],
|
||||
[0, 0.8333],
|
||||
[0.25, 0.6667]
|
||||
],
|
||||
[
|
||||
[0.75, 0.8333],
|
||||
[1, 0.8333],
|
||||
[0.75, 1]
|
||||
],
|
||||
[
|
||||
[0.75, 1],
|
||||
[0.5, 1],
|
||||
[0.75, 0.8333]
|
||||
],
|
||||
[
|
||||
[0.25, 0.8333],
|
||||
[0.5, 0.8333],
|
||||
[0.25, 1]
|
||||
],
|
||||
[
|
||||
[0.5, 1],
|
||||
[0.25, 1],
|
||||
[0.5, 0.8333]
|
||||
],
|
||||
[
|
||||
[0, 0.8333],
|
||||
[0.25, 0.8333],
|
||||
[0, 1]
|
||||
],
|
||||
[
|
||||
[0.25, 1],
|
||||
[0, 1],
|
||||
[0.25, 0.8333]
|
||||
],
|
||||
[
|
||||
[1, 0],
|
||||
[0.8333, 0],
|
||||
[1, 0.25]
|
||||
],
|
||||
[
|
||||
[0.25, 0],
|
||||
[0, 0],
|
||||
[0.25, 0.25]
|
||||
],
|
||||
[
|
||||
[0, 0.25],
|
||||
[0.25, 0.25],
|
||||
[0, 0]
|
||||
],
|
||||
[
|
||||
[0.25, 0.25],
|
||||
[0.5, 0.25],
|
||||
[0.25, 0]
|
||||
],
|
||||
[
|
||||
[0.1667, 0],
|
||||
[0, 0],
|
||||
[0.1667, 0.25]
|
||||
],
|
||||
[
|
||||
[0.1667, 0.25],
|
||||
[0.3333, 0.25],
|
||||
[0.1667, 0]
|
||||
],
|
||||
[
|
||||
[0.5, 0],
|
||||
[0.3333, 0],
|
||||
[0.5, 0.25]
|
||||
],
|
||||
[
|
||||
[0.6667, 0],
|
||||
[0.5, 0],
|
||||
[0.6667, 0.25]
|
||||
],
|
||||
[
|
||||
[0.5, 0.25],
|
||||
[0.6667, 0.25],
|
||||
[0.5, 0]
|
||||
],
|
||||
[
|
||||
[0.8333, 0],
|
||||
[0.6667, 0],
|
||||
[0.8333, 0.25]
|
||||
],
|
||||
[
|
||||
[0.6667, 0.25],
|
||||
[0.8333, 0.25],
|
||||
[0.6667, 0]
|
||||
],
|
||||
[
|
||||
[1, 0],
|
||||
[0.8333, 0],
|
||||
[1, 0.25]
|
||||
],
|
||||
[
|
||||
[0.8333, 0.25],
|
||||
[1, 0.25],
|
||||
[0.8333, 0]
|
||||
],
|
||||
[
|
||||
[0.1667, 0.75],
|
||||
[0, 0.75],
|
||||
[0.1667, 1]
|
||||
],
|
||||
[
|
||||
[0.1667, 1],
|
||||
[0.3333, 1],
|
||||
[0.1667, 0.75]
|
||||
],
|
||||
[
|
||||
[0.5, 0.75],
|
||||
[0.3333, 0.75],
|
||||
[0.5, 1]
|
||||
],
|
||||
[
|
||||
[0.6667, 0.75],
|
||||
[0.5, 0.75],
|
||||
[0.6667, 1]
|
||||
],
|
||||
[
|
||||
[0.5, 1],
|
||||
[0.6667, 1],
|
||||
[0.5, 0.75]
|
||||
],
|
||||
[
|
||||
[0.8333, 0.75],
|
||||
[0.6667, 0.75],
|
||||
[0.8333, 1]
|
||||
],
|
||||
[
|
||||
[0.6667, 1],
|
||||
[0.8333, 1],
|
||||
[0.6667, 0.75]
|
||||
],
|
||||
[
|
||||
[1, 0.75],
|
||||
[0.8333, 0.75],
|
||||
[1, 1]
|
||||
],
|
||||
[
|
||||
[0.8333, 1],
|
||||
[1, 1],
|
||||
[0.8333, 0.75]
|
||||
]
|
||||
]
|
||||
}];
|
||||
this.mat = [{
|
||||
"r": 150,
|
||||
"g": 150,
|
||||
"b": 150
|
||||
},
|
||||
{
|
||||
"r": 150,
|
||||
"g": 150,
|
||||
"b": 150
|
||||
},
|
||||
{
|
||||
"r": 150,
|
||||
"g": 150,
|
||||
"b": 150
|
||||
}];
|
|
@ -1,221 +0,0 @@
|
|||
this.obj = [{
|
||||
"vrt": [
|
||||
[1.9769, 0.1642, -1.9734],
|
||||
[1.9819, 1.2692, -1.9783],
|
||||
[1.0333, 2.1006, -1.0297],
|
||||
[1.0968, 3.01, -1.0932],
|
||||
[0.6105, 6.3261, -0.607],
|
||||
[0.9846, 6.7653, -0.9811],
|
||||
[0.7213, 7.3779, -0.7177],
|
||||
[1.0163, 8.0204, -1.0128],
|
||||
[0.0017, 10.1568, 0.0018],
|
||||
[1.9769, 0.1642, 1.977],
|
||||
[1.9819, 1.2692, 1.9819],
|
||||
[1.0333, 2.1006, 1.0333],
|
||||
[1.0968, 3.01, 1.0968],
|
||||
[0.6105, 6.3261, 0.6106],
|
||||
[0.9846, 6.7653, 0.9847],
|
||||
[0.7213, 7.3779, 0.7213],
|
||||
[1.0384, 8.0204, 1.0385],
|
||||
[-1.9734, 0.1642, 1.977],
|
||||
[-1.9783, 1.2692, 1.9819],
|
||||
[-1.0298, 2.1006, 1.0333],
|
||||
[-1.0933, 3.01, 1.0968],
|
||||
[-0.607, 6.3261, 0.6106],
|
||||
[-0.9811, 6.7653, 0.9847],
|
||||
[-0.7177, 7.3779, 0.7213],
|
||||
[-1.0128, 8.0204, 1.0164],
|
||||
[-1.9734, 0.1642, -1.9734],
|
||||
[-1.9783, 1.2692, -1.9783],
|
||||
[-1.0298, 2.1006, -1.0297],
|
||||
[-1.0933, 3.01, -1.0932],
|
||||
[-0.607, 6.3261, -0.607],
|
||||
[-0.9811, 6.7653, -0.9811],
|
||||
[-0.7177, 7.3779, -0.7177],
|
||||
[-1.0348, 8.0204, -1.0348],
|
||||
[1.1677, 8.8898, -1.1642],
|
||||
[1.1843, 8.8951, 1.1844],
|
||||
[-1.1641, 8.8898, 1.1678],
|
||||
[-1.1807, 8.8951, -1.1808],
|
||||
[0.9621, 9.5788, -0.9586],
|
||||
[0.9716, 9.5879, 0.9717],
|
||||
[-0.9586, 9.5788, 0.9622],
|
||||
[-0.9681, 9.5878, -0.9681]
|
||||
],
|
||||
"fac": [
|
||||
[0, 10, 1, 0],
|
||||
[0, 9, 10, 0],
|
||||
[1, 11, 2, 0],
|
||||
[1, 10, 11, 0],
|
||||
[2, 12, 3, 0],
|
||||
[2, 11, 12, 0],
|
||||
[3, 13, 4, 0],
|
||||
[3, 12, 13, 0],
|
||||
[4, 14, 5, 0],
|
||||
[4, 13, 14, 0],
|
||||
[5, 15, 6, 0],
|
||||
[5, 14, 15, 0],
|
||||
[6, 16, 7, 0],
|
||||
[6, 15, 16, 0],
|
||||
[37, 38, 8, 0],
|
||||
[9, 18, 10, 0],
|
||||
[9, 17, 18, 0],
|
||||
[10, 19, 11, 0],
|
||||
[10, 18, 19, 0],
|
||||
[11, 20, 12, 0],
|
||||
[11, 19, 20, 0],
|
||||
[12, 21, 13, 0],
|
||||
[12, 20, 21, 0],
|
||||
[13, 22, 14, 0],
|
||||
[13, 21, 22, 0],
|
||||
[14, 23, 15, 0],
|
||||
[14, 22, 23, 0],
|
||||
[15, 24, 16, 0],
|
||||
[15, 23, 24, 0],
|
||||
[38, 39, 8, 0],
|
||||
[9, 25, 17, 0],
|
||||
[17, 26, 18, 0],
|
||||
[17, 25, 26, 0],
|
||||
[18, 27, 19, 0],
|
||||
[18, 26, 27, 0],
|
||||
[19, 28, 20, 0],
|
||||
[19, 27, 28, 0],
|
||||
[20, 29, 21, 0],
|
||||
[20, 28, 29, 0],
|
||||
[21, 30, 22, 0],
|
||||
[21, 29, 30, 0],
|
||||
[22, 31, 23, 0],
|
||||
[22, 30, 31, 0],
|
||||
[23, 32, 24, 0],
|
||||
[23, 31, 32, 0],
|
||||
[39, 40, 8, 0],
|
||||
[9, 0, 25, 0],
|
||||
[25, 1, 26, 0],
|
||||
[25, 0, 1, 0],
|
||||
[26, 2, 27, 0],
|
||||
[26, 1, 2, 0],
|
||||
[27, 3, 28, 0],
|
||||
[27, 2, 3, 0],
|
||||
[28, 4, 29, 0],
|
||||
[28, 3, 4, 0],
|
||||
[29, 5, 30, 0],
|
||||
[29, 4, 5, 0],
|
||||
[30, 6, 31, 0],
|
||||
[30, 5, 6, 0],
|
||||
[31, 7, 32, 0],
|
||||
[31, 6, 7, 0],
|
||||
[40, 37, 8, 0],
|
||||
[7, 16, 34, 0],
|
||||
[34, 33, 7, 0],
|
||||
[16, 24, 35, 0],
|
||||
[35, 34, 16, 0],
|
||||
[24, 32, 36, 0],
|
||||
[36, 35, 24, 0],
|
||||
[32, 7, 33, 0],
|
||||
[33, 36, 32, 0],
|
||||
[33, 34, 38, 0],
|
||||
[38, 37, 33, 0],
|
||||
[34, 35, 39, 0],
|
||||
[39, 38, 34, 0],
|
||||
[35, 36, 40, 0],
|
||||
[40, 39, 35, 0],
|
||||
[36, 33, 37, 0],
|
||||
[37, 40, 36, 0]
|
||||
],
|
||||
"nrm": [
|
||||
[0.7071, -0.7071, -0.0045],
|
||||
[0.7071, -0.7071, -0.0045],
|
||||
[0.4661, -0.4661, 0.752],
|
||||
[0.4661, -0.4661, 0.752],
|
||||
[0.7054, -0.7054, -0.0697],
|
||||
[0.7054, -0.7054, -0.0697],
|
||||
[0.6996, -0.6996, 0.1451],
|
||||
[0.6996, -0.6996, 0.1451],
|
||||
[0.5383, -0.5383, -0.6484],
|
||||
[0.5383, -0.5383, -0.6484],
|
||||
[0.6496, -0.6496, 0.395],
|
||||
[0.6496, -0.6496, 0.395],
|
||||
[0.6482, -0.6345, -0.421],
|
||||
[0.6341, -0.6341, -0.4426],
|
||||
[0.3659, -0.3566, 0.8597],
|
||||
[-0.7071, -0.7071, -0.0045],
|
||||
[-0.7071, -0.7071, -0.0045],
|
||||
[-0.4661, -0.4661, 0.752],
|
||||
[-0.4661, -0.4661, 0.752],
|
||||
[-0.7054, -0.7054, -0.0697],
|
||||
[-0.7054, -0.7054, -0.0697],
|
||||
[-0.6996, -0.6996, 0.1451],
|
||||
[-0.6996, -0.6996, 0.1451],
|
||||
[-0.5383, -0.5383, -0.6484],
|
||||
[-0.5383, -0.5383, -0.6484],
|
||||
[-0.6496, -0.6496, 0.395],
|
||||
[-0.6496, -0.6496, 0.395],
|
||||
[-0.6422, -0.6285, -0.4388],
|
||||
[-0.6426, -0.6426, -0.4174],
|
||||
[-0.3659, -0.3566, 0.8597],
|
||||
[-0, 0, -1],
|
||||
[-0.7071, 0.7071, -0.0045],
|
||||
[-0.7071, 0.7071, -0.0045],
|
||||
[-0.4661, 0.4661, 0.752],
|
||||
[-0.4661, 0.4661, 0.752],
|
||||
[-0.7054, 0.7054, -0.0697],
|
||||
[-0.7054, 0.7054, -0.0697],
|
||||
[-0.6996, 0.6996, 0.1451],
|
||||
[-0.6996, 0.6996, 0.1451],
|
||||
[-0.5383, 0.5383, -0.6484],
|
||||
[-0.5383, 0.5383, -0.6484],
|
||||
[-0.6496, 0.6496, 0.395],
|
||||
[-0.6496, 0.6496, 0.395],
|
||||
[-0.6482, 0.6345, -0.421],
|
||||
[-0.6341, 0.6341, -0.4426],
|
||||
[-0.3659, 0.3566, 0.8596],
|
||||
[0, 0, -1],
|
||||
[0.7071, 0.7071, -0.0045],
|
||||
[0.7071, 0.7071, -0.0045],
|
||||
[0.4661, 0.4661, 0.752],
|
||||
[0.4661, 0.4661, 0.752],
|
||||
[0.7054, 0.7054, -0.0697],
|
||||
[0.7054, 0.7054, -0.0697],
|
||||
[0.6996, 0.6996, 0.1451],
|
||||
[0.6996, 0.6996, 0.1451],
|
||||
[0.5383, 0.5383, -0.6484],
|
||||
[0.5383, 0.5383, -0.6484],
|
||||
[0.6496, 0.6496, 0.395],
|
||||
[0.6496, 0.6496, 0.395],
|
||||
[0.6422, 0.6285, -0.4388],
|
||||
[0.6426, 0.6426, -0.4174],
|
||||
[0.3658, 0.3566, 0.8597],
|
||||
[0.7051, -0.6901, -0.1628],
|
||||
[0.7011, -0.6918, -0.1726],
|
||||
[-0.7039, -0.6889, -0.1733],
|
||||
[-0.7022, -0.6929, -0.1635],
|
||||
[-0.7051, 0.6901, -0.1628],
|
||||
[-0.7011, 0.6918, -0.1726],
|
||||
[0.7039, 0.6889, -0.1733],
|
||||
[0.7022, 0.6929, -0.1635],
|
||||
[0.6817, -0.6712, 0.2913],
|
||||
[0.6815, -0.6729, 0.2876],
|
||||
[-0.6824, -0.6719, 0.288],
|
||||
[-0.6806, -0.672, 0.2917],
|
||||
[-0.6817, 0.6712, 0.2913],
|
||||
[-0.6815, 0.6729, 0.2876],
|
||||
[0.6824, 0.6719, 0.288],
|
||||
[0.6806, 0.672, 0.2917]
|
||||
],
|
||||
"tex": []
|
||||
}];
|
||||
this.mat = [{
|
||||
"r": 150,
|
||||
"g": 150,
|
||||
"b": 150
|
||||
},
|
||||
{
|
||||
"r": 150,
|
||||
"g": 150,
|
||||
"b": 150
|
||||
},
|
||||
{
|
||||
"r": 150,
|
||||
"g": 150,
|
||||
"b": 150
|
||||
}];
|
|
@ -1,853 +0,0 @@
|
|||
this.obj = [{
|
||||
"vrt": [
|
||||
[2.8, 0.1424, -2.795],
|
||||
[2.807, 1.7075, -2.802],
|
||||
[1.1264, 2.9507, -1.1213],
|
||||
[1.5027, 3.3878, -1.1725],
|
||||
[0.8463, 8.8307, -0.8465],
|
||||
[1.5432, 9.601, -1.5482],
|
||||
[0.7375, 10.8789, -0.733],
|
||||
[2.8, 0.1424, 2.8001],
|
||||
[2.807, 1.7075, 2.8071],
|
||||
[1.1264, 2.9507, 1.1265],
|
||||
[1.5027, 3.3878, 1.1783],
|
||||
[0.8463, 8.8307, 0.8524],
|
||||
[1.5432, 9.601, 1.5541],
|
||||
[0.73, 10.8852, 0.7359],
|
||||
[-2.795, 0.1424, 2.8001],
|
||||
[-2.802, 1.7075, 2.8071],
|
||||
[-1.1214, 2.9507, 1.1265],
|
||||
[-1.4976, 3.3878, 1.1783],
|
||||
[-0.8411, 8.8307, 0.8524],
|
||||
[-1.5381, 9.601, 1.5541],
|
||||
[-0.7235, 10.8839, 0.7402],
|
||||
[-2.795, 0.1424, -2.795],
|
||||
[-2.802, 1.7075, -2.802],
|
||||
[-1.1214, 2.9507, -1.1213],
|
||||
[-1.4976, 3.3878, -1.1725],
|
||||
[-0.8411, 8.8307, -0.8465],
|
||||
[-1.5381, 9.601, -1.5482],
|
||||
[-0.7203, 10.8852, -0.7319],
|
||||
[-1.2998, 12.3851, 1.2739],
|
||||
[0.0023, 12.3851, 1.8826],
|
||||
[1.3044, 12.3851, 1.2739],
|
||||
[-1.2998, 12.3851, -1.2972],
|
||||
[0.0023, 12.3851, -1.9059],
|
||||
[1.3044, 12.3851, -1.2972],
|
||||
[1.9225, 12.3851, -0.0116],
|
||||
[-1.9178, 12.3851, -0.0116],
|
||||
[3.3433, 14.6619, -0.0011],
|
||||
[1.054, 14.6619, 1.0597],
|
||||
[0.0005, 14.6619, 3.3645],
|
||||
[-1.053, 14.6619, 1.0597],
|
||||
[-3.3422, 14.6619, -0.0011],
|
||||
[-1.053, 14.6619, -1.0618],
|
||||
[0.0005, 14.6619, -3.3666],
|
||||
[1.054, 14.6619, -1.0618],
|
||||
[-0.0001, 15.3165, 0.0002],
|
||||
[1.8986, 14.1137, -0.0011],
|
||||
[0.529, 14.0998, 0.5323],
|
||||
[0.0005, 14.1138, 1.9107],
|
||||
[-0.5279, 14.0998, 0.5322],
|
||||
[-1.8976, 14.1137, -0.0011],
|
||||
[-0.5281, 14.0999, -0.5345],
|
||||
[0.0005, 14.1138, -1.9129],
|
||||
[0.5292, 14.0999, -0.5345],
|
||||
[-0.3454, 15.9818, -0.3454],
|
||||
[0.3454, 15.9818, -0.3454],
|
||||
[0.3454, 15.9818, 0.3454],
|
||||
[-0.3454, 15.9818, 0.3454],
|
||||
[0, 16.552, -0]
|
||||
],
|
||||
"fac": [
|
||||
[0, 8, 1, 0],
|
||||
[0, 7, 8, 0],
|
||||
[1, 9, 2, 0],
|
||||
[1, 8, 9, 0],
|
||||
[2, 10, 3, 0],
|
||||
[2, 9, 10, 0],
|
||||
[3, 11, 4, 0],
|
||||
[3, 10, 11, 0],
|
||||
[4, 12, 5, 0],
|
||||
[4, 11, 12, 0],
|
||||
[5, 13, 6, 0],
|
||||
[5, 12, 13, 0],
|
||||
[7, 15, 8, 0],
|
||||
[7, 14, 15, 0],
|
||||
[8, 16, 9, 0],
|
||||
[8, 15, 16, 0],
|
||||
[9, 17, 10, 0],
|
||||
[9, 16, 17, 0],
|
||||
[10, 18, 11, 0],
|
||||
[10, 17, 18, 0],
|
||||
[11, 19, 12, 0],
|
||||
[11, 18, 19, 0],
|
||||
[12, 20, 13, 0],
|
||||
[12, 19, 20, 0],
|
||||
[7, 21, 14, 0],
|
||||
[14, 22, 15, 0],
|
||||
[14, 21, 22, 0],
|
||||
[15, 23, 16, 0],
|
||||
[15, 22, 23, 0],
|
||||
[16, 24, 17, 0],
|
||||
[16, 23, 24, 0],
|
||||
[17, 25, 18, 0],
|
||||
[17, 24, 25, 0],
|
||||
[18, 26, 19, 0],
|
||||
[18, 25, 26, 0],
|
||||
[19, 27, 20, 0],
|
||||
[19, 26, 27, 0],
|
||||
[7, 0, 21, 0],
|
||||
[21, 1, 22, 0],
|
||||
[21, 0, 1, 0],
|
||||
[22, 2, 23, 0],
|
||||
[22, 1, 2, 0],
|
||||
[23, 3, 24, 0],
|
||||
[23, 2, 3, 0],
|
||||
[24, 4, 25, 0],
|
||||
[24, 3, 4, 0],
|
||||
[25, 5, 26, 0],
|
||||
[25, 4, 5, 0],
|
||||
[26, 6, 27, 0],
|
||||
[26, 5, 6, 0],
|
||||
[20, 28, 29, 1],
|
||||
[32, 31, 27, 0],
|
||||
[27, 6, 32, 0],
|
||||
[33, 32, 6, 0],
|
||||
[13, 30, 34, 3],
|
||||
[27, 31, 35, 2],
|
||||
[34, 37, 36, 0],
|
||||
[34, 30, 37, 0],
|
||||
[29, 39, 38, 0],
|
||||
[29, 28, 39, 0],
|
||||
[35, 41, 40, 0],
|
||||
[35, 31, 41, 0],
|
||||
[32, 43, 42, 0],
|
||||
[32, 33, 43, 0],
|
||||
[45, 46, 44, 0],
|
||||
[46, 47, 44, 0],
|
||||
[47, 48, 44, 0],
|
||||
[48, 49, 44, 0],
|
||||
[49, 50, 44, 0],
|
||||
[50, 51, 44, 0],
|
||||
[51, 52, 44, 0],
|
||||
[52, 45, 44, 0],
|
||||
[36, 37, 46, 0],
|
||||
[46, 45, 36, 0],
|
||||
[37, 38, 47, 0],
|
||||
[47, 46, 37, 0],
|
||||
[38, 39, 48, 0],
|
||||
[48, 47, 38, 0],
|
||||
[39, 40, 49, 0],
|
||||
[49, 48, 39, 0],
|
||||
[40, 41, 50, 0],
|
||||
[50, 49, 40, 0],
|
||||
[41, 42, 51, 0],
|
||||
[51, 50, 41, 0],
|
||||
[42, 43, 52, 0],
|
||||
[52, 51, 42, 0],
|
||||
[43, 36, 45, 0],
|
||||
[45, 52, 43, 0],
|
||||
[54, 53, 44, 0],
|
||||
[55, 54, 44, 0],
|
||||
[56, 55, 44, 0],
|
||||
[53, 56, 44, 0],
|
||||
[54, 57, 53, 0],
|
||||
[55, 57, 54, 0],
|
||||
[56, 57, 55, 0],
|
||||
[53, 57, 56, 0],
|
||||
[35, 40, 39, 0],
|
||||
[35, 39, 28, 0],
|
||||
[35, 20, 27, 0],
|
||||
[35, 28, 20, 0],
|
||||
[32, 42, 41, 0],
|
||||
[32, 41, 31, 0],
|
||||
[34, 36, 43, 0],
|
||||
[34, 43, 33, 0],
|
||||
[13, 34, 6, 0],
|
||||
[6, 34, 33, 0],
|
||||
[29, 38, 37, 0],
|
||||
[29, 37, 30, 0],
|
||||
[20, 29, 13, 0],
|
||||
[29, 30, 13, 0]
|
||||
],
|
||||
"nrm": [
|
||||
[0.7071, -0.7071, -0.0045],
|
||||
[0.7071, -0.7071, -0.0045],
|
||||
[0.4205, -0.4205, 0.804],
|
||||
[0.4205, -0.4205, 0.804],
|
||||
[0.5359, -0.5359, -0.6524],
|
||||
[0.5359, -0.5359, -0.6524],
|
||||
[0.702, -0.702, 0.1197],
|
||||
[0.702, -0.702, 0.1197],
|
||||
[0.5243, -0.5243, -0.6709],
|
||||
[0.5243, -0.5243, -0.6709],
|
||||
[0.5971, -0.6, 0.5324],
|
||||
[0.5974, -0.5974, 0.535],
|
||||
[-0.7071, -0.7071, -0.0045],
|
||||
[-0.7071, -0.7071, -0.0045],
|
||||
[-0.4205, -0.4205, 0.804],
|
||||
[-0.4205, -0.4205, 0.804],
|
||||
[-0.7022, -0.7022, -0.1177],
|
||||
[-0.7022, -0.7022, -0.1177],
|
||||
[-0.7058, -0.7058, 0.0598],
|
||||
[-0.7058, -0.7058, 0.0598],
|
||||
[-0.5227, -0.5227, -0.6734],
|
||||
[-0.5227, -0.5227, -0.6734],
|
||||
[-0.5945, -0.5974, 0.5382],
|
||||
[-0.5971, -0.5971, 0.5357],
|
||||
[-0, 0, -1],
|
||||
[-0.7071, 0.7071, -0.0045],
|
||||
[-0.7071, 0.7071, -0.0045],
|
||||
[-0.4205, 0.4205, 0.804],
|
||||
[-0.4205, 0.4205, 0.804],
|
||||
[-0.536, 0.536, -0.6523],
|
||||
[-0.536, 0.536, -0.6523],
|
||||
[-0.702, 0.702, 0.1197],
|
||||
[-0.702, 0.702, 0.1197],
|
||||
[-0.5243, 0.5243, -0.6709],
|
||||
[-0.5243, 0.5243, -0.6709],
|
||||
[-0.5963, 0.5982, 0.5354],
|
||||
[-0.5964, 0.5964, 0.5371],
|
||||
[0, 0, -1],
|
||||
[0.7071, 0.7071, -0.0045],
|
||||
[0.7071, 0.7071, -0.0045],
|
||||
[0.4205, 0.4205, 0.804],
|
||||
[0.4205, 0.4205, 0.804],
|
||||
[0.7023, 0.7023, -0.1163],
|
||||
[0.7023, 0.7023, -0.1163],
|
||||
[0.7058, 0.7058, 0.0598],
|
||||
[0.7058, 0.7058, 0.0598],
|
||||
[0.5227, 0.5227, -0.6734],
|
||||
[0.5227, 0.5227, -0.6734],
|
||||
[0.5983, 0.5959, 0.5357],
|
||||
[0.5961, 0.5961, 0.5378],
|
||||
[-0.8459, -0.307, -0.4361],
|
||||
[0.3045, 0.8391, -0.4508],
|
||||
[0.5551, 0.5597, -0.6154],
|
||||
[0.8412, 0.3053, -0.4463],
|
||||
[0.2959, -0.8438, -0.4476],
|
||||
[-0.2946, 0.8401, -0.4554],
|
||||
[-0.3327, -0.9072, -0.2576],
|
||||
[0.3277, -0.9346, 0.1385],
|
||||
[-0.9044, 0.337, -0.2619],
|
||||
[-0.932, -0.3382, 0.13],
|
||||
[0.3333, 0.9089, -0.2506],
|
||||
[-0.3276, 0.9342, 0.1411],
|
||||
[0.9056, -0.3374, -0.2571],
|
||||
[0.9309, 0.3378, 0.1389],
|
||||
[-0.3547, -0.7955, 0.4912],
|
||||
[0.3592, -0.7946, 0.4894],
|
||||
[-0.7949, 0.3594, 0.4888],
|
||||
[-0.7957, -0.3548, 0.491],
|
||||
[0.3544, 0.795, 0.4924],
|
||||
[-0.3592, 0.7946, 0.4894],
|
||||
[0.7943, -0.359, 0.4901],
|
||||
[0.7948, 0.3543, 0.4927],
|
||||
[0.2157, 0.5882, 0.7794],
|
||||
[0.2814, 0.6568, 0.6996],
|
||||
[-0.2345, 0.6295, 0.7408],
|
||||
[-0.2521, 0.5836, 0.7719],
|
||||
[0.5883, -0.2192, 0.7784],
|
||||
[0.6575, -0.2859, 0.6971],
|
||||
[0.629, 0.2307, 0.7424],
|
||||
[0.5834, 0.2484, 0.7733],
|
||||
[-0.2157, -0.5882, 0.7794],
|
||||
[-0.2814, -0.6568, 0.6996],
|
||||
[0.2346, -0.6295, 0.7408],
|
||||
[0.2521, -0.5836, 0.7719],
|
||||
[-0.5884, 0.2192, 0.7783],
|
||||
[-0.6575, 0.2858, 0.6972],
|
||||
[-0.629, -0.2307, 0.7424],
|
||||
[-0.5835, -0.2484, 0.7732],
|
||||
[0.6275, 0.6275, -0.461],
|
||||
[0.6276, -0.6276, -0.4608],
|
||||
[-0.6277, -0.6277, -0.4605],
|
||||
[-0.6276, 0.6276, -0.4607],
|
||||
[0.6048, 0.6048, 0.518],
|
||||
[0.6048, -0.6048, 0.518],
|
||||
[-0.6048, -0.6048, 0.518],
|
||||
[-0.6048, 0.6048, 0.518],
|
||||
[-0.907, -0.3326, -0.2582],
|
||||
[-0.9348, 0.3278, 0.1372],
|
||||
[-0.5514, 0.5545, -0.6233],
|
||||
[-0.844, 0.296, -0.4472],
|
||||
[-0.3373, 0.9052, -0.2584],
|
||||
[0.3379, 0.931, 0.1382],
|
||||
[0.9091, 0.3334, -0.2499],
|
||||
[0.934, -0.3275, 0.1425],
|
||||
[0.5499, -0.5594, -0.6203],
|
||||
[0.8435, -0.2958, -0.4483],
|
||||
[0.3371, -0.9047, -0.2605],
|
||||
[-0.3382, -0.9319, 0.1307],
|
||||
[-0.5602, -0.5642, -0.6065],
|
||||
[-0.3067, -0.8451, -0.4379]
|
||||
],
|
||||
"tex": [
|
||||
[
|
||||
[7.2839, -24.849],
|
||||
[-12.017, -17.2137],
|
||||
[7.3321, -17.2137]
|
||||
],
|
||||
[
|
||||
[7.2839, -24.849],
|
||||
[-12.017, -24.849],
|
||||
[-12.017, -17.2137]
|
||||
],
|
||||
[
|
||||
[7.3321, -17.2137],
|
||||
[-12.017, -11.4689],
|
||||
[-1.9372, -11.4688]
|
||||
],
|
||||
[
|
||||
[7.3321, -17.2137],
|
||||
[-12.017, -17.2137],
|
||||
[-12.017, -11.4689]
|
||||
],
|
||||
[
|
||||
[-1.9372, -11.4688],
|
||||
[-12.017, -5.1848],
|
||||
[-1.3167, -5.1847]
|
||||
],
|
||||
[
|
||||
[-1.9372, -11.4688],
|
||||
[-12.017, -11.4689],
|
||||
[-12.017, -5.1848]
|
||||
],
|
||||
[
|
||||
[-1.3167, -5.1847],
|
||||
[-12.017, 17.728],
|
||||
[-6.0682, 17.728]
|
||||
],
|
||||
[
|
||||
[-1.3167, -5.1847],
|
||||
[-12.017, -5.1848],
|
||||
[-12.017, 17.728]
|
||||
],
|
||||
[
|
||||
[-6.0682, 17.728],
|
||||
[-12.017, 20.7633],
|
||||
[-2.4126, 20.7633]
|
||||
],
|
||||
[
|
||||
[-6.0682, 17.728],
|
||||
[-12.017, 17.728],
|
||||
[-12.017, 20.7633]
|
||||
],
|
||||
[
|
||||
[-2.4126, 20.7633],
|
||||
[-12.017, 24.996],
|
||||
[-4.9863, 24.996]
|
||||
],
|
||||
[
|
||||
[-2.4126, 20.7633],
|
||||
[-12.017, 20.7633],
|
||||
[-12.017, 24.996]
|
||||
],
|
||||
[
|
||||
[-12.017, -24.849],
|
||||
[-31.3662, -17.2137],
|
||||
[-12.017, -17.2137]
|
||||
],
|
||||
[
|
||||
[-12.017, -24.849],
|
||||
[-31.318, -24.849],
|
||||
[-31.3662, -17.2137]
|
||||
],
|
||||
[
|
||||
[-12.017, -17.2137],
|
||||
[-22.0969, -11.4688],
|
||||
[-12.017, -11.4689]
|
||||
],
|
||||
[
|
||||
[-12.017, -17.2137],
|
||||
[-31.3662, -17.2137],
|
||||
[-22.0969, -11.4688]
|
||||
],
|
||||
[
|
||||
[-12.017, -11.4689],
|
||||
[-22.7174, -5.1847],
|
||||
[-12.017, -5.1848]
|
||||
],
|
||||
[
|
||||
[-12.017, -11.4689],
|
||||
[-22.0969, -11.4688],
|
||||
[-22.7174, -5.1847]
|
||||
],
|
||||
[
|
||||
[-12.017, -5.1848],
|
||||
[-17.9659, 17.728],
|
||||
[-12.017, 17.728]
|
||||
],
|
||||
[
|
||||
[-12.017, -5.1848],
|
||||
[-22.7174, -5.1847],
|
||||
[-17.9659, 17.728]
|
||||
],
|
||||
[
|
||||
[-12.017, 17.728],
|
||||
[-21.6214, 20.7633],
|
||||
[-12.017, 20.7633]
|
||||
],
|
||||
[
|
||||
[-12.017, 17.728],
|
||||
[-17.9659, 17.728],
|
||||
[-21.6214, 20.7633]
|
||||
],
|
||||
[
|
||||
[-12.017, 20.7633],
|
||||
[-19.0478, 24.996],
|
||||
[-12.017, 24.996]
|
||||
],
|
||||
[
|
||||
[-12.017, 20.7633],
|
||||
[-21.6214, 20.7633],
|
||||
[-19.0478, 24.996]
|
||||
],
|
||||
[
|
||||
[-12.017, -24.849],
|
||||
[-12.017, -24.849],
|
||||
[-31.318, -24.849]
|
||||
],
|
||||
[
|
||||
[-31.318, -24.849],
|
||||
[-12.017, -17.2137],
|
||||
[-31.3662, -17.2137]
|
||||
],
|
||||
[
|
||||
[-31.318, -24.849],
|
||||
[-12.017, -24.849],
|
||||
[-12.017, -17.2137]
|
||||
],
|
||||
[
|
||||
[-31.3662, -17.2137],
|
||||
[-12.017, -11.4688],
|
||||
[-22.0969, -11.4688]
|
||||
],
|
||||
[
|
||||
[-31.3662, -17.2137],
|
||||
[-12.017, -17.2137],
|
||||
[-12.017, -11.4688]
|
||||
],
|
||||
[
|
||||
[-22.0969, -11.4688],
|
||||
[-12.017, -5.1847],
|
||||
[-22.7174, -5.1847]
|
||||
],
|
||||
[
|
||||
[-22.0969, -11.4688],
|
||||
[-12.017, -11.4688],
|
||||
[-12.017, -5.1847]
|
||||
],
|
||||
[
|
||||
[-22.7174, -5.1847],
|
||||
[-12.017, 17.728],
|
||||
[-17.9659, 17.728]
|
||||
],
|
||||
[
|
||||
[-22.7174, -5.1847],
|
||||
[-12.017, -5.1847],
|
||||
[-12.017, 17.728]
|
||||
],
|
||||
[
|
||||
[-17.9659, 17.728],
|
||||
[-12.017, 20.7633],
|
||||
[-21.6214, 20.7633]
|
||||
],
|
||||
[
|
||||
[-17.9659, 17.728],
|
||||
[-12.017, 17.728],
|
||||
[-12.017, 20.7633]
|
||||
],
|
||||
[
|
||||
[-21.6214, 20.7633],
|
||||
[-12.017, 24.996],
|
||||
[-19.0478, 24.996]
|
||||
],
|
||||
[
|
||||
[-21.6214, 20.7633],
|
||||
[-12.017, 20.7633],
|
||||
[-12.017, 24.996]
|
||||
],
|
||||
[
|
||||
[-12.017, -24.849],
|
||||
[7.2839, -24.849],
|
||||
[-12.017, -24.849]
|
||||
],
|
||||
[
|
||||
[-12.017, -24.849],
|
||||
[7.3321, -17.2137],
|
||||
[-12.017, -17.2137]
|
||||
],
|
||||
[
|
||||
[-12.017, -24.849],
|
||||
[7.2839, -24.849],
|
||||
[7.3321, -17.2137]
|
||||
],
|
||||
[
|
||||
[-12.017, -17.2137],
|
||||
[-1.9372, -11.4688],
|
||||
[-12.017, -11.4688]
|
||||
],
|
||||
[
|
||||
[-12.017, -17.2137],
|
||||
[7.3321, -17.2137],
|
||||
[-1.9372, -11.4688]
|
||||
],
|
||||
[
|
||||
[-12.017, -11.4688],
|
||||
[-1.3167, -5.1847],
|
||||
[-12.017, -5.1847]
|
||||
],
|
||||
[
|
||||
[-12.017, -11.4688],
|
||||
[-1.9372, -11.4688],
|
||||
[-1.3167, -5.1847]
|
||||
],
|
||||
[
|
||||
[-12.017, -5.1847],
|
||||
[-6.0682, 17.728],
|
||||
[-12.017, 17.728]
|
||||
],
|
||||
[
|
||||
[-12.017, -5.1847],
|
||||
[-1.3167, -5.1847],
|
||||
[-6.0682, 17.728]
|
||||
],
|
||||
[
|
||||
[-12.017, 17.728],
|
||||
[-2.4126, 20.7633],
|
||||
[-12.017, 20.7633]
|
||||
],
|
||||
[
|
||||
[-12.017, 17.728],
|
||||
[-6.0682, 17.728],
|
||||
[-2.4126, 20.7633]
|
||||
],
|
||||
[
|
||||
[-12.017, 20.7633],
|
||||
[-4.9863, 24.996],
|
||||
[-12.017, 24.996]
|
||||
],
|
||||
[
|
||||
[-12.017, 20.7633],
|
||||
[-2.4126, 20.7633],
|
||||
[-4.9863, 24.996]
|
||||
],
|
||||
[
|
||||
[1, 0],
|
||||
[1, 0.5],
|
||||
[0.5, 0.5]
|
||||
],
|
||||
[
|
||||
[0.5, 0.5],
|
||||
[0, 0.5],
|
||||
[0, 0]
|
||||
],
|
||||
[
|
||||
[0, 0],
|
||||
[0.5, 0],
|
||||
[0.5, 0.5]
|
||||
],
|
||||
[
|
||||
[1, 0.5],
|
||||
[0.5, 0.5],
|
||||
[0.5, 0]
|
||||
],
|
||||
[
|
||||
[0, 0],
|
||||
[0.5, 0],
|
||||
[0.5, 0.5]
|
||||
],
|
||||
[
|
||||
[1, 1],
|
||||
[0.5, 1],
|
||||
[0.5, 0.5]
|
||||
],
|
||||
[
|
||||
[0.75, 0],
|
||||
[0.875, 0.5],
|
||||
[0.75, 0.5]
|
||||
],
|
||||
[
|
||||
[0.75, 0],
|
||||
[0.875, 0],
|
||||
[0.875, 0.5]
|
||||
],
|
||||
[
|
||||
[0, 0],
|
||||
[0.125, 0.5],
|
||||
[0, 0.5]
|
||||
],
|
||||
[
|
||||
[0, 0],
|
||||
[0.125, 0],
|
||||
[0.125, 0.5]
|
||||
],
|
||||
[
|
||||
[0.25, 0],
|
||||
[0.375, 0.5],
|
||||
[0.25, 0.5]
|
||||
],
|
||||
[
|
||||
[0.25, 0],
|
||||
[0.375, 0],
|
||||
[0.375, 0.5]
|
||||
],
|
||||
[
|
||||
[0.5, 0],
|
||||
[0.625, 0.5],
|
||||
[0.5, 0.5]
|
||||
],
|
||||
[
|
||||
[0.5, 0],
|
||||
[0.625, 0],
|
||||
[0.625, 0.5]
|
||||
],
|
||||
[
|
||||
[0.75, 0.5],
|
||||
[0.875, 0.5],
|
||||
[0.875, 1]
|
||||
],
|
||||
[
|
||||
[-0.125, 0.5],
|
||||
[0, 0.5],
|
||||
[0, 1]
|
||||
],
|
||||
[
|
||||
[0, 0.5],
|
||||
[0.125, 0.5],
|
||||
[0.125, 1]
|
||||
],
|
||||
[
|
||||
[0.125, 0.5],
|
||||
[0.25, 0.5],
|
||||
[0.25, 1]
|
||||
],
|
||||
[
|
||||
[0.25, 0.5],
|
||||
[0.375, 0.5],
|
||||
[0.375, 1]
|
||||
],
|
||||
[
|
||||
[0.375, 0.5],
|
||||
[0.5, 0.5],
|
||||
[0.5, 1]
|
||||
],
|
||||
[
|
||||
[0.5, 0.5],
|
||||
[0.625, 0.5],
|
||||
[0.625, 1]
|
||||
],
|
||||
[
|
||||
[0.625, 0.5],
|
||||
[0.75, 0.5],
|
||||
[0.75, 1]
|
||||
],
|
||||
[
|
||||
[0.75, 0.5],
|
||||
[0.875, 0.5],
|
||||
[0.875, 0.5]
|
||||
],
|
||||
[
|
||||
[0.875, 0.5],
|
||||
[0.75, 0.5],
|
||||
[0.75, 0.5]
|
||||
],
|
||||
[
|
||||
[-0.125, 0.5],
|
||||
[0, 0.5],
|
||||
[0, 0.5]
|
||||
],
|
||||
[
|
||||
[0, 0.5],
|
||||
[-0.125, 0.5],
|
||||
[-0.125, 0.5]
|
||||
],
|
||||
[
|
||||
[0, 0.5],
|
||||
[0.125, 0.5],
|
||||
[0.125, 0.5]
|
||||
],
|
||||
[
|
||||
[0.125, 0.5],
|
||||
[0, 0.5],
|
||||
[0, 0.5]
|
||||
],
|
||||
[
|
||||
[0.125, 0.5],
|
||||
[0.25, 0.5],
|
||||
[0.25, 0.5]
|
||||
],
|
||||
[
|
||||
[0.25, 0.5],
|
||||
[0.125, 0.5],
|
||||
[0.125, 0.5]
|
||||
],
|
||||
[
|
||||
[0.25, 0.5],
|
||||
[0.375, 0.5],
|
||||
[0.375, 0.5]
|
||||
],
|
||||
[
|
||||
[0.375, 0.5],
|
||||
[0.25, 0.5],
|
||||
[0.25, 0.5]
|
||||
],
|
||||
[
|
||||
[0.375, 0.5],
|
||||
[0.5, 0.5],
|
||||
[0.5, 0.5]
|
||||
],
|
||||
[
|
||||
[0.5, 0.5],
|
||||
[0.375, 0.5],
|
||||
[0.375, 0.5]
|
||||
],
|
||||
[
|
||||
[0.5, 0.5],
|
||||
[0.625, 0.5],
|
||||
[0.625, 0.5]
|
||||
],
|
||||
[
|
||||
[0.625, 0.5],
|
||||
[0.5, 0.5],
|
||||
[0.5, 0.5]
|
||||
],
|
||||
[
|
||||
[0.625, 0.5],
|
||||
[0.75, 0.5],
|
||||
[0.75, 0.5]
|
||||
],
|
||||
[
|
||||
[0.75, 0.5],
|
||||
[0.625, 0.5],
|
||||
[0.625, 0.5]
|
||||
],
|
||||
[
|
||||
[1, -0],
|
||||
[0, -0],
|
||||
[0.5, 1]
|
||||
],
|
||||
[
|
||||
[1, -0],
|
||||
[0, -0],
|
||||
[0.5, 1]
|
||||
],
|
||||
[
|
||||
[1, -0],
|
||||
[0, -0],
|
||||
[0.5, 1]
|
||||
],
|
||||
[
|
||||
[1, -0],
|
||||
[0, -0],
|
||||
[0.5, 1]
|
||||
],
|
||||
[
|
||||
[1, 1],
|
||||
[0.5, 0.5],
|
||||
[0, 1]
|
||||
],
|
||||
[
|
||||
[1, 0],
|
||||
[0.5, 0.5],
|
||||
[1, 1]
|
||||
],
|
||||
[
|
||||
[0, 0],
|
||||
[0.5, 0.5],
|
||||
[1, 0]
|
||||
],
|
||||
[
|
||||
[0, 1],
|
||||
[0.5, 0.5],
|
||||
[0, 0]
|
||||
],
|
||||
[
|
||||
[0.5, 0.5],
|
||||
[0.25, 0.5],
|
||||
[0.125, 0.5]
|
||||
],
|
||||
[
|
||||
[0.5, 0.5],
|
||||
[0.125, 0.5],
|
||||
[1, 0.5]
|
||||
],
|
||||
[
|
||||
[0.5, 0.5],
|
||||
[-19.0478, 24.996],
|
||||
[-12.017, 24.996]
|
||||
],
|
||||
[
|
||||
[0.5, 0.5],
|
||||
[1, 0.5],
|
||||
[-19.0478, 24.996]
|
||||
],
|
||||
[
|
||||
[0.5, 0.5],
|
||||
[0.5, 0.5],
|
||||
[0.375, 0.5]
|
||||
],
|
||||
[
|
||||
[0.5, 0.5],
|
||||
[0.375, 0.5],
|
||||
[0, 0.5]
|
||||
],
|
||||
[
|
||||
[0.5, 0.5],
|
||||
[0.75, 0.5],
|
||||
[0.625, 0.5]
|
||||
],
|
||||
[
|
||||
[0.5, 0.5],
|
||||
[0.625, 0.5],
|
||||
[1, 0.5]
|
||||
],
|
||||
[
|
||||
[-12.017, 24.996],
|
||||
[0.5, 0.5],
|
||||
[-4.9863, 24.996]
|
||||
],
|
||||
[
|
||||
[-4.9863, 24.996],
|
||||
[0.5, 0.5],
|
||||
[1, 0.5]
|
||||
],
|
||||
[
|
||||
[0.5, 0.5],
|
||||
[0, 0.5],
|
||||
[0.875, 0.5]
|
||||
],
|
||||
[
|
||||
[0.5, 0.5],
|
||||
[0.875, 0.5],
|
||||
[0, 0.5]
|
||||
],
|
||||
[
|
||||
[-19.0478, 24.996],
|
||||
[0.5, 0.5],
|
||||
[-12.017, 24.996]
|
||||
],
|
||||
[
|
||||
[0.5, 0.5],
|
||||
[0, 0.5],
|
||||
[-12.017, 24.996]
|
||||
]
|
||||
]
|
||||
}];
|
||||
this.mat = [{
|
||||
"r": 150,
|
||||
"g": 150,
|
||||
"b": 150
|
||||
},
|
||||
{
|
||||
"r": 150,
|
||||
"g": 150,
|
||||
"b": 150
|
||||
},
|
||||
{
|
||||
"r": 150,
|
||||
"g": 150,
|
||||
"b": 150
|
||||
}];
|
|
@ -1,16 +0,0 @@
|
|||
[Event "ICS Unrated Chess Match"]
|
||||
[Site "?"]
|
||||
[Date "2010.07.18"]
|
||||
[Round "?"]
|
||||
[White "GuestSXJG"]
|
||||
[Black "GuestRBZS"]
|
||||
[TimeControl "300+0"]
|
||||
[Result "1-0"]
|
||||
|
||||
1. e4 e6 2. d4 g6 3. d5 Bg7 4. dxe6 fxe6 5. Nf3 Ne7 6. Bg5 c6 7. e5 Qa5+
|
||||
8. Qd2 Qb6 9. Bxe7 Kxe7 10. Qg5+ Ke8 11. b3 Rf8 12. Bd3 d6 13. c3 dxe5
|
||||
14. Nxe5 Qxf2+ 15. Kd1 Bxe5 16. Qxe5 Qxg2 17. Be4 Rf1+ 18. Rxf1 Qxf1+ 19. Kc2
|
||||
Nd7 20. Qh8+ Qf8 21. Qxh7 Ne5 22. Nd2 Bd7 23. Nc4 Qf2+ 24. Nd2 Rd8 25. Rf1
|
||||
Qe3 26. Bxg6+ Nxg6 27. Qf7#
|
||||
{GuestRBZS checkmated} 1-0
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
#flatChessboard { /* Table element */
|
||||
/**
|
||||
* margin-top: [DYNAMIC VALUE];
|
||||
* margin-bottom: [DYNAMIC VALUE];
|
||||
*/
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
border-collapse: collapse;
|
||||
border: 0;
|
||||
}
|
||||
#flatChessboard tr td.blackSquares, #flatChessboard tr td.whiteSquares {
|
||||
width: 11%;
|
||||
height: 11%;
|
||||
font-size: 52px;
|
||||
line-height: 42px;
|
||||
text-align: center;
|
||||
font-family: Times New Roman;
|
||||
}
|
||||
|
||||
#flatChessboard tr td.blackSquares span, #flatChessboard tr td.whiteSquares span { cursor: pointer; }
|
||||
|
||||
#flatChessboard tr th.horizCoords {
|
||||
width: 11%;
|
||||
height: 6%;
|
||||
}
|
||||
|
||||
#flatChessboard tr th.vertCoords {
|
||||
width: 6%;
|
||||
height: 11%;
|
||||
}
|
||||
|
||||
#flatChessboard tr td.blackSquares { background-color: #cccccc; }
|
||||
|
||||
/* #flatChessboard tr td.blackSquares:hover { background-color: #ccccaa; } */
|
||||
|
||||
#flatChessboard tr td.whiteSquares { background-color: #ffffff; }
|
||||
|
||||
/* #flatChessboard tr td.whiteSquares:hover { background-color: #ddddaa; } */
|
||||
|
||||
#flatChessboard tr td.boardAngle /*, #bottomBorder */ { height: 6%; }
|
||||
|
||||
#flatChessboard tr td.boardAngle { background-color: #ffffff;}
|
||||
|
||||
#flatChessboard tr td.boardAngle /*, #rightBorder */ {
|
||||
width: 6%;
|
||||
}
|
||||
#flatChessboard tr th, #flatChessboard tr td.boardAngle /*, #rightBorder, #bottomBorder */ {
|
||||
overflow: visible;
|
||||
background-color: #ce5c00;
|
||||
color: #f9ac6d;
|
||||
font-family: Arial;
|
||||
font-size: 100%;
|
||||
}
|
|
@ -1,671 +0,0 @@
|
|||
/**
|
||||
* @package HTML Chess
|
||||
* http://htmlchess.sourceforge.net/
|
||||
* Pieces types in this function are so defined: 0 = pawn, 1 = king, 2 = knight, 3 = bishop, 4 = rook, 5 = queen.
|
||||
* Colors are: zero for white, one for black.
|
||||
*/
|
||||
var oCnf = this, fDegRad = Math.PI / 180,
|
||||
oSelectorCanvas = document.createElement("canvas"),
|
||||
oValidCanvas = document.createElement("canvas"),
|
||||
oInCheckCanvas = document.createElement("canvas"),
|
||||
oScene = new Canvas3D.Scene(this.oSolidVwArea, this.i3DWidth, this.i3DHeight, true),
|
||||
oCam = new Canvas3D.Camera(),
|
||||
iSelectorY = 0, iSelectorX = 0, bPieceSelected, oSelectedPiece = null, bPiecesHidden = false, bSelectorAct = true,
|
||||
aMouseRegions, iLastMouseRegionX = -1, iLastMouseRegionY = -1,
|
||||
bIsRotating = false, iMouseDownX = 0, iMouseDownY = 0, bMouseIsDown = false, bUnhideOrdered = false,
|
||||
aPieces = [], aPiecesCasing = [[],[],[],[],[],[]], aRots = [0,0,-90,90,0,180,0,180,0,0,0,0],
|
||||
oLight1 = new Canvas3D.Light(), oLight2 = new Canvas3D.Light(), oLight3 = new Canvas3D.Light(),
|
||||
oBoardMesh = createMesh(this.tmp3DBoard);
|
||||
|
||||
delete this.tmp3DBoard;
|
||||
oBoardMesh.setForcedZ(64);
|
||||
oScene.addObject(oBoardMesh);
|
||||
|
||||
function getElementPos(oElement) {
|
||||
var nElPosX = -(document.body.scrollLeft+document.documentElement.scrollLeft), nElPosY = -(document.body.scrollTop+document.documentElement.scrollTop);
|
||||
while (oElement && oElement.nodeName != "BODY") {
|
||||
nElPosX += oElement.offsetLeft;
|
||||
nElPosY += oElement.offsetTop;
|
||||
oElement = oElement.offsetParent;
|
||||
}
|
||||
return {xAxis: nElPosX, yAxis: nElPosY};
|
||||
}
|
||||
|
||||
// stand by selector
|
||||
function selectorListener(oMsEvnt1) {
|
||||
if (!oMsEvnt1) { oMsEvnt1 = window.event; }
|
||||
var oPos = getElementPos(oScene.getInputLayer()), oRegion = checkMouseRegions(oMsEvnt1.clientX - oPos.xAxis, oMsEvnt1.clientY - oPos.yAxis);
|
||||
if (oRegion) {
|
||||
showSelector();
|
||||
showValidMoves();
|
||||
showInCheckPieces();
|
||||
bSelectorAct = true;
|
||||
Canvas3D.removeEvent(oScene.getInputLayer(), "mousemove", selectorListener);
|
||||
}
|
||||
}
|
||||
|
||||
function standbySelector() {
|
||||
if (bSelectorAct) {
|
||||
hideSelector();
|
||||
hideValidMoves();
|
||||
hideInCheckPieces();
|
||||
bSelectorAct = false;
|
||||
Canvas3D.addEvent(oScene.getInputLayer(), "mousemove", selectorListener);
|
||||
}
|
||||
}
|
||||
// end
|
||||
|
||||
function moveZoom(bZoomIn) {
|
||||
if (oCam = oScene.getActiveCamera()) {
|
||||
var oTarget = oCam.getLookAt(), fDist = oTarget.dist(oCam.getPosition());
|
||||
standbySelector();
|
||||
hidePieces();
|
||||
oCam.moveForward(bZoomIn ? (fDist - 50 < 40 ? fDist - 40 : 50) : -50);
|
||||
updateMouseRegions();
|
||||
updateSelector();
|
||||
updateValidMoves();
|
||||
updateInCheckPieces();
|
||||
showPieces();
|
||||
}
|
||||
}
|
||||
|
||||
// setup polygons for board squares, used to check which piece mouse is hovering over
|
||||
function updateMouseRegions() {
|
||||
//var oCam = oScene.getActiveCamera();
|
||||
|
||||
var iPosX, iPosY, iPosZ, oP1, oP2, oP3, oP4, iOffsetX = oCnf.i3DWidth >> 1, iOffsetY = oCnf.i3DHeight >> 1, aPaths = [];
|
||||
for (var nRegX = 0; nRegX < 8; nRegX++) {
|
||||
aPaths[nRegX] = [];
|
||||
for (var nRegY = 0; nRegY < 8; nRegY++) {
|
||||
iPosX = -(nRegX - 3) * 10;
|
||||
iPosY = 0;
|
||||
iPosZ = (nRegY - 4) * 10;
|
||||
|
||||
oP1 = oCam.project(oCam.transformPoint(new Canvas3D.Vec3(iPosX, iPosY, iPosZ)));
|
||||
oP2 = oCam.project(oCam.transformPoint(new Canvas3D.Vec3(iPosX + 10, iPosY, iPosZ)));
|
||||
oP3 = oCam.project(oCam.transformPoint(new Canvas3D.Vec3(iPosX + 10, iPosY, iPosZ + 10)));
|
||||
oP4 = oCam.project(oCam.transformPoint(new Canvas3D.Vec3(iPosX, iPosY, iPosZ + 10)));
|
||||
|
||||
aPaths[nRegX][nRegY] = [
|
||||
[oP1.x + iOffsetX, oP1.y + iOffsetY],
|
||||
[oP2.x + iOffsetX, oP2.y + iOffsetY],
|
||||
[oP3.x + iOffsetX, oP3.y + iOffsetY],
|
||||
[oP4.x + iOffsetX, oP4.y + iOffsetY]
|
||||
];
|
||||
}
|
||||
}
|
||||
aMouseRegions = aPaths;
|
||||
}
|
||||
|
||||
function checkMouseRegions(iMouseX, iMouseY) {
|
||||
var bIsLast = false, bFound = false, iRegionY = -1, iRegionX = -1, oCtx = oSelectorCanvas.getContext("2d");
|
||||
|
||||
if (iLastMouseRegionX > -1 && iLastMouseRegionY > -1 && checkSingleMouseRegion(oCtx, aMouseRegions[iLastMouseRegionX][iLastMouseRegionY], iMouseX, iMouseY)) { bIsLast = true; }
|
||||
if (!bIsLast) {
|
||||
for (var iCheckY = 0; iCheckY < 8 && !bFound; iCheckY++) {
|
||||
for (var iCheckX = 0; iCheckX < 8 && !bFound; iCheckX++) {
|
||||
if (checkSingleMouseRegion(oCtx, aMouseRegions[iCheckY][iCheckX], iMouseX, iMouseY)) {
|
||||
iRegionY = iCheckY;
|
||||
iRegionX = iCheckX;
|
||||
bFound = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return(iRegionY > -1 && iRegionX > -1 ? {regX: iRegionX, regY: iRegionY} : false);
|
||||
}
|
||||
|
||||
function checkSingleMouseRegion(oCtx, aRegion, nX, nY) {
|
||||
oCtx.beginPath();
|
||||
oCtx.moveTo(aRegion[0][0], aRegion[0][1]);
|
||||
oCtx.lineTo(aRegion[1][0], aRegion[1][1]);
|
||||
oCtx.lineTo(aRegion[2][0], aRegion[2][1]);
|
||||
oCtx.lineTo(aRegion[3][0], aRegion[3][1]);
|
||||
oCtx.closePath();
|
||||
return(oCtx.isPointInPath(nX, nY));
|
||||
}
|
||||
|
||||
function moveSelector(iDeltaX, iDeltaY) {
|
||||
var fAngle = Math.atan2(oCam.getPosition().x,oCam.getPosition().z) / fDegRad;
|
||||
// four scenarios for how to move the selector, depending on camera angle
|
||||
if (fAngle >= 135 || fAngle <= -135) {
|
||||
iSelectorX = iSelectorX + iDeltaX & 7;
|
||||
iSelectorY = iSelectorY + iDeltaY & 7;
|
||||
} else if (fAngle >= -45 && fAngle <= 45) {
|
||||
iSelectorX = iSelectorX - iDeltaX & 7;
|
||||
iSelectorY = iSelectorY - iDeltaY & 7;
|
||||
} else if (fAngle >= -135 && fAngle <= -45) {
|
||||
iSelectorY = iSelectorY - iDeltaX & 7;
|
||||
iSelectorX = iSelectorX + iDeltaY & 7;
|
||||
} else if (fAngle >= 45 && fAngle <= 135) {
|
||||
iSelectorY = iSelectorY + iDeltaX & 7;
|
||||
iSelectorX = iSelectorX - iDeltaY & 7;
|
||||
}
|
||||
updateSelector();
|
||||
}
|
||||
|
||||
function hideSelector() { oSelectorCanvas.style.display = "none"; }
|
||||
function showSelector() { oSelectorCanvas.style.display = "block"; }
|
||||
function hideValidMoves() { oValidCanvas.style.display = "none"; }
|
||||
function showValidMoves() { oValidCanvas.style.display = "block"; }
|
||||
function hideInCheckPieces() { oInCheckCanvas.style.display = "none"; }
|
||||
function showInCheckPieces() { oInCheckCanvas.style.display = "block"; }
|
||||
|
||||
function hidePieces() {
|
||||
if (!bPiecesHidden) {
|
||||
for (var iHide = 0; iHide < aPieces.length; iHide++) { aPieces[iHide].mesh.hide(); }
|
||||
bPiecesHidden = true;
|
||||
}
|
||||
}
|
||||
|
||||
function showPieces() {
|
||||
if (bPiecesHidden) {
|
||||
for (var iShow = 0; iShow < aPieces.length; iShow++) { aPieces[iShow].mesh.show(); }
|
||||
bPiecesHidden = false;
|
||||
}
|
||||
}
|
||||
|
||||
function updateSelector() {
|
||||
var iOffsetX = oCnf.i3DWidth >> 1, iOffsetY = oCnf.i3DHeight >> 1, oCtx = oSelectorCanvas.getContext("2d");
|
||||
|
||||
oCtx.clearRect(0,0,oCnf.i3DWidth,oCnf.i3DHeight);
|
||||
|
||||
// draw active selector square
|
||||
makeRegionPath(oCtx, iSelectorX, iSelectorY);
|
||||
oCtx.fillStyle = "rgba(255,255,0,0.5)";
|
||||
oCtx.fill();
|
||||
|
||||
if (bPieceSelected) {
|
||||
// draw border around selected square
|
||||
makeRegionPath(oCtx, oSelectedPiece.posX, oSelectedPiece.posY);
|
||||
oCtx.lineWidth = 2;
|
||||
oCtx.strokeStyle = "rgba(255,0,0,1)";
|
||||
oCtx.stroke();
|
||||
}
|
||||
}
|
||||
|
||||
function makeRegionPath(oCtx, nMakeX, nMakeY) {
|
||||
var aRegion = aMouseRegions[nMakeY][nMakeX];
|
||||
oCtx.beginPath();
|
||||
oCtx.moveTo(aRegion[0][0], aRegion[0][1]);
|
||||
oCtx.lineTo(aRegion[1][0], aRegion[1][1]);
|
||||
oCtx.lineTo(aRegion[2][0], aRegion[2][1]);
|
||||
oCtx.lineTo(aRegion[3][0], aRegion[3][1]);
|
||||
oCtx.closePath();
|
||||
}
|
||||
|
||||
function updateValidMoves() {
|
||||
var oCtx = oValidCanvas.getContext("2d");
|
||||
oCtx.clearRect(0, 0, oCnf.i3DWidth, oCnf.i3DHeight);
|
||||
oCtx.fillStyle = "rgba(0,255,0,0.2)";
|
||||
|
||||
if (!oSelectedPiece) { return; }
|
||||
|
||||
for (var iValidY = 0; iValidY < 8; iValidY++) {
|
||||
for (var iValidX = 0; iValidX < 8; iValidX++) {
|
||||
if (oCnf.isValidMove(oSelectedPiece.posX, oSelectedPiece.posY, iValidX, iValidY)) {
|
||||
makeRegionPath(oCtx, iValidX, iValidY);
|
||||
oCtx.fill();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function updateInCheckPieces() {
|
||||
var oInCheck = oInCheckCanvas.getContext("2d");
|
||||
oInCheck.clearRect(0,0,oCnf.i3DWidth,oCnf.i3DHeight);
|
||||
oInCheck.fillStyle = "rgba(0,0,255,0.2)";
|
||||
for (var iSquare = 0; iSquare < oCnf.aThreats.length; iSquare++) {
|
||||
iThrtndSq = oCnf.aThreats[iSquare]
|
||||
makeRegionPath(oInCheck, iThrtndSq % 10 - 1, (iThrtndSq - iThrtndSq % 10) / 10 - 2);
|
||||
oInCheck.fill();
|
||||
}
|
||||
}
|
||||
|
||||
// removes a piece from the board
|
||||
function removePiece(oPiece) {
|
||||
var iPiece;
|
||||
for (var iPieceId = 0; iPieceId < aPieces.length; iPieceId++) {
|
||||
iPiece = aPieces[iPieceId];
|
||||
if (iPiece === oPiece) { Array.prototype.push.apply(aPiecesCasing[iPiece.type], aPieces.splice(iPieceId, 1)); }
|
||||
}
|
||||
oScene.removeObject(oPiece.mesh);
|
||||
}
|
||||
|
||||
function pieceByCoords(nHasX, nHasY) {
|
||||
for (var iId = 0; iId < aPieces.length; iId++) {
|
||||
if (aPieces[iId].posY === nHasY && aPieces[iId].posX === nHasX) { return(aPieces[iId]); }
|
||||
}
|
||||
}
|
||||
|
||||
function movePieceTo(oPiece, nToX, nToY) {
|
||||
var oPos = getBoardPos(nToX, nToY);
|
||||
oPiece.mesh.setPosition(new Canvas3D.Vec3(oPos.posY, 0, oPos.posX));
|
||||
oPiece.posX = nToX;
|
||||
oPiece.posY = nToY;
|
||||
}
|
||||
|
||||
function getBoardPos(posX, posY) { return {posX: posX * 10 - 35, posY: 35 - posY * 10}; }
|
||||
|
||||
function clearPieceSelection() {
|
||||
oSelectedPiece = null;
|
||||
bPieceSelected = false;
|
||||
updateSelector();
|
||||
updateValidMoves();
|
||||
}
|
||||
|
||||
function snapClick(oMsEvnt2) {
|
||||
if (!oMsEvnt2) { oMsEvnt2 = window.event; }
|
||||
iMouseDownX = oMsEvnt2.clientX;
|
||||
iMouseDownY = oMsEvnt2.clientY;
|
||||
bMouseIsDown = true;
|
||||
}
|
||||
|
||||
function snapDOMScroll(oMsEvnt3) {
|
||||
if (!oMsEvnt3) { oMsEvnt3 = window.event; }
|
||||
if (!oMsEvnt3.shiftKey) { return; }
|
||||
if (oMsEvnt3.detail) { oMsEvnt3.wheelDelta = oMsEvnt3.detail * -40; }
|
||||
|
||||
hidePieces();
|
||||
hideSelector();
|
||||
hideValidMoves();
|
||||
oCam.setScale(oMsEvnt3.wheelDelta > 0 ? oCam.getScale() * 1.5 : oCam.getScale() / 1.5)
|
||||
|
||||
if (!bUnhideOrdered) {
|
||||
setTimeout( function() {
|
||||
showPieces();
|
||||
|
||||
bIsRotating = false;
|
||||
oScene.setDirty(true);
|
||||
|
||||
updateMouseRegions();
|
||||
updateSelector();
|
||||
updateValidMoves();
|
||||
|
||||
showSelector();
|
||||
showValidMoves();
|
||||
bUnhideOrdered = false;
|
||||
}, 100);
|
||||
bUnhideOrdered = true;
|
||||
}
|
||||
|
||||
if (oMsEvnt3.preventDefault) { oMsEvnt3.preventDefault(); } else { oMsEvnt3.returnValue = false; }
|
||||
}
|
||||
|
||||
function snapMsBtnUp(oMsEvnt4) {
|
||||
if (!oMsEvnt4) { oMsEvnt4 = window.event; }
|
||||
bMouseIsDown = false;
|
||||
|
||||
if (bIsRotating) {
|
||||
showPieces();
|
||||
|
||||
bIsRotating = false;
|
||||
oScene.setDirty(true);
|
||||
|
||||
updateMouseRegions();
|
||||
updateSelector();
|
||||
updateValidMoves();
|
||||
updateInCheckPieces();
|
||||
|
||||
setTimeout(function() { showSelector(); showValidMoves(); showInCheckPieces(); }, 10);
|
||||
} else {
|
||||
var oPos = getElementPos(oScene.getInputLayer());
|
||||
iMouseDownX = oMsEvnt4.clientX - oPos.xAxis;
|
||||
iMouseDownY = oMsEvnt4.clientY - oPos.yAxis;
|
||||
var oRegion = checkMouseRegions(oMsEvnt4.clientX - oPos.xAxis, oMsEvnt4.clientY - oPos.yAxis);
|
||||
if (oRegion) { oCnf.makeSelection(iSelectorY * 10 + iSelectorX + 21, true); }
|
||||
}
|
||||
}
|
||||
|
||||
function snapMsMove(oMsEvnt5) {
|
||||
if (!oMsEvnt5) { oMsEvnt5 = window.event; }
|
||||
if (bMouseIsDown) {
|
||||
hidePieces();
|
||||
hideSelector();
|
||||
hideValidMoves();
|
||||
hideInCheckPieces();
|
||||
|
||||
bIsRotating = true;
|
||||
|
||||
var iMouseX = oMsEvnt5.clientX, iMouseY = oMsEvnt5.clientY, fDeltaX = (iMouseX - iMouseDownX) / 3, fDeltaY = -((iMouseY - iMouseDownY) / 3),
|
||||
// save the old camera position
|
||||
oOldCamPos = new Canvas3D.Vec3(oCam.getPosition().x, oCam.getPosition().y, oCam.getPosition().z);
|
||||
|
||||
// pitch the camera, but if we're not too low or if we're moving the camera up
|
||||
oCam.pitchAroundTarget(fDeltaY);
|
||||
if (!((oCam.getPosition().y > 15 || fDeltaY < 0) && (oCam.getPosition().y < 100 || fDeltaY > 0))) { oCam.setPosition(oOldCamPos); }
|
||||
|
||||
oCam.yawAroundTarget(fDeltaX);
|
||||
oCam.lookAt(oCam.getLookAt(), oScene.getUpVector());
|
||||
oCam.updateRotationMatrix();
|
||||
iMouseDownX = oMsEvnt5.clientX;
|
||||
iMouseDownY = oMsEvnt5.clientY;
|
||||
|
||||
} else {
|
||||
var oPos = getElementPos(oScene.getInputLayer()), oRegion = checkMouseRegions(oMsEvnt5.clientX - oPos.xAxis, oMsEvnt5.clientY - oPos.yAxis);
|
||||
if (oRegion) {
|
||||
var bNewRegion = false;
|
||||
if (iSelectorY !== oRegion.regY || iSelectorX !== oRegion.regX) { bNewRegion = true; }
|
||||
|
||||
iSelectorX = oRegion.regX;
|
||||
iSelectorY = oRegion.regY;
|
||||
|
||||
if (bNewRegion) { updateSelector(); }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function snapKeyDown(oKeyEvnt2) {
|
||||
if (!oCnf.bKeyCtrl) { return; }
|
||||
if (!oKeyEvnt2) { oKeyEvnt2 = window.event; }
|
||||
var iKeyCode = oKeyEvnt2.keyCode;
|
||||
if (iKeyCode === 107) { moveZoom(true); } // "+"
|
||||
else if (iKeyCode === 109) { moveZoom(false); } // "-"
|
||||
}
|
||||
|
||||
|
||||
function snapKeyPress(oKeyEvnt3) {
|
||||
if (!oCnf.bKeyCtrl) { return; }
|
||||
if (!oKeyEvnt3) { oKeyEvnt3 = window.event; }
|
||||
var iKeyCode = oKeyEvnt3.charCode;
|
||||
switch (iKeyCode) {
|
||||
case 49: moveSelector(-1,1); break; // numpad 1
|
||||
case 50: moveSelector(-1,0); break; // numpad 2
|
||||
case 51: moveSelector(-1,-1); break; // numpad 3
|
||||
case 52: moveSelector(0,1); break; // numpad 4
|
||||
case 53: oCnf.makeSelection(iSelectorY * 10 + iSelectorX + 21, true); break; // numpad 5
|
||||
case 54: moveSelector(0,-1); break; // numpad 6
|
||||
case 55: moveSelector(1,1); break; // numpad 7
|
||||
case 56: moveSelector(1,0); break; // numpad 8
|
||||
case 57: moveSelector(1,-1); break; // numpad 9
|
||||
}
|
||||
}
|
||||
|
||||
function createMesh(oMeshData) {
|
||||
var oMesh = new Canvas3D.Mesh();
|
||||
oMesh._bShading = true;
|
||||
oMesh._bWire = false;
|
||||
oMesh._bFill = true;
|
||||
oMesh._bZSort = true;
|
||||
oMesh._bBackfaceCull = true;
|
||||
oMesh._bTexture = false;
|
||||
oMesh._bTextureShading = false;
|
||||
oMesh.setMeshData(oMeshData, oScene);
|
||||
return(oMesh);
|
||||
}
|
||||
|
||||
function setPieceColor(oPieceMesh, nColor) {
|
||||
for (var iMat = 0; iMat < oPieceMesh._aMaterials.length; iMat++) {
|
||||
if (nColor === 0) {
|
||||
oPieceMesh._aMaterials[iMat].r = 220;
|
||||
oPieceMesh._aMaterials[iMat].g = 220;
|
||||
oPieceMesh._aMaterials[iMat].b = 220;
|
||||
} else {
|
||||
oPieceMesh._aMaterials[iMat].r = 100;
|
||||
oPieceMesh._aMaterials[iMat].g = 80;
|
||||
oPieceMesh._aMaterials[iMat].b = 80;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getPiece(nType, flagColor, nPutX, nPutY) {
|
||||
var oNewPiece, nRot = aRots[flagColor | nType << 1], oPos = getBoardPos(nPutX, nPutY);
|
||||
if (aPiecesCasing[nType].length > 0) {
|
||||
oNewPiece = aPiecesCasing[nType].pop();
|
||||
if (oNewPiece.color !== flagColor) {
|
||||
setPieceColor(oNewPiece.mesh, flagColor);
|
||||
oNewPiece.color = flagColor;
|
||||
}
|
||||
oNewPiece.posX = nPutX;
|
||||
oNewPiece.posY = nPutY;
|
||||
} else {
|
||||
var oNewMesh = createMesh(new oCnf.aPiecesLab[nType]());
|
||||
setPieceColor(oNewMesh, flagColor);
|
||||
oNewPiece = {
|
||||
mesh: oNewMesh,
|
||||
color: flagColor,
|
||||
type: nType,
|
||||
posX: nPutX,
|
||||
posY: nPutY,
|
||||
};
|
||||
}
|
||||
if (nRot !== 0) { oNewPiece.mesh.setRotation(new Canvas3D.Vec3(0, nRot * fDegRad, 0)); }
|
||||
oNewPiece.mesh.setPosition(new Canvas3D.Vec3(oPos.posY, 0, oPos.posX));
|
||||
aPieces.push(oNewPiece);
|
||||
oScene.addObject(oNewPiece.mesh);
|
||||
return(oNewPiece);
|
||||
}
|
||||
|
||||
function setupGame() {
|
||||
var iTypeORColor;
|
||||
for (var iPieceY = 0; iPieceY < 8; iPieceY++) {
|
||||
for (var iPieceX = 0; iPieceX < 8; iPieceX++) {
|
||||
iTypeORColor = oCnf.aBoard[iPieceY * 10 + iPieceX + 21];
|
||||
if (iTypeORColor > 0) {
|
||||
getPiece(iTypeORColor - 1 & 7, iTypeORColor >> 3 & 1, iPieceX, iPieceY);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function resetCamera() {
|
||||
var nSize = oCnf.i3DWidth < oCnf.i3DHeight ? oCnf.i3DWidth : oCnf.i3DHeight; // min 200, max 900
|
||||
oCam.setPosition(new Canvas3D.Vec3(oCnf.bBlackSide ? -50 : 50, nSize > 900 ? 45 : Math.round((nSize * (nSize * 67 - 118700) + 56340000) / 84000), 0));
|
||||
oCam.lookAt(new Canvas3D.Vec3(0,0,0), oScene.getUpVector());
|
||||
oCam.updateRotationMatrix();
|
||||
}
|
||||
|
||||
function updateCamera() {
|
||||
hidePieces();
|
||||
standbySelector();
|
||||
resetCamera();
|
||||
updateMouseRegions();
|
||||
updateSelector();
|
||||
updateValidMoves();
|
||||
updateInCheckPieces();
|
||||
showPieces();
|
||||
}
|
||||
|
||||
this.oSolidVwArea.style.width = this.i3DWidth + "px";
|
||||
this.oSolidVwArea.style.height = this.i3DHeight + "px";
|
||||
|
||||
oInCheckCanvas.width = this.i3DWidth;
|
||||
oInCheckCanvas.height = this.i3DHeight;
|
||||
oInCheckCanvas.style.width = this.i3DWidth + "px";
|
||||
oInCheckCanvas.style.height = this.i3DHeight + "px";
|
||||
oInCheckCanvas.style.zIndex = 65;
|
||||
oInCheckCanvas.style.position = "absolute";
|
||||
|
||||
oValidCanvas.width = this.i3DWidth;
|
||||
oValidCanvas.height = this.i3DHeight;
|
||||
oValidCanvas.style.width = this.i3DWidth + "px";
|
||||
oValidCanvas.style.height = this.i3DHeight + "px";
|
||||
oValidCanvas.style.zIndex = 66;
|
||||
oValidCanvas.style.position = "absolute";
|
||||
|
||||
oSelectorCanvas.width = this.i3DWidth;
|
||||
oSelectorCanvas.height = this.i3DHeight;
|
||||
oSelectorCanvas.style.width = this.i3DWidth + "px";
|
||||
oSelectorCanvas.style.height = this.i3DHeight + "px";
|
||||
oSelectorCanvas.style.zIndex = 67;
|
||||
oSelectorCanvas.style.position = "absolute";
|
||||
|
||||
oLight1.setPosition(new Canvas3D.Vec3(0,30,0));
|
||||
oLight1.setIntensity(0.8);
|
||||
oScene.addLight(oLight1);
|
||||
|
||||
oLight2.setPosition(new Canvas3D.Vec3(100,30,100));
|
||||
oLight2.setIntensity(0.3);
|
||||
oScene.addLight(oLight2);
|
||||
|
||||
oLight3.setPosition(new Canvas3D.Vec3(-100,30,-100));
|
||||
oLight3.setIntensity(0.3);
|
||||
oScene.addLight(oLight3);
|
||||
|
||||
setupGame();
|
||||
|
||||
oCam.setScale(18);
|
||||
oCam.setFOV(110);
|
||||
oCam.setFocalDistance(50);
|
||||
|
||||
oCam.setReverseX(true);
|
||||
|
||||
resetCamera();
|
||||
|
||||
oScene.setActiveCamera(oCam);
|
||||
|
||||
//oScene.setUpVector(new Canvas3D.Vec3(0,-1,0));
|
||||
|
||||
this.oSolidVwArea.appendChild(oSelectorCanvas);
|
||||
this.oSolidVwArea.appendChild(oValidCanvas);
|
||||
this.oSolidVwArea.appendChild(oInCheckCanvas);
|
||||
|
||||
Canvas3D.addEvent(oScene.getInputLayer(), "mousedown", snapClick);
|
||||
Canvas3D.addEvent(document.body, "DOMMouseScroll", snapDOMScroll);
|
||||
Canvas3D.addEvent(document.body, "mouseup", snapMsBtnUp);
|
||||
Canvas3D.addEvent(document.body, "mousemove", snapMsMove);
|
||||
Canvas3D.addEvent(document, "keypress", snapKeyPress);
|
||||
Canvas3D.addEvent(document, "keydown", snapKeyDown);
|
||||
oScene.begin();
|
||||
updateMouseRegions();
|
||||
updateInCheckPieces();
|
||||
this.bSolidView = true;
|
||||
|
||||
return {
|
||||
show: function() {
|
||||
oCnf.oSolidVwArea.appendChild(oScene._oDrawCanvas);
|
||||
oCnf.oSolidVwArea.appendChild(oScene._oInputOverlay);
|
||||
oCnf.oSolidVwArea.appendChild(oSelectorCanvas);
|
||||
oCnf.oSolidVwArea.appendChild(oValidCanvas);
|
||||
oCnf.oSolidVwArea.appendChild(oInCheckCanvas);
|
||||
oScene.addObject(oBoardMesh);
|
||||
setupGame();
|
||||
Canvas3D.addEvent(oScene.getInputLayer(), "mousedown", snapClick);
|
||||
Canvas3D.addEvent(document.body, "DOMMouseScroll", snapDOMScroll);
|
||||
Canvas3D.addEvent(document.body, "mouseup", snapMsBtnUp);
|
||||
Canvas3D.addEvent(document.body, "mousemove", snapMsMove);
|
||||
Canvas3D.addEvent(document, "keypress", snapKeyPress);
|
||||
Canvas3D.addEvent(document, "keydown", snapKeyDown);
|
||||
updateCamera();
|
||||
oScene.begin();
|
||||
oCnf.bSolidView = true;
|
||||
},
|
||||
hide: function() {
|
||||
Canvas3D.removeEvent(oScene.getInputLayer(), "mousedown", snapClick);
|
||||
Canvas3D.removeEvent(document.body, "DOMMouseScroll", snapDOMScroll);
|
||||
Canvas3D.removeEvent(document.body, "mouseup", snapMsBtnUp);
|
||||
Canvas3D.removeEvent(document.body, "mousemove", snapMsMove);
|
||||
Canvas3D.removeEvent(document, "keypress", snapKeyPress);
|
||||
Canvas3D.removeEvent(document, "keydown", snapKeyDown);
|
||||
oScene.end();
|
||||
oCnf.oSolidVwArea.removeChild(oInCheckCanvas);
|
||||
oCnf.oSolidVwArea.removeChild(oValidCanvas);
|
||||
oCnf.oSolidVwArea.removeChild(oSelectorCanvas);
|
||||
oScene.removeAllObjects();
|
||||
for (var iStop = aPieces.length; iStop > 0; iStop--) {
|
||||
oPiece = aPieces[iStop - 1];
|
||||
aPiecesCasing[oPiece.type].push(aPieces.pop());
|
||||
}
|
||||
oCnf.oSolidVwArea.removeChild(oScene._oInputOverlay);
|
||||
oCnf.oSolidVwArea.removeChild(oScene._oDrawCanvas);
|
||||
oCnf.oSolidVwArea.style.width = "0";
|
||||
oCnf.bSolidView = false;
|
||||
},
|
||||
update: function(bUpdateCamera) {
|
||||
clearPieceSelection();
|
||||
for (var iCase = aPieces.length; iCase > 0; iCase--) {
|
||||
oPiece = aPieces[iCase - 1];
|
||||
aPiecesCasing[oPiece.type].push(aPieces.pop());
|
||||
oScene.removeObject(oPiece.mesh);
|
||||
}
|
||||
setupGame();
|
||||
if (bUpdateCamera) { updateCamera(); }
|
||||
else {
|
||||
updateValidMoves();
|
||||
updateInCheckPieces();
|
||||
}
|
||||
},
|
||||
selectPiece: function(nSquareId, bUnselect, bEmph) {
|
||||
iSelectorX = nSquareId % 10 - 1;
|
||||
iSelectorY = (nSquareId - nSquareId % 10) / 10 - 2;
|
||||
|
||||
if (bUnselect) {
|
||||
for (var iSel = 0; iSel < aPieces.length; iSel++) {
|
||||
if (aPieces[iSel].posY === iSelectorY && aPieces[iSel].posX === iSelectorX) {
|
||||
oPiece = aPieces[iSel];
|
||||
oSelectedPiece = aPieces[iSel];
|
||||
bPieceSelected = true;
|
||||
}
|
||||
}
|
||||
if (bEmph) {
|
||||
updateSelector();
|
||||
updateValidMoves();
|
||||
} else {
|
||||
standbySelector();
|
||||
var oSCtx = oSelectorCanvas.getContext("2d"), oVCtx = oValidCanvas.getContext("2d");
|
||||
oSCtx.clearRect(0,0,oCnf.i3DWidth,oCnf.i3DHeight);
|
||||
oVCtx.clearRect(0,0,oCnf.i3DWidth,oCnf.i3DHeight);
|
||||
}
|
||||
} else {
|
||||
clearPieceSelection();
|
||||
updateInCheckPieces();
|
||||
}
|
||||
},
|
||||
updateSize: function() {
|
||||
oCnf.oSolidVwArea.style.width = oCnf.i3DWidth + "px";
|
||||
oCnf.oSolidVwArea.style.height = oCnf.i3DHeight + "px";
|
||||
|
||||
oSelectorCanvas.width = oCnf.i3DWidth;
|
||||
oSelectorCanvas.height = oCnf.i3DHeight;
|
||||
oSelectorCanvas.style.width = oCnf.i3DWidth + "px";
|
||||
oSelectorCanvas.style.height = oCnf.i3DHeight + "px";
|
||||
|
||||
oValidCanvas.width = oCnf.i3DWidth;
|
||||
oValidCanvas.height = oCnf.i3DHeight;
|
||||
oValidCanvas.style.width = oCnf.i3DWidth + "px";
|
||||
oValidCanvas.style.height = oCnf.i3DHeight + "px";
|
||||
|
||||
oInCheckCanvas.width = oCnf.i3DWidth;
|
||||
oInCheckCanvas.height = oCnf.i3DHeight;
|
||||
oInCheckCanvas.style.width = oCnf.i3DWidth + "px";
|
||||
oInCheckCanvas.style.height = oCnf.i3DHeight + "px";
|
||||
|
||||
oScene.setDimensions(oCnf.i3DWidth, oCnf.i3DHeight);
|
||||
|
||||
updateCamera();
|
||||
},
|
||||
move: function(bBackward, nStartPt, nEndPt, nTarget, nPromoPiece) {
|
||||
var nStartX = nStartPt % 10 - 1, nStartY = (nStartPt - nStartPt % 10) / 10 - 2, nEndX = nEndPt % 10 - 1, nEndY = (nEndPt - nEndPt % 10) / 10 - 2;
|
||||
if (bBackward) {
|
||||
var oSelPiece = pieceByCoords(nEndX, nEndY);
|
||||
if (nTarget) { getPiece(nTarget - 1 & 7, nTarget >> 3 & 1, nEndX, nEndY); }
|
||||
else if (oSelPiece.type === 0 && (nStartPt + nEndPt & 1)) { // en passant
|
||||
getPiece(0, oSelPiece.color ^ 1, nEndX, nStartY);
|
||||
} else if (oSelPiece.type === 1 && (nEndPt - nStartPt + 2 | 4) === 4) { // castling
|
||||
var chosenRook = pieceByCoords(nEndPt - nStartPt + 8 >> 1, nEndY);
|
||||
movePieceTo(chosenRook, 30 - nEndPt + nStartPt >> 2 & 7, nEndY);
|
||||
chosenRook.posX = 30 - nEndPt + nStartPt >> 2 & 7;
|
||||
}
|
||||
if (nPromoPiece) {
|
||||
removePiece(oSelPiece);
|
||||
getPiece(0, nEndY >> 2 ^ 1, nStartX, nStartY);
|
||||
} else { movePieceTo(oSelPiece, nStartX, nStartY); }
|
||||
} else {
|
||||
var oSelPiece = pieceByCoords(nStartX, nStartY);
|
||||
if (nTarget) { removePiece(pieceByCoords(nEndX, nEndY)); }
|
||||
else if (oSelPiece.type === 0 && (nStartPt + nEndPt & 1)) { // en passant
|
||||
removePiece(pieceByCoords(nEndX, nStartY));
|
||||
} else if (oSelPiece.type === 1 && (nEndPt - nStartPt + 2 | 4) === 4) { // castling
|
||||
var chosenRook = pieceByCoords(30 - nEndPt + nStartPt >> 2 & 7, nEndY);
|
||||
movePieceTo(chosenRook, nEndPt - nStartPt + 8 >> 1, nEndY);
|
||||
chosenRook.posX = nEndPt - nStartPt + 8 >> 1;
|
||||
}
|
||||
if (nPromoPiece) {
|
||||
removePiece(oSelPiece);
|
||||
oSelPiece = getPiece(nPromoPiece - 1 & 7, nEndY >> 2 ^ 1, nEndX, nEndY); }
|
||||
else { movePieceTo(oSelPiece, nEndX, nEndY); }
|
||||
}
|
||||
updateInCheckPieces();
|
||||
},
|
||||
updateView: updateCamera
|
||||
};
|
|
@ -1 +0,0 @@
|
|||
<!DOCTYPE html><html><head><meta charset='utf-8'><meta name='viewport' content="width=device-width,initial-scale=1"><title>JS13k</title><link rel='stylesheet' href='https://cdn.jsdelivr.net/gh/BinBashBanana/gstore/html5games/chromaincident/game.min.css'></head><body><canvas id='canvas'></canvas><script src='https://cdn.jsdelivr.net/gh/BinBashBanana/gstore/html5games/chromaincident/game.min.js'></script></body></html>
|
|
@ -1,115 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Connect 3</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<link href="https://fonts.googleapis.com/css?family=Roboto:300" rel="stylesheet">
|
||||
<style>
|
||||
html, body {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
body {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin: 0;
|
||||
font-size: 0;
|
||||
background-color: #303030;
|
||||
color: white;
|
||||
font-family: 'Roboto', sans-serif;
|
||||
}
|
||||
.grid {
|
||||
background-color: #424242;
|
||||
padding: 20px;
|
||||
box-shadow: 0 6px 24px rgba(0,0,0,0.3);
|
||||
border-radius: 2px;
|
||||
width: 355px;
|
||||
height: 355px;
|
||||
position: relative;
|
||||
}
|
||||
.grid::after {
|
||||
content: attr(data-score);
|
||||
font-size: 72px;
|
||||
text-align: center;
|
||||
display: block;
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
bottom: 100%;
|
||||
left: 0;
|
||||
}
|
||||
.grid > span {
|
||||
position: absolute;
|
||||
padding: 20px;
|
||||
border-radius: 2px;
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 20px;
|
||||
box-shadow: 0 0.5px 3px rgba(0,0,0,0.3);
|
||||
transition: left .2s, top .2s;
|
||||
}
|
||||
.grid > span.square {
|
||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' stroke-linejoin='round' fill='none' stroke='rgba(0,0,0,0.3)' stroke-width='1'%3E%3Cpath d='M1 1H9V9H1z'/%3E%3C/svg%3E")
|
||||
}
|
||||
.grid > span.circle {
|
||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' fill='none' stroke='rgba(0,0,0,0.3)' stroke-width='1'%3E%3Ccircle cx='5' cy='5' r='4'/%3E%3C/svg%3E")
|
||||
}
|
||||
.grid > span.triangle {
|
||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' stroke-linejoin='round' fill='none' stroke='rgba(0,0,0,0.3)' stroke-width='1'%3E%3Cpath d='M5 1.5L9 8.5H1z'/%3E%3C/svg%3E")
|
||||
}
|
||||
.grid > span.plus {
|
||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' stroke-linecap='round' fill='none' stroke='rgba(0,0,0,0.3)' stroke-width='1'%3E%3Cpath d='M5 1V9M1 5H9'/%3E%3C/svg%3E")
|
||||
}
|
||||
.grid > span.minus {
|
||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' stroke-linecap='round' fill='none' stroke='rgba(0,0,0,0.3)' stroke-width='1'%3E%3Cpath d='M2 5H8'/%3E%3C/svg%3E")
|
||||
}
|
||||
.grid > span.hexagon {
|
||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 10' stroke-linejoin='round' fill='none' stroke='rgba(0,0,0,0.3)' stroke-width='1'%3E%3Cpath d='M4 1H8L10.6 5L8 9H4L1.4 5z'/%3E%3C/svg%3E");
|
||||
background-size: 24px 20px;
|
||||
}
|
||||
.grid > span.dot {
|
||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' fill='rgba(0,0,0,0.3)'%3E%3Ccircle cx='5' cy='5' r='1'/%3E%3C/svg%3E");
|
||||
}
|
||||
.grid > span::after {
|
||||
content: '';
|
||||
pointer-events: none;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background-size: 100%;
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' stroke-linejoin='round' stroke-linecap='round' fill='none' stroke='white' stroke-width='1'%3E%3Cpath d='M1 2V1H2M9 8V9H8 M9 2V1H8M2 9H1V8'/%3E%3C/svg%3E");
|
||||
transform: scale(1.2);
|
||||
opacity: 0;
|
||||
transition: all .2s;
|
||||
}
|
||||
.grid > span.active::after {
|
||||
transform: scale(1);
|
||||
opacity: 1;
|
||||
}
|
||||
.grid > span.entering {
|
||||
padding: 0 20px;
|
||||
animation: entering .2s .2s forwards;
|
||||
}
|
||||
@keyframes entering {
|
||||
from {padding: 0 20px;}
|
||||
to {padding: 20px;}
|
||||
}
|
||||
.grid > span.exiting {
|
||||
pointer-events: none;
|
||||
animation: exiting .2s forwards;
|
||||
}
|
||||
@keyframes exiting {
|
||||
from {padding: 20px; margin-top: 0;}
|
||||
to {padding: 0 20px; margin-top: 40px;}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/BinBashBanana/gstore/html5games/connect3/connect3.js"></script>
|
||||
</body>
|
||||
</html>
|
Before Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 440 B |
Before Width: | Height: | Size: 820 B |
Before Width: | Height: | Size: 472 B |
Before Width: | Height: | Size: 854 B |
Before Width: | Height: | Size: 313 B |
Before Width: | Height: | Size: 470 B |
Before Width: | Height: | Size: 498 B |
Before Width: | Height: | Size: 526 B |
Before Width: | Height: | Size: 666 B |
Before Width: | Height: | Size: 966 B |
Before Width: | Height: | Size: 905 B |
Before Width: | Height: | Size: 207 B |
Before Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 303 B |
Before Width: | Height: | Size: 501 B |
Before Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 614 B |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 60 KiB |
Before Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 69 KiB |
Before Width: | Height: | Size: 9.7 KiB |
Before Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 56 KiB |
Before Width: | Height: | Size: 561 B |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 971 B |
Before Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 36 KiB |