• Welcome to Dark Bit Factory & Gravity.
 
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - NaniBot

#1
Too fast? On my pc it runs normal.... the rotation speed is 0.5f.
#2
Quote from: ninogenio on August 10, 2013
excellent NaniBot!!!,

k++ for sticking with it. that looks really cool, multiple objects seem hard at first but simple for loops can draw many thousands of instances of the same object if required.

its the exact same thing for the old large 2d tilemaped games like zelda etc the world map is usually tilemaped using a relatively small selection of tiles and just drawn hundreds of times with a few lines of code.

as a good little practice exercise how about adding a y axis for loop around the x axis one you already have too draw a couple of lines of triangles?

with just another line of code you could have x and y grid mapping.

Working on it ...(THX for the help :D)
#3
I created a few triangles using for loop...
#4
Quote from: ninogenio on July 18, 2013
right,

lets take a slightly different approach too this. lets work our way through the problem slowly. take it a step at a time and get you feeling the buzz of accomplishment for your hard work.

before adding the code i put up there. lets decide where a good place too add it might be.. as a first step i would like you too look very carefully at your code and tell me a few places where you think that snippet could go. ideally its going too go some where in the rendering phase.. then we can move on too actually adding it and making it work.

Umm...I think it should be inside DrawGLScene..

Like this maybe? :-\


int DrawGLScene(GLvoid)
{
void draw_chip(float x, float y, float z){
          glMatrixMode(GL_MODELVIEW)
          glPushMatrix();
          glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);   
          glLoadIdentity();
          glTranslatef( 0.0, 0.0f, -6.0f );
          glBegin(GL_TRIANGLES);
     glColor3f(1.0f,0.0f,0.0f);
     glVertex3f(0.0f,0.1f,0.0f);
     glVertex3f(-0.1f,-0.1f,0.0f);
     glVertex3f(0.1f,-0.1f,0.0f);
   glEnd();

       glPopMatrix();
}

int zsin=0;
void draw_chip_grid(void){
       int Grid_SizeY = 10;
       int Grid_SizeX = 10;
       for (int y = 0; y<Grid_SizeY; Y+=1 ){
            for (int x = 0; x<Grid_SizeX; X+= 1 ){
                  zsin += 0.2;
                  draw_chip(x+tilesize_x,y+tilesize_y,2.0f*sin(zsin/180.0*3.14159));
            }
       }
   }
}
#5
I don't know where to place the code. Please help..
#6
Ok...so i watched Razor1911's "Insert No Coins" and i was really

surprised to see the "rzr" chips. There were like 50 of them(The

objects that im referring to are rectangles with rzr written on

them). What i want to know is that how rez managed to "make"

them...I mean he is not that stupid that he will draw each of them

and change their vertices etc. He might have used something

which randomises the vertices of the chips in a specified range

(x,y,z axis). Also all the chips move up and down together...how

did rez did this?(I wanna know how he moves all of the chips as if

they are a single object). I would love to know how to do these

things.
#7
Quote from: ninogenio on July 16, 2013
here you go mate just quickly built.. ive commented the source too hopefully make it quite clear whats going on.. if there is anything your not sure of please don't hesitate too ask what its doing. ive attached your main source file with the changes along with a little exe that switches scenes every 3 seconds and loops back round on the 3rd scene.

Thank you very much.  :updance:
#8
Here is my c++ project file. (Dbf did not allow me to upload the .cpp file so i have uploaded a txt file)
#9
Quote from: ninogenio on July 10, 2013
yeah as combatking said,

you are going too need some sort of trigger too switch too each event.. a timer is the best option. also the switch method that ck suggested is good. just too expand a touch.

