three模拟大脑神经元神经系统

代码语言:html

所属分类:三维

代码描述:three模拟大脑神经元神经系统

代码标签: 神经元 神经系统

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">

<style>
body {
    margin: 0;
    overscroll-behavior: none;
    overflow: hidden;
    background-color: #000011;
    color: #DDD;
    font-family: Helvetica;
}

#title {
    padding: 10px 0 10px 0;
    text-align: center;
}
</style>

</head>
<body translate="no">
<div id="title">Click to regenerate.</div>
<div id="3d-graph"></div>
<script type="text/javascript" src="http://repo.bfw.wiki/bfwrepo/js/3d-force-graph.min.js"></script>
<script type="module">
import { UnrealBloomPass } from '//unpkg.com/three/examples/jsm/postprocessing/UnrealBloomPass.js';

const deg2rad = deg => {return deg * Math.PI / 180;};
const rad2deg = rad => {return rad * 180 / Math.PI;};

const initialData = { nodes: [{ id: 0 }], links: [] };

const N = 500;
const nodes = [...Array(N).keys()].map(i => {
  return {
    id: i,
    val: Math.random() * 1.5 + 1 };

});

function generateLinks(nodes) {
  let links = [];
  nodes.forEach(node => {
    let numNodeLinks = Math.round(Math.random() * (0.75 + Math.random())) + 1;
    for (let i = 0; i < numNodeLinks; i++) {
      links.push({
        source: node.id,
        target: Math.round(Math.random() * (node.id > 0 ? node.id - 1 : node.id)) });

    }
  });
  return links;
}
const links = generateLinks(nodes);.........完整代码请登录后点击上方下载按钮下载查看

网友评论0