123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186 |
- <!DOCTYPE html>
- <html lang="ar">
- <head>
- <meta charset="utf-8" />
- <base href="../../../" />
- <script src="page.js"></script>
- <link type="text/css" rel="stylesheet" href="page.css" />
- </head>
- <body class="rtl">
- [page:Object3D] → [page:Mesh] →
- <h1>[name]</h1>
- <p class="desc">
- شبكة لديها [page:Skeleton] مع [page:Bone bones] يمكن استخدامها بعد ذلك
- لتحريك رؤوس الهندسة.
- </p>
-
- <iframe id="scene" src="scenes/bones-browser.html"></iframe>
- <script>
- // iOS iframe auto-resize workaround
- if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
- const scene = document.getElementById( 'scene' );
- scene.style.width = getComputedStyle( scene ).width;
- scene.style.height = getComputedStyle( scene ).height;
- scene.setAttribute( 'scrolling', 'no' );
- }
- </script>
- <h2>مثال للكود</h2>
- <code>
- const geometry = new THREE.CylinderGeometry( 5, 5, 5, 5, 15, 5, 30 );
- // create the skin indices and skin weights manually
- // (typically a loader would read this data from a 3D model for you)
- const position = geometry.attributes.position;
- const vertex = new THREE.Vector3();
- const skinIndices = [];
- const skinWeights = [];
- for ( let i = 0; i < position.count; i ++ ) {
- vertex.fromBufferAttribute( position, i );
- // compute skinIndex and skinWeight based on some configuration data
- const y = ( vertex.y + sizing.halfHeight );
- const skinIndex = Math.floor( y / sizing.segmentHeight );
- const skinWeight = ( y % sizing.segmentHeight ) / sizing.segmentHeight;
- skinIndices.push( skinIndex, skinIndex + 1, 0, 0 );
- skinWeights.push( 1 - skinWeight, skinWeight, 0, 0 );
- }
- geometry.setAttribute( 'skinIndex', new THREE.Uint16BufferAttribute( skinIndices, 4 ) );
- geometry.setAttribute( 'skinWeight', new THREE.Float32BufferAttribute( skinWeights, 4 ) );
- // create skinned mesh and skeleton
- const mesh = new THREE.SkinnedMesh( geometry, material );
- const skeleton = new THREE.Skeleton( bones );
- // see example from THREE.Skeleton
- const rootBone = skeleton.bones[ 0 ];
- mesh.add( rootBone );
- // bind the skeleton to the mesh
- mesh.bind( skeleton );
- // move the bones and manipulate the model
- skeleton.bones[ 0 ].rotation.x = -0.1;
- skeleton.bones[ 1 ].rotation.x = 0.2;
- </code>
- <h2>المنشئ (Constructor)</h2>
- <h3>
- [name]( [param:BufferGeometry geometry], [param:Material material] )
- </h3>
- <p>
- [page:BufferGeometry geometry] - نسخة من [page:BufferGeometry].<br />
- [page:Material material] - (اختياري) نسخة من [page:Material].
- الافتراضي هو [page:MeshBasicMaterial] جديد.
- </p>
-
- <h2>الخصائص (Properties)</h2>
- <p>انظر إلى الفئة الأساسية [page:Mesh] للحصول على الخصائص المشتركة.</p>
-
- <h3>[property:String bindMode]</h3>
- <p>
- Either `AttachedBindMode` or `DetachedBindMode`. `AttachedBindMode` means the skinned mesh
- shares the same world space as the skeleton. This is not true when using `DetachedBindMode`
- which is useful when sharing a skeleton across multiple skinned meshes.
- Default is `AttachedBindMode`.
- </p>
-
- <h3>[property:Matrix4 bindMatrix]</h3>
- <p>المصفوفة الأساسية المستخدمة لتحويلات العظام المربوطة.</p>
-
- <h3>[property:Matrix4 bindMatrixInverse]</h3>
- <p>المصفوفة الأساسية المستخدمة لإعادة تعيين تحويلات العظام المربوطة.</p>
-
- <h3>[property:Box3 boundingBox]</h3>
- <p>
- مربع التحديد لـ [name]. يمكن حسابه بـ
- [page:.computeBoundingBox](). الافتراضي هو `null`.
- </p>
-
- <h3>[property:Sphere boundingSphere]</h3>
- <p>
- الكرة المحيطة لـ [name]. يمكن حسابها بـ
- [page:.computeBoundingSphere](). الافتراضي هو `null`.
- </p>
-
- <h3>[property:Boolean isSkinnedMesh]</h3>
- <p>علامة للقراءة فقط للتحقق مما إذا كان كائن معين هو من نوع [name].</p>
-
- <h3>[property:Skeleton skeleton]</h3>
- <p>[page:Skeleton] يمثل هيكل العظام للشبكة المشدودة.</p>
-
- <h2>الطرق (Methods)</h2>
- <p>انظر إلى الفئة الأساسية [page:Mesh] للحصول على الطرق المشتركة.</p>
-
- <h3>
- [method:undefined bind]( [param:Skeleton skeleton], [param:Matrix4 bindMatrix] )
- </h3>
- <p>
- [page:Skeleton skeleton] - [page:Skeleton] تم إنشاؤه من شجرة [page:Bone Bones].<br />
- [page:Matrix4 bindMatrix] - [page:Matrix4] يمثل التحويل الأساسي
- للهيكل العظمي.<br /> <br />
-
- ربط هيكل عظمي بالشبكة المشدودة. يتم حفظ bindMatrix في
- خاصية .bindMatrix ويتم حساب .bindMatrixInverse.
- </p>
-
- <h3>[method:SkinnedMesh clone]()</h3>
- <p>
- لا تقوم هذه الطريقة حاليًا بنسخ نسخة من [name] بشكل صحيح.
- يرجى استخدام [page:SkeletonUtils.clone]() في هذه الأثناء.
- </p>
-
- <h3>[method:undefined computeBoundingBox]()</h3>
- <p>
- حساب مربع التحديد، وتحديث خاصية [page:.boundingBox].<br />
- لا يتم حساب مربعات التحديد افتراضيًا. يجب حسابها بشكل صريح
- ، وإلا كانت `null`. إذا كانت نسخة من [name] متحركة،
- يجب استدعاء هذه الطريقة في كل إطار لحساب مربع تحديد صحيح.
- </p>
-
- <h3>[method:undefined computeBoundingSphere]()</h3>
- <p>
- حساب الكرة المحيطة، وتحديث خاصية [page:.boundingSphere]
- .<br />
- لا يتم حساب الكرات المحيطة افتراضيًا. يجب حسابها بشكل صريح
- ، وإلا كانت `null`. إذا كانت نسخة من [name] متحركة،
- يجب استدعاء هذه الطريقة في كل إطار لحساب كرة محيطة صحيحة.
- </p>
-
- <h3>[method:undefined normalizeSkinWeights]()</h3>
- <p>تطبيع أوزان الجلد.</p>
-
- <h3>[method:undefined pose]()</h3>
- <p>هذه الطريقة تضع الشبكة المشدودة في وضعية الأساس (إعادة تعيين الوضعية).</p>
-
- <h3>
- [method:Vector3 applyBoneTransform]( [param:Integer index], [param:Vector3 vector] )
- </h3>
- <p>
- تطبق تحويل العظام المرتبط بالفهرس المعطى على موضع المتجه المعطى. يُعاد المتجه المُحدَّث.
- </p>
-
- <h2>المصدر (Source)</h2>
- <p>
- [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
- </p>
- </body>
- </html>
|