Jump to content
  • Advertisement

theunicorn

Member
  • Content Count

    28
  • Joined

  • Last visited

Community Reputation

140 Neutral

About theunicorn

  • Rank
    Member
  1. theunicorn

    Is std::set any good?

    Yes it would be (depending on the data and sort algorithm) since it would put the objects in the correct order right the way. A thought about your implementation though, why would you want to create this every frame? It would be more effective to keep this list in memory and just update it on changes.
  2. theunicorn

    Smooth User Input (Keyboard)

    You could use these but since there is such a long time between frames I have another idea. Why not run the check-input function several times in each frame. That would probably be better, I think. I would not recommend using a different thread though, other then WindProc, since you in that case must set the priority way down to not make the performance of the program worse, for single core processors.
  3. theunicorn

    shading with a palette ?

    Well, my thought was that it was lightning dependent but if not then I understand you. But I'm still wondering if it will look good, and after that find a solution. You could try and make a triangle in Photoshop and interpolate correctly there. Then limit the colors. I think you will find it looks very strange but that is just a guess. I would probably stick with flat shading or some sort of texture if possible.
  4. theunicorn

    shading with a palette ?

    First of all let me tell you that I'm not entirely sure if it works or not. It seams hard however since normal interpolation simply use the different components to create an "accurate" approximation. It seams hard to do this since you pallet could consist of several different color values in different places. I don't entirely understand why you would like to limit yourself to such a pallet, could this be because you want to create a cell shading effect and if so I would recommend using three components and then limit the colors. Another thing you should consider is whether or not you want to use gouraud shading in a software renderer. I would personally recommend you use flat shading and divided the model up, while rendering, into triangles no larger then a pixel in the finished rendering.
  5. theunicorn

    water edges

    Sure, you could of course add foam but would that really be realistic. I would primarily try two things. First would be to make a darken mask over the area covered by water. Secondly try and remove some of the specularity of the land (if possible). Another thing you could try would be too increasing the refraction more quickly (by changing the depth factor). I’m not entirely sure if a sharpen edge should be apparent, perhaps it’s better if it’s diffuse. I would just like to say that I really love your water, especially the waves looks very nice. This picture show the lesser specularity on the ground I was talking about. http://www.galleri.andeoliv.com/lake3a.jpg This picture show the darker (in this case because of mud) http://privat.sommarskog.se/Argentina/Mellan/Flamingos/736-first-lake.JPG Now I'm assuming that this is a lake, from what I can see in the picture. If it is ocean meeting land I would use foam.
  6. theunicorn

    Microsoft VC++ or Dev-C++?

    Yeah, pointless ;) I would however recommend Visual Studio. I could start naming a lot of reasons for doing so but lets just say this, I can't think of any reasons for using Dev-C++ over Visual Studio. A few reasons for using Visual Studio: ¤ Better debugging ¤ [...]several more ¤ Everyone else is using it (very important, okay perhaps not everyone) ¤ It's free now with the express-edition I personally think that the visual studio IDE works a lot better but that is my opinion.
  7. theunicorn

    XNA Camera Positioning

    Edit: just a bit to late, the article mentioned may explain better then me :) I'm not entirely sure if this order is the same in XNA as it is in directX(c++), managed directX (c#) or glut(opengl) but the CreateLookAt-function is what you should work with. You will most likely only need the projection-matrix to set near and far clipping plane to begin with, the rest is already in place. The first parameter in the CreateLookAt-function is the position-vector, the position of the camera. Note that if you where to use Vector(0,0,20) you would be closer to the center. The second vector is the vector the camera should be looked at. Note that this parameter is in world space meaning you simply specify the point in the world you want the camera to look at, in this case the center of the world (0,0,0). The last vector specify the up-vector, think of a rolling camera, this can be changed with this, this doesn't use world-coordinates but local coordinates. By modifying the vectors, please start with the first two and then go over to the up-vector. If you decided to use your own calculations for the position or or any of the other vectors then make sure to convert to world space where appropriate, by adding (?? or subtracting?? ) the position.
  8. no, this is not what I meant. The only thing you checks now is the time it takes the computer to set two variables. What you should do is check the time since last frame. For example you end the update function with a call to QueryPerformanceCounter(&timeStart) and start with the QueryPerformanceCounter(&timeEnd). Used in your code: // timer stuff LARGE_INTEGER timeStart; // These could be replaced by long LARGE_INTEGER timeEnd; LARGE_INTEGER timerFreq; float anim_rate; WinMain { QueryPerformanceFrequency(&timerFreq); while( msg.message!=WM_QUIT ) { if { } else { QueryPerformanceCounter(&timeEnd); anim_rate = ( (float)timeEnd.QuadPart - (float)timeStart.QuadPart ) / timerFreq.QuadPart; //game procease positionX+=(20*anim_rate ) positionY+=(40*anim_rate ) // QueryPerformanceCounter(&timeStart); // Here your rendering should go } } } Good luck! Oh, and by the way. I'm not sure what kind of value you get out when you calculate your value since I always work with milliseconds however your speed seems very big with this approach.
  9. Hi First of all the problem doesn't lie in the ID3DXSprite, it's in your update function. Now I couldn't access the file so I'll just assume you haven't done the following. The movement of the character should be calculated by taking: postionX += (currentTime - lastUpdated) * speed; The position is calculated by taking the time between updates times the speed you want the picture to move. To get the time, if you are currently working with sleep or similar, i either use getTickCount() of high precision alternative (using the QueryPerformanceFrequency and the QueryPerformanceCounter functions). A large number of update creates a smoother motion and therefore you should make sure that the rendering isn't slowed down in some way, sleep for example. This picture will therefor run smother on faster machines. Good Luck! Johan Bernhardsson
  10. theunicorn

    Black Window Question

    The error you are getting is due to the fact that Visual Studio 2005 uses unicode versions of functions as standard, wchar_t instead of char. This can be change in the sollution. Otherwise you will have to use the widecharfunctions instead of the normal ones if they are to work with DirectX and WinAPI. An easy soluttion for your problem might be to simple use the L"" instead of the "". Please not that you also often can specify which functions to use. For example the CreateWindow-function has a CreateWindowA and a CreateWidnowW and when the using the CreatWidnow-function the Unicode version will be picked. Good luck to you.
  11. This is the way I have solved similar problems: Download dependencywalker from http://www.dependencywalker.com/ and run the program with it on your friends computer. The dlls not found on your friends computer will show up red. Also if the project is in C++ then try and install the Microsoft Visual C++ 2005 Redistributable Package on you friends computer. (http://www.microsoft.com/downloads/details.aspx?FamilyId=32BC1BEE-A3F9-4C13-9C99-220B62A191EE&displaylang=en)
  12. I have had a similar problem with VS 2005 Express. My problem stranger still since it disappeared when I removed a line that wasn’t supposed to be read by the program. The error disappeared later on and I never looked further into it. The only advice I can give you is to try and clean both the debug and release directories and do a complete rebuild. Not just rebuild but clean and the build. Also try and remove the ncb-database file and rebuild again. Best of luck to you
  13. 1. I only did a few very basic tutorials before trying to implement 3D into my own engine. After that I read trough some samples and added functionality. 2. toymaker.info and gamedev where my two sources in the beginning. Read about 50 or so pages in the forum in a row. 3. I read Real-time 3D terrain engines using C++ and DirectX 9 by Gregg Snook and I found it very helpful. 4. I didn't when starting out and because of my very limited knowledge of Math when I begun I probably should. I would recommend people to do so but I doubt I would have still. 5. I had worked some with SDL before starting with Direct 3D but very little. There are differences sure but I think that a basic 3D-engine is as easy as a good 2D-engine. 6. Yes, not all the documentation at first since there is so much information but before the project I was working on was completed I had read most of it.
  14. theunicorn

    Animation with X-files

    I have not tried the latest version of the Maya exporter but when trying the February release, I think, I had big trouble using a skinned mesh. The reason for this was that the animation data for some reason wasn't exported together with the x-file. I earlier version the exporter had a command to gather animation but I failed to see it in that version.
  15. theunicorn

    Untextured Mesh

    Can you post the source code for your rendering function. To me it sound as you simply has forgotten to use the d3ddevice->SetTexture function.
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!