<p>这是我的工作,我目前正在使用旋转和平移对象从其位置。`你知道吗</p>
<pre><code>Scene3D
{
id:myScene3d
property int rotX:0
property int rotY:0
property int rotZ:0`
Entity
{
id: sceneRoot
Camera
{
id: camera
projectionType: CameraLens.PerspectiveProjection
fieldOfView: 2
aspectRatio: 16/9
nearPlane : 0.1
farPlane : 20.0
position: Qt.vector3d(posX,posY,posZ)
upVector: Qt.vector3d( 0.0, 1.0, 0.0 )
viewCenter: Qt.vector3d( 0.0, 0.0, 0.0 )
}
FirstPersonCameraController
{
camera: camera
linearSpeed: 1.0
acceleration: 0.1
deceleration: 1.0
}
Entity
{
id: monkeyEntity
components: [
SceneLoader
{
id: sceneLoader
},
Transform
{
rotationX : rotX
rotationY : rotY
rotationZ : rotZ
},
ObjectPicker
{
onPressed: {
console.log("Object clicked! Pressed at world-intersection: ", pick.worldIntersection)
console.log("Triangle index: ", pick.triangleIndex)
}
}
]
</code></pre>
<p>如您所见,rotX、rotY和rotZ被用作场景外部的属性。
然后我简单地使用了关于MouseX和MouseY值的case语句。我希望你明白。
}你知道吗</p>