You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I defined a camera and a light and used the :position attribute, but the type error was displayed in vscode; so I changed :position="[3, 3,3]" to:position="new THREE. Vector3(0, 3, 3)" results in no type error;
I don't know if it's a version problem or a package version problem.
Suggested solution
<scriptsetuplang="ts">import*asTHREEfrom'three'import { TresCanvas } from'@tresjs/core'import { OrbitControls, vLightHelper } from'@tresjs/cientos'importTexture_02from'@/components/texture/texture_02/index.vue'defineOptions({ dir_name: 'stickers', })</script>
<template>
<divclass="container">
<TresCanvasshadowsclear-color="#82DBC5"preset="realistic"alphapower-preference="high-performance">
<OrbitControls />
<!-- There will be a type problem here -->
<TresPerspectiveCamera :position="[3, 3, 3]" :look-at="[0, 0, 0]" />
<Suspense>
<Texture_02 />
</Suspense>
<!-- OK -->
<TresDirectionalLight :intensity="1" :position="newTHREE.Vector3(0, 3, 3)"v-light-helper />
</TresCanvas>
</div>
</template>
<stylelang="scss"scoped>.container {width: 100%;height: 100%;display: flex;align-items: center;justify-content: center; }</style>
Alternative
At first I thought: position="new THREE.Vector3(0, 3, 3)" is a better way to understand the original parameters of threejs, but after reading the documentation, I found: position="[0,3,3]" is simpler ;But the recommended writing method in the document is: position="[0,3,3]"
Description
I defined a camera and a light and used the :position attribute, but the type error was displayed in vscode; so I changed :position="[3, 3,3]" to:position="new THREE. Vector3(0, 3, 3)" results in no type error;
I don't know if it's a version problem or a package version problem.
Suggested solution
Alternative
At first I thought: position="new THREE.Vector3(0, 3, 3)" is a better way to understand the original parameters of threejs, but after reading the documentation, I found: position="[0,3,3]" is simpler ;But the recommended writing method in the document is: position="[0,3,3]"
Additional context
Validations
The text was updated successfully, but these errors were encountered: