Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8226887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:55:59+00:00 2026-06-07T15:55:59+00:00

I have a probably stupid problem. Im trying to iterate through the vertices of

  • 0

I have a probably stupid problem. Im trying to iterate through the vertices of a plane.
Why wont this work. I get a “Uncaught TypeError: Cannot set property ‘x’ of undefined” error.

plane = new THREE.Mesh(new THREE.PlaneGeometry(100,100, 10, 10), planeMat);

//Set up heightmap for plane
var vertices = plane.geometry.vertices;
var l = vertices.length;
for ( var i = 0;i < l;i++){
    vertices[i].position.x = Math.random()*50;
}

scene.add(plane);

Entire code that renders http://jsfiddle.net/sJESN/ uncomment commented line in above loop to get error.

Thanks for any help, I’ve been going crazy for 3 days with this!
Sorry for any noob mistakes.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T15:56:01+00:00Added an answer on June 7, 2026 at 3:56 pm

    The vertices array which is a part of all the geometry objects does not have a position member. The position variable is a member of Object3D and it is a THREE.Vector3. The array of vertices is actually itself an array of THREE.Vector3 so you simply need to change this line

    vertices[i].position.x = Math.random() * 50;
    

    to…

    vertices[i].x = Math.random() * 50;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

well i have most probably an extremly stupid problem but could not figure it
I have probably a stupid problem. In a script I generate a URL with
this is probably a really stupid problem, but i've been looking at it for
(probably it's a stupid thing but) I have a problem with a stack implementation
This is probably a very simple and stupid question to ask, but I have
This is a stupid example but I'm trying to understand how thing get passed
I'm going mad with, probably, a stupid problem. I have 3 strings: year, month
Ok guys i have maybe a stupid problem, but i'm probably dumb :) I
I have problem probably the same like this guy : When clicking on text
I have a problem with linking and gcc, probably resulting from a stupid mistake

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.