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

  • Home
  • SEARCH
  • 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 925021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:27:15+00:00 2026-05-15T19:27:15+00:00

I’ve got a float array camObjCoord declared as.. public static float camObjCoord[] = new

  • 0

I’ve got a float array camObjCoord declared as..

public static float camObjCoord[] = new float[8000];

I’m then filling its indexes in a class that does something like the following..

                      public void addcube(float highx, float lowx, float highz, float lowz){
    //Constructing new cube...
    System.out.println("f = " + f);
    Global.cubes++;
    float y = 1.5f;
    System.out.println("highx = " + highx + "lowx = " + lowx + "highz = " + highz + "lowz = " + lowz);
    //FRONT
    camObjCoord[i] = lowx;
     i++;
    camObjCoord[i] = -y;
     i++;
    camObjCoord[i] = highz;
     i++;
    camObjCoord[i] = highx;
     i++;
    camObjCoord[i] = -y;
     i++;
    camObjCoord[i] = highz;
     i++;
    camObjCoord[i] = lowx;
     i++;
    camObjCoord[i] = y;
     i++;
    camObjCoord[i] = highz;
     i++;
    camObjCoord[i] = highx;
     i++;
    camObjCoord[i] = y;
     i++;
    camObjCoord[i] = highz;
    //BACK
     i++;
    camObjCoord[i] = lowx;
     i++;
    camObjCoord[i] = -y;
     i++;
    camObjCoord[i] = lowz;
     i++;
    camObjCoord[i] = lowx;
     i++;
    camObjCoord[i] = y;
     i++;
    camObjCoord[i] = lowz;
     i++;
    camObjCoord[i] = highx;
     i++;
    camObjCoord[i] = -y;
     i++;
    camObjCoord[i] = lowz;
     i++;
    camObjCoord[i] = highx;
     i++;
    camObjCoord[i] = y;
     i++;
    camObjCoord[i] = lowz;
     i++;
    //LEFT
    camObjCoord[i] = lowx;
     i++;
    camObjCoord[i] = -y;
     i++;
    camObjCoord[i] = highz;
     i++;
    camObjCoord[i] = lowx;
     i++;
    camObjCoord[i] = y;
     i++;
    camObjCoord[i] = highz;
     i++;
    camObjCoord[i] = lowx;
     i++;
    camObjCoord[i] = -y;
     i++;
    camObjCoord[i] = lowz;
     i++;
    camObjCoord[i] = lowx;
     i++;
    camObjCoord[i] = y;
     i++;
    camObjCoord[i] = lowz;
     i++;
    //RIGHT
    camObjCoord[i] = highx;
     i++;
    camObjCoord[i] = -y;
     i++;
    camObjCoord[i] = lowz;
     i++;
    camObjCoord[i] = highx;
     i++;
    camObjCoord[i] = y;
     i++;
    camObjCoord[i] = lowz;
     i++;
    camObjCoord[i] = highx;
     i++;
    camObjCoord[i] = -y;
     i++;
    camObjCoord[i] = highz;
     i++;
    camObjCoord[i] = highx;
     i++;
    camObjCoord[i] = y;
     i++;
    camObjCoord[i] = highz;
     i++;
    //TOP
    camObjCoord[i] = lowx;
     i++;
    camObjCoord[i] = y;
     i++;
    camObjCoord[i] = highz;
     i++;
    camObjCoord[i] = highx;
     i++;
    camObjCoord[i] = y; 
     i++;
    camObjCoord[i] = highz;
     i++;
    camObjCoord[i] = lowx;
     i++;
    camObjCoord[i] = y;
     i++;
    camObjCoord[i] = highz;
     i++;
    camObjCoord[i] = highx;
     i++;
    camObjCoord[i] = y;
     i++;
    camObjCoord[i] = lowz;
     i++;
    //BOTTOM
    camObjCoord[i] = lowx;
     i++;
    camObjCoord[i] = -y;
     i++;
    camObjCoord[i] = highz;
     i++;
    camObjCoord[i] = lowx;
     i++;
    camObjCoord[i] = -y;
     i++;
    camObjCoord[i] = lowz;
     i++;
    camObjCoord[i] = highx;
     i++;
    camObjCoord[i] = -y;
     i++;
    camObjCoord[i] = highz;
     i++;
    camObjCoord[i] = highx;
     i++;
    camObjCoord[i] = -y;
     i++;
    camObjCoord[i] = lowz;

    i++;
    int p = 0;
    System.out.println("FULL ARRAY");
    while(p < 72){
        System.out.println(camObjCoord[p]);
        p++;
    }
}

