Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: paint each side of a cube with dif. color?

  1. #11

    paint each side of a cube with dif. color?

    Quote Originally Posted by User137
    Quote Originally Posted by arthurprs
    look what i have, any ideia why i need to move 2 insted of 1 as you say ?
    (if i move 1 it does not position the cube above the another, they intersect)
    That would be, if your cube is min-maxed from -1 to 1. But I always render things from -0.5 to 0.5 or 0 to 1 (use -0.5 to 0.5 if you want to easily rotate around center point). That way you have simpler math when using grid or tile based game.

    Your code works i guess, but don't forget to learn glPushMatrix and glPopMatrix. They are very useful, and in theory even faster than glTranslatef because there is no matrix multiplication, only simple memory copy.
    the code i posted code works,
    im using the cube render code of Brainer (see the code on 2¬? post)

    ps: i will travel to my grandmothers house today, but soon i will be back and try the results
    From brazil (:

    Pascal pownz!

  2. #12

    paint each side of a cube with dif. color?

    Quote Originally Posted by arthurprs
    i need to draw a cube with some small cubes, and them remove the faces away, but...
    I'm not sure I understand what you mean. :? Do you want to make a big cube from smaller ones? Something like this? If so, use the code I posted and the code posted by User137. That should do the trick.

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •