이 페이지에서

vector3d QML Value Type

x, y, z 속성을 가진 값. 더 보기...

Import Statement: import QtQuick

상세 설명

vector3d 유형은 x, y 및 z 속성을 가진 값을 나타냅니다.

vector3d 유형의 속성은 기본적으로 0 벡터를 가집니다. 이때 x, y 및 z 는 0 로 설정됩니다.

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 }

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

C++과 통합할 때, C++에서 QML로 전달되는 모든 QVector3D 값은 자동으로 vector3d 값으로 변환되며, 그 반대의 경우도 마찬가지임을 유의하십시오.

vector3d 유형에는 QML에서 호출할 수 있는 다음과 같은 항등 함수가 있습니다:

함수 시그니처설명예시
vector3d crossProduct(vector3d other)this 의 vector3d와 other 의 vector3d 간의 외적 결과를 vector3d로 반환합니다.
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)
real dotProduct(vector3d other)this vector3d와 other vector3d의 내적 결과를 실수 스칼라로 반환합니다.
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 matrix)this 인 vector3d를 4x4 matrix 로 변환한 결과인 vector3d를 반환합니다. 이 행렬은 벡터 뒤에 적용됩니다.
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(real factor)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)
vector3d plus(vector3d other)this 의 vector3d와 other 의 vector3d를 더한 결과인 vector3d를 반환합니다.
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)
vector3d minus(vector3d other)other 벡터3d에서 this 벡터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 normalized()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를 vector2d로 변환한 결과를 반환합니다.
var a = Qt.vector3d(1,2,3);
var b = a.toVector2d();
console.log(b.toString()); // QVector2D(1, 2)
vector4d toVector4d()this vector3d를 vector4d로 변환한 vector4d 결과를 반환합니다.
var a = Qt.vector3d(1,2,3);
var b = a.toVector4d();
console.log(b.toString()); // QVector4D(1, 2, 3, 0)
bool fuzzyEquals(vector3d other, real epsilon)this 의 vector3d가 other 의 vector3d와 대략적으로 동일한 경우 true를 반환합니다. this 의 각 속성이 other 의 epsilon 이내인 경우 대략적인 등가성이 성립합니다. 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 값 유형도 참조하십시오 .

© 2026 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.