K^2 Posted February 16, 2008 Share Posted February 16, 2008 ALL I want is a place to load models and type in the coords where they should be on sometext file, start an exe, and see them. That's all. Why is it so difficult to make an empty space for creating a world in?? I don't mean to offend you, but this made me laugh a little bit. Yeah, it all sounds very simple, and it really is, but there is a lot of stuff going on. Before you even start creating your 3D world, you must have a place to render it. That means, first of all, asking OS to open a Window. Then you want to create a rendering context, which includes setting up properties of various buffers, and bind it to your window. That takes about 3-5 pages of code depending on a few things. At this point, you are ready to put something on the screen. So now you want to read in 3D objects. Well, you want to understand the file format that they are stored in, create structures that will hold the data for them, and then read the file contents into these structures. Keep in mind the fact that you'll have to adjust a lot of things as you go along with that. So now you have the models in memory. Time to figure out where to put them. You must read the text file with coordinates, parse them to get actual values you want. Once you have coordinates for each object, you are going to start the rendering process. You will position a camera, or rather shift world relative to camera by loading an identity matrix and transforming it. Then, for each object, you will push the model view matrix, transform the top matrix, render the object, and pop the matrix so that you are back in world coordinates. The rendering itself does happen to be straight forward. You simply have to iterate over all meshes, then over each triangle in the mesh, and render it by grabbing the correct vertecies for it. At this point, depending on the file format, you are looking at about 20 pages of code. And you haven't even started doing anything. As for my sprites, i think that is what K^2 means, since he said "on the fly", but that would be way harder. I would have to not only create 3D models but read it into my program and draw it. Trust me, after you are done with your game, that will not look anywhere near being the toughest part. btw, does K^2 go to shcool? I thought he was older than me, or do you mean uni? He probably meant university. I'm a Ph.D. candidate right now. Hopefully, will have a Ph.D. in another 2-3 years. Prior to filing a bug against any of my code, please consider this response to common concerns. Link to comment Share on other sites More sharing options...
derty Posted February 16, 2008 Author Share Posted February 16, 2008 (edited) Thank you k^2, I knew I wasn't retardd, it IS hard! lol Indeed I meant uni, but just "school" is enough from where I'm coming from, school is considered k - 12 - grad So it's all encompassing cause most people go to college/uni these days yar, my bubble is bursted k^2, but it was a scary and mean bubble, and I'm glad it is gone <3 edit: Isn't this already nearly everything you mentioned? Shouldn't I be able to add/edit a couple lines of code and be on my way? #include <irrlicht.h>using namespace irr;using namespace core;using namespace scene;using namespace video;using namespace io;using namespace gui;#pragma comment(lib, "Irrlicht.lib")int main(){IrrlichtDevice *device = createDevice(EDT_SOFTWARE, dimension2d<s32>(1280, 1024), 32, false, false, false, 0);device->setWindowCaption(L"Hello World! - Irrlicht Engine Demo");IVideoDriver* driver = device->getVideoDriver();ISceneManager* smgr = device->getSceneManager();IGUIEnvironment* guienv = device->getGUIEnvironment();guienv->addStaticText(L"Hello World! This is the Irrlicht Software renderer!", rect<int>(10,10,200,22), true);IAnimatedMesh* mesh = smgr->getMesh("../../media/sydney.md2");IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh );if (node){ node->setMaterialFlag(EMF_LIGHTING, false); node->setFrameLoop(0, 310); node->setMaterialTexture( 0, driver->getTexture("../../media/sydney.bmp") );}smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0));while(device->run()){ driver->beginScene(true, true, SColor(255,100,101,140)); smgr->drawAll(); guienv->drawAll(); driver->endScene();}device->drop();return 0;} Edited February 16, 2008 by derty Link to comment Share on other sites More sharing options...
K^2 Posted February 16, 2008 Share Posted February 16, 2008 Bah, you're using some weird libraries. You never going to learn if you do that. But if you just need something that works, yeah, that's almost all of it. If it's not working, you might be missing some calls to some inits in the library, check the docs. Other than that, you probably just need to write your own parser for the file that will contain positioning info. Prior to filing a bug against any of my code, please consider this response to common concerns. Link to comment Share on other sites More sharing options...
derty Posted February 17, 2008 Author Share Posted February 17, 2008 Talk to me from that other planet <3 Ok, you told me Dev-CPP and open gl, right? Let me know what you recommend, and if it is available in the package manager of DCPP? I plan to learn C++ D3D in the long run, but for now, open GL, only because I am so new. I don't know man, it's so frustrating. Do you use that NeHe template or whatever from DevCPP? What is the end all be all with the biggest community and best docs, I guess? Cheers K^2 The libs are irrilicht stuff. Link to comment Share on other sites More sharing options...
K^2 Posted February 17, 2008 Share Posted February 17, 2008 If you go by NeHe tutorials, all you need is opengl32.lib and glu32.lib. They are both in the Dev-C++ package. You'll have to create a project, and in the project's options there is a place where you can add libraries. They are in Dev-Cpp/lib/ folder. Add these two to the list, and you should be able to compile NeHe code. For DirectX, you probably want to go with VC++. I never managed to get Dev-C++ to compile some of the MS code. Not that I tried all that hard, but with VC++ it works out of the box. I guess, MS only cares about their code compiling on their own compiler. Prior to filing a bug against any of my code, please consider this response to common concerns. Link to comment Share on other sites More sharing options...
xtal256 Posted February 17, 2008 Share Posted February 17, 2008 As for my sprites, i think that is what K^2 means, since he said "on the fly", but that would be way harder. I would have to not only create 3D models but read it into my program and draw it. Trust me, after you are done with your game, that will not look anywhere near being the toughest part. Ha ha. I never said it would be the hardest part. There will be way harder parts but i don't want to waste my time on something that you just told Derty would take 20-30 pages of code (mind you, i could do that fairly easily and have done a few things like that before). Link to comment Share on other sites More sharing options...
derty Posted February 17, 2008 Author Share Posted February 17, 2008 I've got it all installed, so we'll see how that pans out. I'm on the learning path I suppose, and they say that frustration is part of it In the meantime, what have you in the news of your engine? uni very busy? Link to comment Share on other sites More sharing options...
xtal256 Posted February 18, 2008 Share Posted February 18, 2008 I have a suggestion for your game engine. You should be able to have animated or moving textures. This would be good for things like flashing signs, animations such as movies or moving textures like conveyor belts. I say this because i have made some models for GTA3 and that was one of the main things that i wanted to have. Link to comment Share on other sites More sharing options...
derty Posted February 18, 2008 Author Share Posted February 18, 2008 Yea, that stuff will be a given. One feature I want is to have the game regard 0,0,0 in world space as "down" So, basically, gravity, not just up and down = z. So I can make it globular, instead of flat. I am watching all of the Washington State C++ videos, hopefully I learn something Link to comment Share on other sites More sharing options...
xtal256 Posted February 18, 2008 Share Posted February 18, 2008 Yea, that stuff will be a given. Well it obviously wasn't in GTA3. And VC and SA don't have animated/moving textures do they? Of course, your game engine will be way better than GTA What i was thinking in terms of implementation is that each texture would have not only an (x, y) position (often referred to as u,v) but a uInc and vInc, increment variables. They tell the game how many pixels to move the texture by per frame (or second). Since not all textures will move, these values may be left out to save space. If you are writing the game in C++ with classes it would be something like this: class Texture { int u, v;}class MovingTexture : public Texture { <-- this bit means that MovingTexture inherits all values from Texture int uInc, vInc;} Then you can also have AnimTexture which has an array of frames and a speed variable. Link to comment Share on other sites More sharing options...
K^2 Posted February 18, 2008 Share Posted February 18, 2008 Maybe we should model entire spacetime as a 4D-manifold built out of locally R4 4D hyper-simplex shapes, just like 3D objects in games are built out of polygons? Then you can have whatever gravity you want, as well as black holes, wormholes, and any other crazy thing you can think of. Granted, rendering something like that would be a bit problematic. Silly graphics accelerators aren't designed to handle 4D spaces very well. But it would be fun, no? Prior to filing a bug against any of my code, please consider this response to common concerns. Link to comment Share on other sites More sharing options...
derty Posted February 19, 2008 Author Share Posted February 19, 2008 (edited) I'd not know where to start However, the same is true about me being able, rather, unable to create the real time rotations of physical objects to always know "0,0,0 is down" So that if the object is at -5000.0 Z on some mountain peak, it would know to have the camera upside down, and to have the object upside down, falling "up" toward 0,0,0, if there is no collision... You see? I bet euphoria would be the easiest one to make characters adapt to this, they'd automatically stand up against the force of programmed gravity, the dynamic pointer to "down". Curvulinear aspect wouldn't even matter, as the game would still be flat, just patched out and back together... Think of polygons, and longitude... those could be zones that carry one master "downward" It's so possible, one day it will happen. I really want to do something easier though... To already have an audience when it begins development, to already have a team. One that was built by creating something a little more... realistic... in terms of current assets, as well as more mainstream but with our own quirks that make the project stand out. Haro, indeed SA had UV anim, Remember Las Venturas casino strips? sh*tting pants and monkey chest banging, I r dertyboredian Edited February 19, 2008 by derty Link to comment Share on other sites More sharing options...
K^2 Posted February 19, 2008 Share Posted February 19, 2008 So that if the object is at -5000.0 Z on some mountain peak, it would know to have the camera upsidedown, and to have the object upside down, falling "up" toward 0,0,0, if there is no collision... You see? I bet euphoria would be the easiest one to make characters adapt to this, they'd automatically stand up against the force of programmed gravity, the dynamic pointer to "down". It's a trivial transform. You grab the current location vector, normalize it, and call it the Z axis vector. You then grab an arbitrary unit vector perpendicular to it and call it your X vector. Finally, Y=ZxX, and you build a transform matrix [X,Y,Z]. Now, multiply the current modelview by that matrix, and whatever you were rendering is now feet towards <0,0,0> Prior to filing a bug against any of my code, please consider this response to common concerns. Link to comment Share on other sites More sharing options...
xtal256 Posted February 19, 2008 Share Posted February 19, 2008 Haro, indeed SA had UV anim, Remember Las Venturas casino strips? Yes, but can you make your own or is it hard-coded into the game. GTA3 has the scrolling LED text displays at the airport but that is hard-coded into the game. Link to comment Share on other sites More sharing options...
derty Posted February 19, 2008 Author Share Posted February 19, 2008 oy, K^2, too much for me to translate Haro, yes, you may make your own thanks to Deniska's max script. SA only. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now