vector3d QML Value Type

x, y 및 z 속성을 가진 값입니다. 더 보기...

상세 설명

vector3d 유형은 x, y, z 속성이 있는 값을 나타냅니다.

vector3d 유형의 속성은 기본적으로 0 벡터를 갖습니다. 여기에는 x, yz0 로 설정되어 있습니다.

vector3d 값을 만들려면 "x,y,z" 문자열로 지정합니다:

Rotation { angle: 60; axis: "0,1,0" }

또는 Qt.vector3d() 함수를 사용합니다:

Rotation { angle: 60; axis: Qt.vector3d(0, 1, 0) }

또는 별도의 x, y, z 컴포넌트로 지정합니다:

Rotation { angle: 60; axis.x: 0; axis.y: 1; axis.z: 0 }

벡터3D 값의 각 속성은 내부적으로 단정밀도 부동 소수점 숫자(float)로 저장됩니다.

C++와 통합할 때 C++에서 QML로 전달된 QVector3D 값은 자동으로 vector3d 값으로 변환되며, 그 반대의 경우도 마찬가지입니다.

벡터3d 유형에는 QML에서 호출할 수 있는 다음과 같은 부동 소수점 함수가 있습니다:

함수 서명설명예제
vector3d crossProduct(vector3d other)this 벡터3d와 other 벡터3d의 교차 곱의 벡터3d 결과를 반환합니다.
var a = Qt.vector3d(1,2,3);
var b = Qt.vector3d(4,5,6);
var c = a.crossProduct(b);
console.log(c.toString()); // QVector3D(-3, 6, -3)
실수 닷프로덕트(벡터3d 다른)this 벡터3d와 other 벡터3d의 도트 곱의 스칼라 실수 결과를 반환합니다.
var a = Qt.vector3d(1,2,3);
var b = Qt.vector3d(4,5,6);
var c = a.dotProduct(b);
console.log(c); // 32
vector3d times(matrix4x4 행렬)this 벡터3d를 4x4 matrix 행렬로 변환한 벡터3d 결과를 벡터 후 적용 행렬로 반환합니다.
var a = Qt.vector3d(1,2,3);
var b = Qt.matrix4x4(4,5,6,7,8,9,10,11,
                     12,13,14,15,16,17,18,19);
var c = a.times(b);
console.log(c.toString());
// QVector3D(0.774194, 0.849462, 0.924731)
vector3d times(vector3d other)this 벡터3d에 other 벡터3d를 곱한 벡터3d 결과를 반환합니다.
var a = Qt.vector3d(1,2,3);
var b = Qt.vector3d(4,5,6);
var c = a.times(b);
console.log(c.toString()); // QVector3D(4, 10, 18)
vector3d times(실수 인자)this 벡터3d에 스칼라를 곱한 벡터3d 결과를 반환합니다. factor
var a = Qt.vector3d(1,2,3);
var b = 4.48;
var c = a.times(b);
console.log(c.toString()); // QVector3D(4.48, 8.96, 13.44)
벡터3D 플러스(벡터3D 기타)other 벡터3d에 this 벡터3d를 더한 벡터3d 결과를 반환합니다.
var a = Qt.vector3d(1,2,3);
var b = Qt.vector3d(4,5,6);
var c = a.plus(b);
console.log(c.toString()); // QVector3D(5, 7, 9)
벡터3D 마이너스(벡터3D 기타)this 벡터3d에서 other 벡터3d를 뺀 벡터3d 결과를 반환합니다.
var a = Qt.vector3d(1,2,3);
var b = Qt.vector3d(4,5,6);
var c = a.minus(b);
console.log(c.toString()); // QVector3D(-3, -3, -3)
vector3d 정규화()this 벡터의 정규화된 형태를 리턴합니다.
var a = Qt.vector3d(1,2,3);
var b = a.normalized();
console.log(b.toString());
// QVector3D(0.267261, 0.534522, 0.801784)
real length()this 벡터3d의 길이의 스칼라 실수값을 리턴합니다.
var a = Qt.vector3d(1,2,3);
var b = a.length();
console.log(b.toString()); // 3.7416573867739413
vector2d toVector2d()this vector3d를 벡터2d로 변환한 벡터2d 결과를 반환합니다.
var a = Qt.vector3d(1,2,3);
var b = a.toVector2d();
console.log(b.toString()); // QVector2D(1, 2)
vector4d toVector4d()this vector3d를 벡터4D로 변환한 벡터4D 결과를 리턴합니다.
var a = Qt.vector3d(1,2,3);
var b = a.toVector4d();
console.log(b.toString()); // QVector4D(1, 2, 3, 0)
bool fuzzyEquals(vector3d other, 실수 엡실론)this 벡터3d가 other 벡터3d와 거의 같으면 참을 리턴합니다. this 의 각 속성이 epsilonother 내에 있으면 근사치는 참이 됩니다. epsilon 은 선택적 인자이며 기본값 epsilon 은 0.00001 입니다.
var a = Qt.vector3d(1,2,3);
var b = Qt.vector3d(1.0001, 1.9998, 2.0001);
var c = a.fuzzyEquals(b);        // default epsilon
var d = a.fuzzyEquals(b, 0.005); // supplied epsilon
console.log(c + " " + d); // false true

이 값 유형은 QtQuick 가져오기에서 제공됩니다.

QML 값 유형도참조하세요 .

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.