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 8538601
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:09:22+00:00 2026-06-11T11:09:22+00:00

the title basically. You can reserve more than you need when creating a mesh

  • 0

the title basically.

You can reserve more than you need when creating a mesh

mesh = new Mesh(false, 100, 0, new VertexAttribute(Usage.Position, 3, "a_position"));

But there is no method for adding a vertex. You can get the FloatBuffer and add to that, but I get strange results. I also tried the mesh.setVertices with offset but that does not work either.

I debugged with drawing points. Works until I try adding a vertex by any means (even if I tweak offsets to account for 3 floats in one vertex)

Copied code segment:

mesh.setVertices(new float[] {
                -0.5f, -0.5f, 0,
                0.5f, -0.5f, 0/*,
                -0.5f,0.5f,0.f*/});//works if I uncoment this
mesh.setVertices(new float[]{-0.5f,0.5f,0.f}, 6, 3);//but comment this out

I also tried

squareMesh.setVertices(new float[]{-0.5f,0.5f,0.f}, 2, 3);

Thanks 🙂

  • 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-11T11:09:24+00:00Added an answer on June 11, 2026 at 11:09 am

    Adding is a bad idea because the underlying buffers must be recreated and that takes up a lot of time. Instead, one should allocate meshes in bulk and only render what is currently used.

    For example mesh.render(GL10.GL_TRIANGLES,0,num_triangles);

    As for updating the buffer:

    FloatBuffer fbuftmp = mesh.getVerticesBuffer(); 
    BufferUtils.copy(buf,fbuftmp,fbuftmp.capacity(),0);
    

    Where buf is an float array.

    Use BufferUtils.copy for reason explained here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry for the vague title, as I really can't explain this problem succinctly. Basically
Basically what the title says. I created a new MVC application. I'm trying to
The title is pretty self explanatory, but basically I need the table row to
Basically what I've asked in the title. How can I use the Ant symlink
As you can see from the title I basically want to update a plist.
Can one use jQuery to clone() a meta title? Basically I am trying to
Basically, the question in the title - how can I / is it possible
I honestly can't think of a better title, I'm new with writing my own
The title basically says it all. I'm aware this can't be done using traditional
It's hard to explain in the title. Basically as far as I can tell

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.