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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T04:04:30+00:00 2026-05-29T04:04:30+00:00

If I populate a vertex-buffer by using the byte-array method: //Example: var ba:ByteArray =

  • 0

If I populate a vertex-buffer by using the byte-array method:

//Example:
var ba:ByteArray = new ByteArray();

//Write vertex #0:
ba.writeFloat(-.5);
ba.writeFloat(-.5);
ba.writeUnsignedInt(0);
ba.writeUnsignedInt(0);

//Write vertex #1:
ba.writeFloat(.5);
ba.writeFloat(-.5);
ba.writeUnsignedInt(1);
ba.writeUnsignedInt(0);

//Write vertex #2:
ba.writeFloat(.5);
ba.writeFloat(.5);
ba.writeUnsignedInt(1);
ba.writeUnsignedInt(1);

//Write vertex #3:
ba.writeFloat(-.5);
ba.writeFloat(.5);
ba.writeUnsignedInt(0);
ba.writeUnsignedInt(1);

myVertexBuffer.uploadFromByteArray(ba, 0, 0, 4);

And then set the vertex-buffer attribute with the following format:

var format:String = Context3DVertexBufferFormat.BYTES_4;
context3D.setVertexBufferAt(0, myVertexBuffer, 0, format);

What is the range of values possible (0 to 255? 0.0 to 1.0? etc.) for the Vertex attribute’s field (in this case, va0.x, va0.y, va0.z, va0.w)? Does it vary between which data-type is written to the ByteArray object (writeFloat vs. writeUnsignedInt)?

  • 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-05-29T04:04:30+00:00Added an answer on May 29, 2026 at 4:04 am

    BYTES_4 is unpacked as 4 bytes in the [0..1] range.
    So bytes 0xff, 0x7f, 0, 1 would become 1.0, .5, 0, 1/255 in the vertex program.
    In you case the WriteUnsignedInt would only populate x with the 1.
    You should use WriteByte 4 times instead, or even better pack your 4 values into one unsigned int, like a color.

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

Sidebar

Related Questions

I populate the GridView.DataSource from a EntityFramework Model: gwTimeLog.DataSource = _entities.TimeLogs; When a new
I am trying to populate a string with a double value using a sprintf
Or do you populate your form controls manually by a method? Is either considered
The way i currently populate business objects is using something similar to the snippet
I'm relatively new to OpenGL and have been using the GLTools library it provides.
I populate a new grid from json with custom formatter the formatter is defined
I'm trying to populate a smartgwt calendar using data form a server obtained using
Populate php array into HTML table I have data in a php array (say,
I populate a form in PDF using my java program. I am using faceless
I populate a listview from a JSON object. This works fine setListAdapter(new ArrayAdapter<String>(this, R.layout.list_items,

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.