[97编程世界冠军4K组]代码被转为ts脚本github代码如何在WIN10运行和调试

源代码地址:iGitHub - SuperSodaSea/Omniscent: Analysis and Replication of Omniscent, the 1st in the Mekka & Symposium 1997 PC 4K Intro Competition.

1、软件安装nodejs和webstorm都要安装
node-v20.12.2-x64.msi
WebStorm-2024.1.1.exe

代码:
Omniscent-main.zip

我修改了些代码,gitee地址:

r77683962/Omniscent

2、nodejs安装完成后通过npm安装pnpm、tsc、rollup,有兴趣可以搜索下这些命令的功能,进入cmd执行以下命令,(建议使用管理员模式进入cmd,不然有些安装会报没有权限):
npm config set registry https://registry.npmmirror.com/
npm i -g pnpm
pnpm i tsc
pnpm i rollup

3、在webstorm设置node.js和pnpm工具地址

File菜单->settings->Languages&Frameworks->node.js,然后使用自已安装的路径替换
node路径(这个根据自已的安装路径设置):
C:\Program Files\nodejs\node.exe

pnpm路径(这个根据自已的安装路径设置):
C:\Users\PC\AppData\Roaming\npm\pnpm.cmd


4、Omniscent-main.zip代码解压,然后使用webstorm打开解压目录(要注意被打开的目录里有src、types这些目录才对)

5、编译代码根目录package.json第25行

"build": "rollup -c"

这行前边会有一个绿色的三角形,点击这个三角形,选择Run 'build',编译日志如下

C:\Users\Administrator\AppData\Roaming\npm\pnpm.cmd run build

> omniscent@ build D:\projects\Omniscent_git
> rollup -c


src/index.ts → lib/cjs, lib/esm...
Browserslist: caniuse-lite is outdated. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly: https://github.com/browserslist/update-db#readme
created lib/cjs, lib/esm in 2.1s

demo/src/index.ts → dist...
created dist in 7s

Process finished with exit code 0
编译完成在根目录下会生成dist、lib、node_modules目录

6、打开根目录dist目录的index.html文件点击右上角的Chrome图标,点击Play,就可以看到运行的3D界面了

这个代码主要用到:three.js(3D库)

three.js在线帮助手册: https://threejs.org/docs/index.html#manual/en/introduction/Creating-a-scene

参考来源:
https://blog.csdn.net/xueli_2017/article/details/91492971

这个链接也有些有意思的例子:GitHub - gkjohnson/three-mesh-bvh: A BVH implementation to speed up raycasting and enable spatial queries against three.js meshes.o

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-04-28 23:50:03       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-04-28 23:50:03       106 阅读
  3. 在Django里面运行非项目文件

    2024-04-28 23:50:03       87 阅读
  4. Python语言-面向对象

    2024-04-28 23:50:03       96 阅读

热门阅读

  1. Linux Makefile编写之可执行程序

    2024-04-28 23:50:03       124 阅读
  2. 先出发再思考怎么解决问题

    2024-04-28 23:50:03       155 阅读
  3. IDEA那些牛X的插件

    2024-04-28 23:50:03       36 阅读
  4. 安全运营之通行字管理

    2024-04-28 23:50:03       119 阅读
  5. vue项目使用tsx

    2024-04-28 23:50:03       32 阅读
  6. C++ 模板和泛型编程详解

    2024-04-28 23:50:03       29 阅读