1
0
mirror of https://github.com/troisjs/trois.git synced 2024-11-24 04:12:02 +08:00

BufferGeometry => Geometry

This commit is contained in:
Kevin Levron 2021-03-15 22:17:15 +01:00
parent eb40499600
commit 17d5a03d8b
7 changed files with 14 additions and 14 deletions

View File

@ -3,7 +3,7 @@ import {
Mesh, Mesh,
NearestFilter, NearestFilter,
OrthographicCamera, OrthographicCamera,
PlaneBufferGeometry, PlaneGeometry,
RGBAFormat, RGBAFormat,
ShaderMaterial, ShaderMaterial,
Uniform, Uniform,
@ -181,7 +181,7 @@ LiquidEffect.prototype.swapBuffers = function () {
// from https://threejs.org/examples/js/postprocessing/EffectComposer.js // from https://threejs.org/examples/js/postprocessing/EffectComposer.js
const FullScreenQuad = (function () { const FullScreenQuad = (function () {
const camera = new OrthographicCamera(-1, 1, 1, -1, 0, 1); const camera = new OrthographicCamera(-1, 1, 1, -1, 0, 1);
const geometry = new PlaneBufferGeometry(2, 2); const geometry = new PlaneGeometry(2, 2);
const FullScreenQuad = function (material) { const FullScreenQuad = function (material) {
this._mesh = new Mesh(geometry, material); this._mesh = new Mesh(geometry, material);

View File

@ -1,4 +1,4 @@
import { DoubleSide, Mesh, MeshStandardMaterial, PlaneBufferGeometry } from 'three'; import { DoubleSide, Mesh, MeshStandardMaterial, PlaneGeometry } from 'three';
import { watch } from 'vue'; import { watch } from 'vue';
import Object3D from '../../core/Object3D.js'; import Object3D from '../../core/Object3D.js';
import { bindProps } from '../../tools.js'; import { bindProps } from '../../tools.js';
@ -39,7 +39,7 @@ export default {
bindProps(this, ['metalness', 'roughness'], this.material); bindProps(this, ['metalness', 'roughness'], this.material);
watch(() => this.color, (value) => this.material.color.set(value)); watch(() => this.color, (value) => this.material.color.set(value));
this.geometry = new PlaneBufferGeometry(this.width, this.height, this.widthSegments, this.heightSegments); this.geometry = new PlaneGeometry(this.width, this.height, this.widthSegments, this.heightSegments);
this.mesh = new Mesh(this.geometry, this.material); this.mesh = new Mesh(this.geometry, this.material);
this.initObject3D(this.mesh); this.initObject3D(this.mesh);
}, },

View File

@ -1,4 +1,4 @@
import { DoubleSide, MeshBasicMaterial, PlaneBufferGeometry } from 'three'; import { DoubleSide, MeshBasicMaterial, PlaneGeometry } from 'three';
import { watch } from 'vue'; import { watch } from 'vue';
import Image from '../../meshes/Image.js'; import Image from '../../meshes/Image.js';
import snoise2 from '../../glsl/snoise2.glsl.js'; import snoise2 from '../../glsl/snoise2.glsl.js';
@ -36,7 +36,7 @@ export default {
}, },
methods: { methods: {
createGeometry() { createGeometry() {
this.geometry = new PlaneBufferGeometry(1, 1, this.widthSegments, this.heightSegments); this.geometry = new PlaneGeometry(1, 1, this.widthSegments, this.heightSegments);
}, },
createMaterial() { createMaterial() {
this.material = new MeshBasicMaterial({ side: DoubleSide, map: this.loadTexture() }); this.material = new MeshBasicMaterial({ side: DoubleSide, map: this.loadTexture() });

View File

@ -1,6 +1,6 @@
import { import {
Mesh, Mesh,
PlaneBufferGeometry, PlaneGeometry,
ShaderMaterial, ShaderMaterial,
Vector2, Vector2,
} from 'three'; } from 'three';
@ -19,7 +19,7 @@ export default function ZoomBlurImage(three) {
return { geometry, material, mesh, uCenter, uStrength, setMap, updateUV }; return { geometry, material, mesh, uCenter, uStrength, setMap, updateUV };
function init() { function init() {
geometry = new PlaneBufferGeometry(2, 2, 1, 1); geometry = new PlaneGeometry(2, 2, 1, 1);
material = new ShaderMaterial({ material = new ShaderMaterial({
transparent: true, transparent: true,

View File

@ -1,4 +1,4 @@
import { DoubleSide, MeshBasicMaterial, PlaneBufferGeometry, TextureLoader } from 'three'; import { DoubleSide, MeshBasicMaterial, PlaneGeometry, TextureLoader } from 'three';
import { watch } from 'vue'; import { watch } from 'vue';
import Mesh from './Mesh.js'; import Mesh from './Mesh.js';
@ -26,7 +26,7 @@ export default {
}, },
methods: { methods: {
createGeometry() { createGeometry() {
this.geometry = new PlaneBufferGeometry(1, 1, 1, 1); this.geometry = new PlaneGeometry(1, 1, 1, 1);
}, },
createMaterial() { createMaterial() {
this.material = new MeshBasicMaterial({ side: DoubleSide, map: this.loadTexture() }); this.material = new MeshBasicMaterial({ side: DoubleSide, map: this.loadTexture() });

View File

@ -1,4 +1,4 @@
import { PlaneBufferGeometry } from 'three'; import { PlaneGeometry } from 'three';
import { watch } from 'vue'; import { watch } from 'vue';
import Mesh from './Mesh.js'; import Mesh from './Mesh.js';
@ -22,7 +22,7 @@ export default {
}, },
methods: { methods: {
createGeometry() { createGeometry() {
this.geometry = new PlaneBufferGeometry(this.width, this.height, this.widthSegments, this.heightSegments); this.geometry = new PlaneGeometry(this.width, this.height, this.widthSegments, this.heightSegments);
}, },
}, },
__hmrId: 'Plane', __hmrId: 'Plane',

View File

@ -1,4 +1,4 @@
import { FontLoader, TextBufferGeometry } from 'three'; import { FontLoader, TextGeometry } from 'three';
import { watch } from 'vue'; import { watch } from 'vue';
import Mesh from './Mesh.js'; import Mesh from './Mesh.js';
import TextProps from './TextProps.js'; import TextProps from './TextProps.js';
@ -36,7 +36,7 @@ export default {
}, },
methods: { methods: {
createGeometry() { createGeometry() {
this.geometry = new TextBufferGeometry(this.text, { this.geometry = new TextGeometry(this.text, {
font: this.font, font: this.font,
size: this.size, size: this.size,
height: this.height, height: this.height,