문제

I have a viewport3d with a camera and some blocks inside of it. Currently using the keyboard to move the camera up/down/left/right/rotate ect.

but instead of the camera i want to move the world view. So when a user presses the W key to move up, its not just moving the camera in a +x position. As the user maybe at a 20 degree view.

도움이 되었습니까?

해결책

Create a virtual Camera Boom.

Create an invisible object like a TDummy, in the same location as the object of interest or the center of the scene.

Create the TCamera as a child of the object. Set its position the desired distance away on one of the axes.

you can now rotate the camera around the object simply by changing the rotationAngle of the dummy object. The camera will maintain the exact distance and automatically points directly toward the center.

Also by adding light as a child of the camera it too will follow as the camera moves. Hope this helps someone.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top