me
me copied to clipboard
记录和分享技术的博客
/usr/local/bin/pdf2png ```sh #!/bin/bash # 定义输出目录 output_dir="$HOME/Desktop/pdf-png" # 如果目录不存在则创建 if [ ! -d "$output_dir" ]; then mkdir -p "$output_dir" fi # 检查是否传入PDF文件 if [ -z "$1" ]; then echo "Usage: $0...
ref: [Add a 3D model with threebox | Mapbox GL JS | Mapbox](https://docs.mapbox.com/mapbox-gl-js/example/add-3d-model-threebox/) `yarn add three box-plugin` main.js ```js import mapboxgl from 'mapbox-gl'; import 'mapbox-gl/dist/mapbox-gl.css'; import { Threebox } from...
ref: [pmndrs/react-three-fiber: 🇨🇭 A React renderer for Three.js](https://github.com/pmndrs/react-three-fiber) 通过r3f可以通过tag的方式来写threejs 1. `yarn create vite`project name: hello 2. `yarn add three @react-three/fiber` 3. `yarn dev` App.jsx ```jsx import { Canvas } from...
```js import * as THREE from "three"; const scene = new THREE.Scene(); // const camera = new THREE.PerspectiveCamera(fov, aspect, near, far); // fov (视角): 相机的视角(单位: 度)。控制视野的大小,值越大视野越宽。 // aspect (纵横比): 相机的纵横比。通常是窗口的宽度除以高度。...
ref: [Getting Started | Mapbox GL JS | Mapbox](https://docs.mapbox.com/mapbox-gl-js/guides/install/) 1. `yarn create vite`, project: foo, framework选择Vanilla 2. code打开foo, 在terminal中运行yarn安装依赖,然后yarn dev运行,打开可以看到vite默认页面 3. `yarn add mapbox-gl` index.html ```html Mapbox GL JS map...
在SketchUp中建个小房子,随便拉个长方体,画个中线,然后用move来一下中线,导出glB main.js ```js import * as THREE from "three"; import { GLTFLoader } from "three/addons/loaders/GLTFLoader.js"; const scene = new THREE.Scene(); const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);...
ref: [Installation – three.js docs](https://threejs.org/docs/index.html#manual/en/introduction/Installation) 操作步骤略有不同: 1. `yarn create vite`, project: hello, framework选择Vanilla 2. code打开hello, 在terminal中运行yarn安装依赖,然后yarn dev运行,打开可以看到vite默认页面 3. `yarn add three` 4. 然后copy three.js docs中index.html代码 ```html My first three.js app...