JSFiddle - React, Tailwind, and code Playground

by lb18

HTML

<script src="https://cdn.rawgit.com/leonardobareno/cgi_assets/master/ej6/demos/common/webgl-utils.js"></script>
<script src="https://cdn.rawgit.com/leonardobareno/cgi_assets/master/ej6/devtools/src/debug/webgl-debug.js"></script>
<script src="https://cdn.rawgit.com/leonardobareno/cgi_assets/master/ej6/demos/google/resources/log.js"></script>
<script src="https://cdn.rawgit.com/leonardobareno/cgi_assets/master/ej6/demos/google/resources/moz/matrix4x4.js"></script>
<script src="https://cdn.rawgit.com/leonardobareno/cgi_assets/master/ej6/demos/google/resources/OESVertexArrayObject.js"></script>
<script src="https://cdn.rawgit.com/leonardobareno/cgi_assets/master/ej6/demos/google/san-angeles/angeles.js"></script>
<!--
Copyright (c) 2011 The Chromium Authors. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

   * Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
   * Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
   * Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON...

JavaScript

// San Angeles Observation OpenGL ES version example
// Copyright 2004-2005 Jetro Lauha
// Web: http://iki.fi/jetro/
// This source is free software; you can redistribute it and/or
// modify it under the terms of EITHER:
//   (1) The GNU Lesser General Public License as published by the Free
//       Software Foundation; either version 2.1 of the License, or (at
//       your option) any later version. The text of the GNU Lesser
//       General Public License is included with this source in the
//       file LICENSE-LGPL.txt.
//   (2) The BSD-style license that is included with this source in
//       the file LICENSE-BSD.txt.
//
// This source 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 files
// LICENSE-LGPL.txt and LICENSE-BSD.txt for more details.

// WebGL port by Kenneth Waters


//Son utilizados en la función ssFunc(t, p):
//m coeficiente para ángulo
//a divisor para x
//b divisor para y
//n1 flotante empleado para radicación
//n2 potencia para x
//n3 potencia para y

//0 a 5:  parámetros para theta = t
//6 a 11: parámetros para phi   = p

//res1: número de polígonos en horizontal (360 grados / res1)
//res2: número de polígonos en vertical   (360 grados / res2)
//scale: factor de escala (se aplicará por igual a los 3 ejes)
var shapeParams = [
    // m  a     b     n1      n2     n3     m     a     b     n1     n2      n3   res1 res2 scale  (org.res1,res2)
    /*[10, 1,    2,    90,      1,   -45,    8,    1,    1,    -1,     1,  -0.4 ,   20,  30, 2], // 40, 60
    [10, 1,    2,    90,      1,   -45,    4,    1,    1,    10,     1,  -0.4 ,   20,  20, 4], // 40, 40
    [10, 1,    2,    60,      1,   -10,    4,    1,    1,    -1,    -2,  -0.4 ,   41,  41, 1], // 82, 82
    [ 6, 1,    1,    60,      1,   -70,    8,    1,    1,  0.4 ,     3,  0.25 ,   20,  20, 1], // 40, 40
    [ 4, 1,    1,    30,      1,    20,   12,    1,  ...