JSFiddle - React, Tailwind, and code Playground
HTML
<canvas id="ge3d_canv" style="border:1px #eee solid" width="800" height="800"></canvas>
<!-- модель -->
<script type="text/objmodel" id="model">v -0.000581696 -0.734665 -0.623267
v 0.000283538 -1 0.286843
v -0.117277 -0.973564 0.306907
v -0.382144 -0.890788 0.221243
v -0.247144 -0.942602 0.276051
v -0.656078 -0.718512 -0.109025
v -0.609847 -0.786562 0.0198068
v -0.66248 -0.632053 -0.244271
v -0.511812 -0.845392 0.127809
v -0.609326 -0.569868 -0.41571
v -0.426949 -0.649767 -0.567143
v -0.201076 -0.720822 -0.633205
v 0.117382 -0.973645 0.306766
v 0.382454 -0.890869 0.221097
v 0.247512 -0.942667 0.275986
v 0.656371 -0.718624 -0.109224
v 0.610273 -0.786562 0.0197893
v 0.66248 -0.631463 -0.244119
v 0.511631 -0.845357 0.127832
v 0.608654 -0.568839 -0.416318
v 0.424663 -0.649937 -0.567418
v 0.198972 -0.720968 -0.633141
v 0.153371 -0.140519 0.477416
v 0.134781 -0.14723 0.48805
v 0.131261 -0.132153 0.49872
v 0.14749 -0.135105 0.489565
v 0.000686924 -0.0534984 0.505694
v 0.075062 -0.0473306 0.49955
v 0.0695841 -0.0997942 0.550277
v 0.0302569 -0.0971868 0.55389
v 0.0745124 -0.135953 0.523215
v 0.0354892 -0.12785 0.535159
v 0.0389268 -0.109557 0.550558
v 0.0734835 -0.11538 0.538029
v 0.106386 -0.125623 0.51513
v 0.107415 -0.144295 0.5047
v 0.15968 -0.130861 0.484794
v 0.156224 -0.123705 0.486735
v 0.15792 -0.107798 0.4677
v 0.163784 -0.126996 0.470144
v 0.154687 -0.134655 0.486373
v 0.160668 -0.135649 0.476189
v 0.143433 -0.119034 0.499854
v 0.131606 -0.0726738 0.476148
v -0.000260156 -0.124553 0.539058
v -0.000646004 -0.110651 0.55444
v 0.100423 -0.10574 0.537643
v 0.126128 -0.115784 0.515598
v 0.250944 -0.275583 0.380381
v 0.221602 -0.335752 0.330174
v 0.275434 -0.301318 0.24751
v 0.307699 -0.239869 0.292356
v 0.332124 -0.0415605 0.412962
v 0.319444 0.00732526 0.451091
v 0.28667 -0.025805 0.481549
v 0.297006 -0.0758717 0.454242
v 0.357953 -0.159928 -0.223225
v 0.303981 -0.144611 -0.343644
v 0.296386 -0.0547553 -0.357792
v 0.357339 -0.0633433 -0.24278
v 0.45086 0.331215...
JavaScript
/*!
* EventEmitter v4.2.8 - git.io/ee
* Oliver Caldwell
* MIT license
* @preserve
*/
(function () {
'use strict';
/**
* Class for managing events.
* Can be extended to provide event functionality in other classes.
*
* @class EventEmitter Manages event registering and emitting.
*/
function EventEmitter() {}
// Shortcuts to improve speed and size
var proto = EventEmitter.prototype;
var exports = this;
var originalGlobalValue = exports.EventEmitter;
/**
* Finds the index of the listener for the event in its storage array.
*
* @param {Function[]} listeners Array of listeners to search through.
* @param {Function} listener Method to look for.
* @return {Number} Index of the specified listener, -1 if not found
* @api private
*/
function indexOfListener(listeners, listener) {
var i = listeners.length;
while (i--) {
if (listeners[i].listener === listener) {
return i;
}
}
return -1;
}
/**
* Alias a method while keeping the context correct, to allow for overwriting of target method.
*
* @param {String} name The name of the target method.
* @return {Function} The aliased method
* @api private
*/
function alias(name) {
return function aliasClosure() {
return this[name].apply(this, arguments);
};
}
/**
* Returns the listener array for the specified event.
* Will initialise the event object and listener arrays if required.
* Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them.
* Each property in the object response is an array of listener functions.
*
* @param {String|RegExp} evt Name of the event to return the...