Skip to content

案例展示

场景剖切效果

<template>
  <div id="TO"></div>
</template>

<script setup>
import { onMounted } from 'vue';

onMounted(() => {
  let TO = new ThingOrigin("fileModel", document.getElementById("TO"))

  TO.model.initFileModel(
    {
      modelName: "fileModel-" + new Date().getTime(),
      base: {
        modelUrl: `${import.meta.env.BASE_URL}models/car.gltf`,
      },
      modelType: "gltf",
      position: {
        x: 0,
        y: 0,
        z: 0,
      },
      scale: {
        x: 10,
        y: 10,
        z: 10,
      },
      rotation: {
        x: 0,
        y: 0,
        z: 0,
      }
    }
  ).then((model) => {
    TO.scene.add(model.scene);
    TO.effect.initSceneClip("x", 0.1);
  });

});


</script>

<style scoped>
#TO {
  width: 100%;
  height: 400px;
  position: relative;
}
</style>

API 介绍

effect.initSceneClip

方法签名返回值描述
initSceneClip(axis: string, constant: number)void创建场景的剖切

参数说明:

参数名类型是否必选描述
axisstring剖切轴
constantnumber初始剖切位置