# rust-3d-demo
An example of how you can do 3D graphics in the browser with Rust and WebGL.
# Prerequisites
Rustup:
I'm using version 1.19.0. If you have trouble, you might want to peg your verions to that.
To check what version you have, you can type 'rustup --version' in a command line terminal.
If you need help getting this set up, I have a youtube tutorial at https://youtu.be/f6tizikEMTk
NPM:
I'm using version 6.4.1. If you have trouble, you might want to peg your version to that.
To check what version you have, you can type 'npm --v' in a command line terminal.
To get NPM and Node, go to https://www.npmjs.com/get-npm
Node:
I'm using version v10.13.0. If you have trouble, you might want to peg your version to that.
To check what version you have, you can type 'node --v' in a command line terminal.
Node will automatically be installed if you install npm.
Visual Studio Code:
To install, go to https://code.visualstudio.com/
This is the dev environment I use, but of course you can use your favorite.
If you need help getting this environment set up, I have a youtube tutorial at https://youtu.be/f6tizikEMTk
# Initialization
In your command line terminal, type...
rustup target add wasm32-unknown-unknown
- This will make sure you have wasm as a target for Rust
cargo build
- This will download all your Rust crates and make sure your Rust can build. May take a minute.
npm install
- This will download all you node packages. May take a minute.
# Running
In your command line terminal, type...
npm run dev
- NOTE: The first time you run this is may take a minute to start. After that, is should take just a few seconds.
- Live Reloading is enabled. As you make Rust code changes and press "Save", the browser will automatically reload with the new code.
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
如何使用Rust和WebGL在浏览器中制作3D图形的示例_Rust_JavaScript_下载.zip (26个子文件)
rust-3d-demo-master
Cargo.toml 539B
webpack.config.js 911B
src
programs
mod.rs 124B
color_2d.rs 3KB
graph_3d.rs 6KB
color_2d_gradient.rs 5KB
lib.rs 2KB
app_state.rs 3KB
shaders
fragment
mod.rs 52B
varying_color_from_vertex.rs 226B
color_2d.rs 220B
vertex
mod.rs 62B
color_2d.rs 162B
graph_3d.rs 829B
color_2d_gradient.rs 245B
mod.rs 33B
constants.rs 223B
gl_setup.rs 2KB
common_funcs.rs 11KB
LICENSE 1KB
package.json 386B
index.html 299B
index.js 1KB
.gitignore 58B
web.config 232B
README.md 2KB
共 26 条
- 1
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9149
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功