• What do you need help with? Version 1
    5,001 replies, posted
[QUOTE=ZeekyHBomb;23586807]You might also wanna do ( c = getchar() ) != '\n' && i < 100 so it doesn't overflow. Or use the fgets function.[/QUOTE] Good idea.
What would you guys say is the most common 3D model format people use in games?
Don't most games use custom formats? Maybe the md3 format, as the q3 engine has been used quite a lot in the past. It's probably a bit dated though.
Well, what if I wanted to make a simple beginner 3D game and don't want to make my own models. What is the most wide spread model type that I could get for free?
I think the OBJ and 3DS format are supported pretty widely.
Then you should probably consult Google about free 3D model sites of models, that fit your game and look which format those have. Alternatively, you can also write a converter that converts models from some widely available format (e.g. COLLADA) to your format and simply use 3D modeling tools to import the models you want, convert them to COLLADA and use your converter on it. Or use COLLADA models in your game, so the converter-step falls out.
[QUOTE=ZeekyHBomb;23588356]Or use COLLADA models in your game, so the converter-step falls out.[/QUOTE] As far as I know, Collada is [B]supposed to be[/B] an intermediate format.
Well, my first thought went on a conversion tool. You can still directly use it though. There's nothing really wrong with that I think, apart from some benefits you'd get with a binary format.
Oh God... XML. This thing will be a joy to figure out, I'm sure. Ohohohoho and the specifications only have 378 pages! Woooo!
Not sure what your problem is. XML is a popular markup language. And you could just only lookup and implement what you need of the COLLADA format if you don't want to read its full specification. Plus the "Core Elements Reference" is only around 150 pages.
That's all great except that I really don't want to do it. Just thinking about parsing that stuff gives me a headache. I know it's not really complicated but it's boring as hell. Are there any APIs for loading models into a format usable by OGL?
I have a function that loads an .obj model. Tell me if you want it.
[QUOTE=Darwin226;23590624]That's all great except that I really don't want to do it. Just thinking about parsing that stuff gives me a headache. I know it's not really complicated but it's boring as hell. Are there any APIs for loading models into a format usable by OGL?[/QUOTE] Perhaps check out the source of irrlicht, since that supports obj files.
Does anybody know how the change the near and far clipping planes in OpenGL without switching away from an isometric view? glFrustum and gluPerspective both switch to an isometric view, and I'm not all that sure what glOrtho is supposed to accomplish, so I'm totally lost here. I'm currently using [cpp] glClear( GL_COLOR_BUFFER_BIT ); glMatrixMode( GL_PROJECTION ); glLoadIdentity(); double dDist = std::sqrt( 1.0 / 3.0 ) * ( std::sin( dTimeAlive ) + 1 ); gluLookAt( dDist, dDist, dDist, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0 ); glMatrixMode( GL_MODELVIEW ); glBegin( GL_LINES ); glColor4d( 1.0, 0.0, 0.0, 1.0 ); glVertex3d( 0.0, 0.0, 0.0 ); glVertex3d( 1.0, 0.0, 0.0 ); glColor4d( 0.0, 1.0, 0.0, 1.0 ); glVertex3d( 0.0, 0.0, 0.0 ); glVertex3d( 0.0, 1.0, 0.0 ); glColor4d( 0.0, 0.0, 1.0, 1.0 ); glVertex3d( 0.0, 0.0, 0.0 ); glVertex3d( 0.0, 0.0, 1.0 ); glEnd();[/cpp]
You are supposed to use glOrtho for an isometric view actually. That function has a zNear and zFar parameter.
[QUOTE=Overv;23593923]You are supposed to use glOrtho for an isometric view actually. That function has a zNear and zFar parameter.[/QUOTE] Okay, let me try it out real quick. Thanks! [editline]I need text here for some reason, manual editline ftw[/editline] Worked fine, many thanks. To 'zoom out' I would decrease the first four arguments of glOrtho, correct? [cpp] //Project an isometric view glMatrixMode( GL_PROJECTION ); glLoadIdentity(); glOrtho( -1.0, 1.0, -1.0, 1.0, -10.0, 10.0 ); //Everything is the same at every distance glRotated( 35.264, 1.0, 0.0, 0.0 ); //Tilt the view downward glRotated( -45.0, 0.0, 1.0, 0.0 ); //And rotate glMatrixMode( GL_MODELVIEW ); glBegin( GL_LINES ); glColor4d( 1.0, 0.0, 0.0, 1.0 ); glVertex3d( 0.0, 0.0, 0.0 ); glVertex3d( 1.0, 0.0, 0.0 ); glColor4d( 0.0, 1.0, 0.0, 1.0 ); glVertex3d( 0.0, 0.0, 0.0 ); glVertex3d( 0.0, 1.0, 0.0 ); glColor4d( 0.0, 0.0, 1.0, 1.0 ); glVertex3d( 0.0, 0.0, 0.0 ); glVertex3d( 0.0, 0.0, 1.0 ); glEnd();[/cpp] [editline]Woo, another manual editline![/editline] Yup, editing the first four arguments works to zoom. Thanks again!
[QUOTE=Overv;23586207]Well, to start off, it skips half of the characters because you're reading half of them with the getchar() in your for loop condition, while not storing the value. You're also not adding a null terminator to the array anywhere. This is how it should be:[/QUOTE] getchar() returns a int, unless the C++ standard changed the return value.
[QUOTE=Overv;23591038]I have a function that loads an .obj model. Tell me if you want it.[/QUOTE] Please.
How hard would it be to make an application that enables me to talk on skype while playing sounds in the background? I can switch between Mic input and Stereo mix in Skype, but there's no option for both at the same time. After doing that, would it be possible to only use microphone and every other sound on the computer except Skype so that people in the call don't hear themselves talking?
How would I go about creating a mesh programatically with irrlicht? I can't seem to figure it out
I'm not really sure if you guys help out with really simple questions, but I just can't figure this out. I'm using C# XNA and was checking out the Platformer example that came with it. I managed to add scrolling to it and some other stuff, but what I want to do now is to delete one of the tiles while in-game. The levels are loaded from txt files with an ascii character for each tile. I want to remove a tile I'm clicking on but I don't know how the whole process works. I suppose I need to find the location of my mouse and retrieve which tile I'm on by getting it from the txt file. But I'm not sure how to do this in code. Could anyone help me out? Thanks.
That's actually pretty close. The problem is, it probably only loads from the file once so changing that won't matter. You should look up how exactly it stores the tiles, probably a List or an array or something. Then delete the tiles from that. As for getting the correct tile, get mouse coordinates, divide by tile width or height, floor the value.
Would this be ok to find the mouse coordinates? [code] private int mposx; private int mposy; Vector2 tilehovered; [/code] [code] int X = (mposx) / Tile.Width; int Y = (mposy) / Tile.Height; MouseState mState = Mouse.GetState(); mposx = mState.X; mposy = mState.Y; tilehovered.X = mposx / Tile.Width; tilehovered.Y = mposy / Tile.Height; [/code]
Why are you doing it twice? Besides that, yes. It seems good to me.
I can't seem to find how they are stored, only things I can find is how they are loaded and read from the txt file. Take a look at level.cs. [url]http://pastebin.com/AptXE4wL[/url] Argh I missed this. Could this be it? [code] List<string> lines = new List<string>(); [/code]
[QUOTE=Chris220;23635950]How would I go about creating a mesh programatically with irrlicht? I can't seem to figure it out[/QUOTE] Retoast for new page
Bit of a math problem here. Got a webcam image, trying to track orange blobs and find their startpoints and endpoints, so I can get their position and size. However, my code only seems to find where they finish, so to speak: [cpp]color = getColor(x,y,img); if(color == 3) { //if color is orange if(getColor(x-stepHoriz,y,img) == 3 || getColor(x+stepHoriz,y,img) == 3 || getColor(x,y-stepVert,img) == 3 || getColor(x,y+stepVert,img) == 3 || getColor(x-stepHoriz,y-stepVert,img) == 3 || getColor(x+stepHoriz,y-stepVert,img) == 3 || getColor(x-stepHoriz,y+stepVert,img) == 3 || getColor(x+stepHoriz,y+stepVert,img) == 3 ) { //check if any neighbouring pixels are also orange //oh and stepVert/stepHoriz are both 1 right now. if(blobFound == 0) { blobX1=x; blobY1=y; blobFound=1; } else{ blobX2=x; blobY2=y; } } } else { if(blobFound == 1) { blobFound=0; } }[/cpp] It's confusing as hell and I think it's because blobX1 and blobX2 keep being set to the current x,y coordinates I'm checking, but that's why I have the 'blobFound' variable...
[QUOTE=Chris220;23635950]How would I go about creating a mesh programatically with irrlicht? I can't seem to figure it out[/QUOTE] What you mean like, mesh editing?
I'm not sure, is that what it's called? Let's say I want to generate a big square of terrain on the fly, so I assume I'd need to generate a grid of vertexes to use (let's say a 32x32 array of Y values for instance). How would I then put these values into a mesh in irrlicht?
[QUOTE=Chris220;23636896]I'm not sure, is that what it's called? Let's say I want to generate a big square of terrain on the fly, so I assume I'd need to generate a grid of vertexes to use (let's say a 32x32 array of Y values for instance). How would I then put these values into a mesh in irrlicht?[/QUOTE] That's more complicated than it sounds. You could try messing with irr::scene::IMeshBuffer but that's not ideal. Ask on the irrlicht forums.
Sorry, you need to Log In to post a reply to this thread.