mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-07 16:40:05 +00:00
[3d] some general improvement (#2714)
This commit is contained in:
@@ -559,6 +559,6 @@ onUnmounted(() => {
|
||||
})
|
||||
|
||||
const getCameraIcon = computed(() => {
|
||||
return props.cameraType === 'perspective' ? 'pi-camera' : 'pi-th-large'
|
||||
return props.cameraType === 'perspective' ? 'pi-camera' : 'pi-camera'
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -29,7 +29,7 @@ export class CameraManager implements CameraManagerInterface {
|
||||
}
|
||||
|
||||
DEFAULT_PERSPECTIVE_CAMERA = {
|
||||
fov: 75,
|
||||
fov: 35,
|
||||
aspect: 1
|
||||
}
|
||||
|
||||
@@ -99,6 +99,11 @@ export class CameraManager implements CameraManagerInterface {
|
||||
const rotation = oldCamera.rotation.clone()
|
||||
const target = this.controls?.target.clone() || new THREE.Vector3()
|
||||
|
||||
const oldZoom =
|
||||
oldCamera instanceof THREE.OrthographicCamera
|
||||
? oldCamera.zoom
|
||||
: (oldCamera as THREE.PerspectiveCamera).zoom
|
||||
|
||||
if (!cameraType) {
|
||||
this.activeCamera =
|
||||
oldCamera === this.perspectiveCamera
|
||||
@@ -118,6 +123,14 @@ export class CameraManager implements CameraManagerInterface {
|
||||
this.activeCamera.position.copy(position)
|
||||
this.activeCamera.rotation.copy(rotation)
|
||||
|
||||
if (this.activeCamera instanceof THREE.OrthographicCamera) {
|
||||
this.activeCamera.zoom = oldZoom
|
||||
this.activeCamera.updateProjectionMatrix()
|
||||
} else if (this.activeCamera instanceof THREE.PerspectiveCamera) {
|
||||
this.activeCamera.zoom = oldZoom
|
||||
this.activeCamera.updateProjectionMatrix()
|
||||
}
|
||||
|
||||
if (this.controls) {
|
||||
this.controls.object = this.activeCamera
|
||||
this.controls.target.copy(target)
|
||||
|
||||
@@ -72,7 +72,7 @@ class Load3DConfiguration {
|
||||
|
||||
this.load3d.setLightIntensity(lightIntensity)
|
||||
|
||||
const fov = this.load3d.loadNodeProperty('FOV', 75)
|
||||
const fov = this.load3d.loadNodeProperty('FOV', 35)
|
||||
|
||||
this.load3d.setFOV(fov)
|
||||
|
||||
|
||||
@@ -152,7 +152,6 @@ export class ModelManager implements ModelManagerInterface {
|
||||
transparent: false,
|
||||
opacity: 1.0
|
||||
})
|
||||
child.geometry.computeVertexNormals()
|
||||
break
|
||||
|
||||
case 'wireframe':
|
||||
|
||||
@@ -32,7 +32,7 @@ export class SceneManager implements SceneManagerInterface {
|
||||
this.getActiveCamera = getActiveCamera
|
||||
this.getControls = getControls
|
||||
|
||||
this.gridHelper = new THREE.GridHelper(10, 10)
|
||||
this.gridHelper = new THREE.GridHelper(20, 20)
|
||||
this.gridHelper.position.set(0, 0, 0)
|
||||
this.scene.add(this.gridHelper)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user