purely pesudo.


  void appinit( void ){
        //all init based stuff
        .....
        .....
        .....
        /////////////////////
        int effectMode = 0;
        systime timer;
        starttimer(timer);
  }

  void processStuff( void ){
       gettimesms(timer);
       switch(effectMode){
       case 0:
              // Code for a starfield
              if ( timer > 2000 ) effectMode += 1;
        break;
        case 1:
             // Code for a spinning cube
             if ( timer > 4000 ) effectMode += 1;
        break;
        case 2:
             // Code for a plasma effect
             if ( timer > 6000 ) effectMode += 1;
        break;
        if ( effectMode > 2 ){
             effectMode = 0;
             starttimer(timer);
        }
}


would switch effects every 2 seconds and loop back round.


Im very sorry if im being a noob but how do I place it in my source c++ file? And also do I have to include any more header files (xx.h)?
#10
Im running visual c++ 98 and Im kinda stuck. This is the code that I have in my drawglscene.
This code only rotates a 3D triangle. What I want to know ---> Is there anyway by which I draw things one after another? Like drawing a 3D rotating triangle first then after some seconds drawing a rotating cube?

-----------------------------------THE CODE-----------------------------------------------------------------------------------

int DrawGLScene(GLvoid)                           {
   glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);   // Clear Screen And Depth Buffer
   glLoadIdentity();
   glTranslatef(0.0,0.0f,-6.0f);
   glRotatef(rtri,1.0f,1.0f,1.0f);
   
   glBegin(GL_TRIANGLES);
     glColor3f(1.0f,0.0f,0.0f);                  // Red
      glVertex3f( 0.0f, 1.0f, 0.0f);               // Top Of Triangle (Front)
      glColor3f(0.0f,1.0f,0.0f);                  // Green
      glVertex3f(-1.0f,-1.0f, 1.0f);               // Left Of Triangle (Front)
      glColor3f(0.0f,0.0f,1.0f);                  // Blue
      glVertex3f( 1.0f,-1.0f, 1.0f);               // Right Of Triangle (Front)
      glColor3f(1.0f,0.0f,0.0f);                  // Red
      glVertex3f( 0.0f, 1.0f, 0.0f);               // Top Of Triangle (Right)
      glColor3f(0.0f,0.0f,1.0f);                  // Blue
      glVertex3f( 1.0f,-1.0f, 1.0f);               // Left Of Triangle (Right)
      glColor3f(0.0f,1.0f,0.0f);                  // Green
      glVertex3f( 1.0f,-1.0f, -1.0f);               // Right Of Triangle (Right)
      glColor3f(1.0f,0.0f,0.0f);                  // Red
      glVertex3f( 0.0f, 1.0f, 0.0f);               // Top Of Triangle (Back)
      glColor3f(0.0f,1.0f,0.0f);                  // Green
      glVertex3f( 1.0f,-1.0f, -1.0f);               // Left Of Triangle (Back)
      glColor3f(0.0f,0.0f,1.0f);                  // Blue
      glVertex3f(-1.0f,-1.0f, -1.0f);               // Right Of Triangle (Back)
      glColor3f(1.0f,0.0f,0.0f);                  // Red
      glVertex3f( 0.0f, 1.0f, 0.0f);               // Top Of Triangle (Left)
      glColor3f(0.0f,0.0f,1.0f);                  // Blue
      glVertex3f(-1.0f,-1.0f,-1.0f);               // Left Of Triangle (Left)
      glColor3f(0.0f,1.0f,0.0f);                  // Green
      glVertex3f(-1.0f,-1.0f, 1.0f);      
     glEnd();
    glTranslatef(3.0f,0.0f,0.0f);
   rtri+=0.5f;
   return TRUE;
}

#11
Can someone tell me what programming language do demogroups use nowadays? I mean is it c++ , c# , c or any other else? What does Razor1911  use?
#12
Projects / Re: 2nd Intro
July 05, 2013
That amiga ball was really nice. Also the collision detection.  :clap:
#13
I recently started opengl programming in visual c++ (VC98). Im running it on Windows 8 x64.
I just made a simple program that rotates a triangle along x, y and z axis. Actually im trying to make a 64k intro :D.
Now, I have a .xm sound file and I wanna know how to add it in my visual c++ project. Please teach me how to do this with minifmod. Im a n00b so please give me a full tutorial.