I’m then calling makeview()

    public void makeview() {
     Intent myIntent = new Intent(this, GLCamTest.class);

        Bundle b = new Bundle();
        b.putFloatArray("tweets", camObjCoord);
        myIntent.putExtras(b);
    this.startActivity(myIntent);
}

and then in the new class it’s doing…

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Bundle b = this.getIntent().getExtras();
    float original[] = b.getFloatArray("tweets");
    camObjCoord = original;
    counter++;
}   

I then have another class class GLLayer and it looks like the following.. http://pastebin.org/394884 inside this class I’m drawing the cube(s) from the float array, I’ve check and the values for the cube are indeed there and when I’m coding the array in it works but when I’m dynamically building the array then passing it the cube doesn’t draw. I’m calling the class like so..

           glView=new GLLayer(this);
           mPreview = new CamLayer(this, glView); 

Anyone have any idea why? How would I fix my problem? Just to add, I am giving the exact same values to the exact same indexes when drawing dynamically

          final static float camObjCoord[] = new float[] {
            // FRONT
             -2.0f, -1.5f,  2.0f,
              2.0f, -1.5f,  2.0f,
             -2.0f,  1.5f,  2.0f,
              2.0f,  1.5f,  2.0f,
             // BACK
             -2.0f, -1.5f, -2.0f,
             -2.0f,  1.5f, -2.0f,
              2.0f, -1.5f, -2.0f,
              2.0f,  1.5f, -2.0f,
             // LEFT
             -2.0f, -1.5f,  2.0f,
             -2.0f,  1.5f,  2.0f,
             -2.0f, -1.5f, -2.0f,
             -2.0f,  1.5f, -2.0f,
             // RIGHT
              2.0f, -1.5f, -2.0f,
              2.0f,  1.5f, -2.0f,
              2.0f, -1.5f,  2.0f,
              2.0f,  1.5f,  2.0f,
             // TOP
             -2.0f,  1.5f,  2.0f,
              2.0f,  1.5f,  2.0f,
             -2.0f,  1.5f, -2.0f,
              2.0f,  1.5f, -2.0f,
             // BOTTOM
             -2.0f, -1.5f,  2.0f,
             -2.0f, -1.5f, -2.0f,
              2.0f, -1.5f,  2.0f,
              2.0f, -1.5f, -2.0f,
        };

Then it will render this cube. It appears to not like that I’m making the array and then dynamically adding indexes. Why? how do I fix this? For the bounty I would also accept an appropriate workaround which will work in Android.

Thanks.

edit1: I’ve tried various things it’s not the passing of the array causing the problems if I was to declare the array like so…

edit2: I’ve also tried printing the array as it goes into GLLayer (class which renders cubes) and everything is as you would expect. I’ve no idea why these cubes wouldn’t be appearing 🙁

edit3: I’ve added how I’m constructing the float arrays.

edit4: I’ve also tried setting the size of the array equal to the number of values I’m inputting. Doesn’t work.

  • 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-15T19:27:16+00:00Added an answer on May 15, 2026 at 7:27 pm

    I would pare down the problem a little. If you were to make the array big enough to hold only one cube, and populate it the same way (but just once), would it work? What if you made it big enough to hold two cubes, and gave it two cubes’ worth of data?

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

Sidebar

Ask A Question

Stats

  • Questions 509k
  • Answers 509k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I personally take a different approach to solving this problem:… May 16, 2026 at 4:42 pm
  • Editorial Team
    Editorial Team added an answer I think NuSkooler's answer is probably correct. The documentation he… May 16, 2026 at 4:42 pm
  • Editorial Team
    Editorial Team added an answer If you are using CF 8+, you can use the… May 16, 2026 at 4:42 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

i got an object with contents of html markup in it, for example: string
I've got a string that has curly quotes in it. I'd like to replace
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I have a JSP page retrieving data and when single or double quotes are
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out

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.