• Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

144 Neutral

About MrBeaner

  • Rank
  1. This is my first complete trance track. thoughts on how i could make it better would be great! Sedona Sky thanks!
  2. Quote: You've got myColour set to black and fully opaque - you're not clearing the back buffer to black are you (so it is drawing, it's just you can't tell?) Change the back buffer clearing to something obvious like lime green just to test. that did it! nice job! its there, but now its a wierd line. i think maybe i should check the camera angle now. thanks a lot!
  3. thanks for the help, but that didn't do it. maybe i'm looking at it incorrectly?
  4. hello- i am not sure what i am doing wrong, but i can't get the quad to render. directx is set up properly, i can render things, but i can't get the quad class to do its thing. i think it might be the way i am describing the quad. Here is the functiont to create the billboard: void cBillboard::CreateBillboard() { HRESULT r; VOID* pVertices; v = new CUSTOM_VERTEX[4]; //create the vertical info. //thisprobably cold only happen once if the billboard isn't changing, but it works for now v[0].x = 0.0f; v[0].y = 0.0f; v[0].z = 0.0f; v[0].color = myColor; v[0].u = 0.0f; v[0].v = 1.0f; v[1].x = myWidth; v[1].y = 0.0f; v[1].z = 0.0f; v[1].color = myColor; v[1].u = 1.0f; v[1].v = 1.0f; v[2].x = myWidth; v[2].y = myHeight; v[2].z = 0.0f; v[2].color = myColor; v[2].u = 1.0f; v[2].v = 0.0f; v[3].x = 0.0f; v[3].y = myHeight; v[3].z = 0; v[3].color = myColor; v[3].u = 0.0f; v[3].v = 0.0f; r = VB->Lock( 0, 0, (VOID**)&pVertices, 0 ); if(r != D3D_OK) { gLog<<"cBillboard: Failed to lock vertex the buffer. "<<DXGetErrorString(r)<<endl; return; } memcpy(pVertices, v, sizeof(v)); VB->Unlock(); } here is the render code: void cBillboard::render() { D3DXMATRIX final, trans; D3DXMatrixIdentity(&final); D3DXMatrixTranslation(&trans, Position.x, Position.y, Position.z); D3DXMatrixMultiply(&final, &final, &trans); Game->GetDX()->GetRenderer()->GetDevice()->SetTransform(D3DTS_WORLD, &final); gLog<<"rendering."<<endl; Game->GetDX()->GetRenderer()->GetDevice()->SetTexture(0, myTexture); Game->GetDX()->GetRenderer()->GetDevice()->SetStreamSource(0, VB, 0, sizeof(CUSTOM_VERTEX)); Game->GetDX()->GetRenderer()->GetDevice()->SetFVF(FVF()); Game->GetDX()->GetRenderer()->GetDevice()->DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 1); } here is the constructor: cBillboard::cBillboard(LPDIRECT3DTEXTURE9 Texture, float x, float y, float z, float tu, float tv, UINT w, UINT h) { myTexture = Texture; SetPosition(x, y, z); texu = tu; texv = tv; myColor = D3DCOLOR_ARGB(255,0,0,0); myWidth = w; myHeight = h; v = 0; VB = NULL; HRESULT r; r = Game->GetDX()->GetRenderer()->GetDevice()->CreateVertexBuffer((4*sizeof(CUSTOM_VERTEX)), 0, FVF(), D3DPOOL_DEFAULT, &VB, NULL); if(r != D3D_OK) { gLog<<"cBillboard: error creating vertex buffer. "<<DXGetErrorString(r)<<endl; delete this; } CreateBillboard(); } any ideas would be greatly appretiated.
  5. Alpha blending problems

    Thanks for the reply- is that what i should do? I am just making a title screen. should the buttons just be billboards or point sprites?
  6. i am trying to copy some images using stretchrect()from a file that has an alpha channel, but i get white where the alpha should be. i am loading a png file. i am enabling the render states, but i think it might be different because i am copying directly to the back buffer. How do i load and use alpha information for copying directly to the back buffer?
  7. XACT

    i am trying to link XACT, but i am having some problemss with the xact.h file. here is the error code: 25:1 pasting "1f1b577e-5e5a" and "-" does not give a valid preprocessing token here is the line of code in xact.h: DEFINE_CLSID(XACTEngine, 1f1b577e, 5e5a, 4e8a, ba, 73, c6, 57, ea, 8e, 85, 98); i am using DEV c++. thanks in advance-
  8. um... something like this happended to me recently. i don't know what went wrong, but i ended up resaving the bitmap and it loaded without any change in the code. I'm not even sure why, but it solved the problem. maybe there is something wrong with the bitmap itself.
  9. I Need Game Combat system

    Quote:Original post by geekalert he's talking about game engines actually, heh, he is talking about tabletop roleplaying games. some use a six sided die, while others use a 20 sided die. God, i am such a nerd.
  10. cout to console in SDL

    Quote:Original post by Oluseyi Adding Console I/O to a Win32 GUI App. thanks for the link.
  11. OpenGL Coordinate systems.

    ok. when you draw a quad on teh screen, and you give it glVertex3f() what you are doing is telling OpenGL what your model *looks* like. 1.0f is on the local coordinate system relative to the object you are defining. in OpenGL you define the model, then you *translate* it to the world. Lets say that you want to zoom in and out on the quad. FOr this to happen, you need to translate the quad from it's local coordinate system into the world so that you can calculate how far the camera is away from it. I hope this makes sense.
  12. i think what you are asking is to rotate the tail of the can differntly from the head. The only demension i can think that you will be able to rotate your cylinder is on the Z axis, without changing the location of the head. Now, if you wanted to rotate 30degrees Z, 20degrees Y, and 10degrees X i'm not sure what the math is behind it, but if you make three calls to glRotate it will combine the matrixs then apply the calculations to the points. It's doing the math for you.
  13. many a [Build Error] when compiling source examples

    Do they say "ERROR" or "WARNING"? If it is a warning, DEV c++ is just telling you that you have a compiler parameter set that the makefile.win is different from, so it is ignoring the makefile. It should still run as long as they are warnings.
  14. OpenGL 2D Cordinate Settings in openGL?

    well, side from the operating system code to open the window at the proper demensions, to create a quad at 50,50 it is this: //this loads a "fresh" matrix onto the stack glLoadIdentity(); //this creates a translation matrix that all points that follow will be //applied to. glTranslate3i(50,50,0); //you would get this value by figuring out where in the //world teh object needs to be this frame. //OpenGL we are drawing a square glBegin(GL_QUAD) //define the object glVertex3i(-1, -1, 0);//bottom left glVertex3i(-1, 1, 0);//top left glVertex3i( 1, 1, 0);//top right glVertex3i( 1, -1, 0);//bottom right //we are finished drawing this object glEnd(); //lets pop the matrix from teh stack so it doesn't fill our memory glPopMatrix(); //lets force gl to draw glFlush(); the theory is this: when we define the object, we are creating a "model" of what we think it should look like. when we apply glTranslate3*, we are telling OpenGL where we want to move our model into the "world". this is called the modelling transformation. Our model of a square is centered on the origin, or (0,0). Calling glTranslate3* is like saying "Please move my model to these coordinates." Its not exactly that, but for right now if you can think of it in this way it helps. Also note that we are translating first, then defining. in effect when you call glVertex3*, OpenGL creates a vertex by applying the already defined matrix onto the points you specify. You still need to add color if you want to see the object, and i doubt this code is free from errors. but the steps outlined above will draw a primitive to the screen. In order to open a window you need to write Operating specific code that opens a window. i don't want to explain it here, because it is not short, but it is not difficult to understand. check out [link]www.nehe.gamedev.net[/link] for tutorials on opening a window in different OS's, as well as drawing different things. I would really recommend reading some tutorials. this little thing i wrote here is far from complete. i hope this helps.
  15. If Statements

    Quote:Original post by The Rug With that in mind, you are using the assignment operator "=" as an evaluator. That doesn't work, and can produce some nasty bugs! You use == to see if 2 variables are equal: if ( icecream = 1 ) needs to be if ( icecream == 1 ) edit: Damn, beaten. But I have mr T. So there! [grin] that is such a programmer joke. :)
  • Advertisement