[page:Curve] →

[name]

قم بإنشاء منحنى سبلاين ثنائي الأبعاد ناعم من سلسلة من النقاط. يستخدم هذا داخليًا [page:Interpolations.CatmullRom] لإنشاء المنحنى.

مثال الكود

// إنشاء موجة شبيهة بالجيب const curve = new THREE.SplineCurve( [ new THREE.Vector2( -10, 0 ), new THREE.Vector2( -5, 5 ), new THREE.Vector2( 0, 0 ), new THREE.Vector2( 5, -5 ), new THREE.Vector2( 10, 0 ) ] ); const points = curve.getPoints( 50 ); const geometry = new THREE.BufferGeometry().setFromPoints( points ); const material = new THREE.LineBasicMaterial( { color: 0xff0000 } ); // إنشاء الكائن النهائي لإضافته إلى المشهد const splineObject = new THREE.Line( geometry, material );

المنشئ (Constructor)

[name]( [param:Array points] )

points – مصفوفة من نقاط [page:Vector2] التي تحدد المنحنى.

الخصائص (Properties)

انظر إلى قاعدة [page:Curve] للخصائص المشتركة.

[property:Array points]

مصفوفة من نقاط [page:Vector2] التي تحدد المنحنى.

الوظائف (Methods)

انظر إلى قاعدة [page:Curve] للأساليب المشتركة.

المصدر (Source)

[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]