Search:

Type: Posts; User: shadysback

Search: Search took 0.08 seconds.

  1. Replies
    15
    Views
    1,608

    Re: Three dimensional array in Java Help

    After much tweaking and deliberation, i managed to fix it. Both of you were right! The indices were indeed coordinates. The value held at each index location represented the colour of the pixel....
  2. Replies
    15
    Views
    1,608

    Re: Three dimensional array in Java Help

    Hi,

    That bit i understand. What i dont understand is getting seperate x and y values since i need them in JOGL to plot this pixel.
    For instance

    data[1][0][5]
    data[1][1][5]
    data[1][2][5]
    ...
  3. Replies
    15
    Views
    1,608

    Re: Three dimensional array in Java Help

    I am using it to draw an represent a 3-D image. so i will plot each pixel manually using the data in the array.

    Another use of the the scalar data contained in each position will be to use it to...
  4. Replies
    15
    Views
    1,608

    Re: Three dimensional array in Java Help

    The data is loaded into an int[][][] array by an external .jar library whose source i do not have so i cannot do any other way but this.

    To correct you each position only holds one scalar value....
  5. Replies
    15
    Views
    1,608

    Re: Three dimensional array in Java Help

    Hi Chris, I need to hold data about a 3D image. So needs to hold x,y,z positions about each pixel.
  6. Replies
    15
    Views
    1,608

    Three dimensional array in Java Help

    I am working with datasets that contain x,y,z coordinates for each position (size = 40,40,40 for this instance).
    My understanding is that java treats arrays differently to other languages like c...
  7. Replies
    15
    Views
    2,111

    Re: Can't simultaneously run two threads??

    Sorry i dont understand how i can override paintcomponent from within the thread, surely you have to set public methods and variables within the paintcomponent to modify it from an altogether...
  8. Replies
    15
    Views
    2,111

    Re: Can't simultaneously run two threads??

    Unfortunately thats a pre-requisite that i have to have each ball controlled by its own runnable/thread,
  9. Replies
    15
    Views
    2,111

    Re: Can't simultaneously run two threads??

    If i can ask one last question, i am trying to make a frame full of bouncing balls, i.e. each ball controlled by their own runnable, which bounce off the window panes. What would be a good layout...
  10. Replies
    15
    Views
    2,111

    Re: Can't simultaneously run two threads??

    It works!!! BTW i was trying out FlowLayout before you suggested GridLayout, and none of the components were showing on the frame. Do you have any idea why?
  11. Replies
    15
    Views
    2,111

    Re: Can't simultaneously run two threads??

    Hi i think i found out where i was going wrong. I was adding the component directly to the frame (refer to BallsFrame.java). I think you can only add one component directly to a frame.
  12. Replies
    15
    Views
    2,111

    Re: Can't simultaneously run two threads??

    Sorry about that. Here is the various pages of the program:
  13. Replies
    15
    Views
    2,111

    Re: Can't simultaneously run two threads??

    Hi i tried to make a small version of the program but i couldnt change classes into methods etc, as i am quite new at java. Heres a project folder from netbeans which contains all the source.
    Sorry...
  14. Replies
    15
    Views
    2,111

    Can't simultaneously run two threads??

    Hey Guys,

    I am creating a program which creates two balls (each with their own runnables which control them). This is the important code from the file:


    public BallsFrame() {
    ...
  15. Replies
    7
    Views
    2,665

    [SOLVED] Re: Drawing lines using angles in Java HELP

    hey ive solved it now. Yeah i changed it so i was subtracting once the hours was changed to degrees. Thanks for your help!
  16. Replies
    7
    Views
    2,665

    [SOLVED] Re: Drawing lines using angles in Java HELP

    Oh. How would you suggest i do it then?

    Btw i have updated the code, more viewer friendly now:
  17. Replies
    7
    Views
    2,665

    [SOLVED] Re: Drawing lines using angles in Java HELP

    Thats one posibility i considered, i tried to add 90degrees to my values but it still doesnt point up
    i.e.

    But what this does is make 9:00 the new 12:00.
    I try 90-h, h-90 etc no matter what...
  18. Replies
    7
    Views
    2,665

    [SOLVED] Re: Drawing lines using angles in Java HELP

    Sorry about the confusion. Il try to clear it up here:

    The user gives me two int's hr and min, which are the hour and minutes to display on this clock. I then convert each hour into degrees, so if...
  19. Replies
    7
    Views
    2,665

    [SOLVED] Drawing lines using angles in Java HELP

    Hi All,

    Im making a clock in java and i need help drawing the minutes and hours hand. I have done some maths and came up with the following formula

    The formula i am using above is x = a +...
Results 1 to 19 of 19