Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

181
Views
THREE.js What does this vertices mean in the box geometry?

I have created a box geometry as below,

    const hand1geo = new THREE.BoxGeometry(2, 0.01, 0.2);
    const material_sidehand = new THREE.MeshBasicMaterial({ color: 0x3cc1b7 });
    const sidehand = new THREE.Mesh(hand1geo, material_sidehand);

What I want to do is to extract vertices from this box and I use this,

this.sidehand.attributes.position.array

And what I got is as following, The picture of result. I really don't understand why it just spanned 72 elements(24 vectors) with same value. Why there are 24 vectors here and where have them been defined? Because I wanna use raycaster to do the collision detection later on. I tried to use this.sidehand.vertices but it doesn't work.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I tried to use this.sidehand.vertices but it doesn't work.

I don't know what references you used but Mesh never had a property called vertices. You probably refer to the former Geometry class which indeed had this property. However, this class has been deprecated and BufferGeometry is used now instead.

I really don't understand why it just spanned 72 elements(24 vectors) with same value.

The values are not identical. BoxGeometry defines all vertices of the box in local space in a flat array so the data can be directly used by the WebGL API (which is good for performance).

There are 24 vectors because the geometry defines for each side of the box four vertices. Each side is composed of two triangles. This is done so it's possible to generate proper normals and texture coordinates.

I suggest you reconsider to use raw geometry data for collision detection. You are going to achieve much better performance by working with bounding volumes instead.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!