Jump to content
  • Advertisement

Winterhell

Member
  • Content Count

    46
  • Joined

  • Last visited

Community Reputation

115 Neutral

About Winterhell

  • Rank
    Member

Personal Information

  • Interests
    Programming
  1. Winterhell

    OpenGL tic tac toe

    He needs comments, a license agreement and a github source control page for the project. Single file with more than 100 lines of code is already too big of a project. Split it into 7 parts, and make it OOP. Don't forget to use delegates and interfaces for extensibility. Also move the engine to a separate dll.
  2. Hi, I'm making a 3d modelling program and so far it is good.I have implemented the camera control,picking, sub geometry editing, other tools like cut, extrude, chamfer, ring selections and others. It was all good until one day my modeller tipped me that the axes are incorrect, and that the Z+ "must" be Up. And in our case Y+ was Up, as I've always thought from numerous tutorials or documentations, and in camera space and in 2D Y was always up so I assumed wrong. In games this is not a problem because the models can be rotated by 90 degrees , but in the program we needed the correct version. Now, one 'hack' would be to change the icons and visual representations of the letters Z and Y , and save the file with flipped axes, but that is very dangerous and in case of a typo bug, we may never find the problem. So I tried to modify the camera controls, but I encountered a problem. When I tried to pitch the camera the axes seemed to behave unintendedly near the top and bottom point(zenith and nadir) ,but I need to be able to pitch indefinitely. Here is the Z+ Up version of the camera class public class Camera { public Vector3 pos, rot; public Matrix world, view, projection, rotMatrix; public Viewport viewport; public Vector3 at, up; public Camera(Viewport newViewport, Vector3 newPosition, Vector3 newRotation) { viewport = newViewport; pos = newPosition; rot = newRotation; Update(); } public void Update() { //if (rot.X > Math.PI/2) rot.X = (float)Math.PI/2; //if (rot.X < -Math.PI/2) rot.X = (float)Math.PI/2; Matrix.RotationYawPitchRoll(rot.Y, rot.X, rot.Z, out rotMatrix); Vector4 at4 = Vector4.Transform(new Vector4(0, 1, 0, 1), rotMatrix); at = new Vector3(at4.X, at4.Y, at4.Z); up = new Vector3(0, 0, 1); //Vector4 up4 = Vector4.Transform(new Vector4(0, 0, 1, 1), rotMatrix); //up = new Vector3(up4.X, up4.Y, up4.Z); view = Matrix.LookAtRH(pos, at+pos, up); projection = Matrix.PerspectiveFovRH((float)Math.PI /8f, viewport.Width / (float)viewport.Height, 0.1f, 10000.0f); } public void UseCurrent() { Image.world = world; Image.view = view; Image.project = projection; Image.viewport = viewport; } public void Rotate(Vector3 angle) { this.rot += angle; Update(); } public void Translate(Vector3 distance) { Vector4 tr = Vector3.Transform(distance, rotMatrix); pos.X += tr.X; pos.Y += tr.Y; pos.Z += tr.Z; Update(); } public void TranslateAbsolute(Vector3 distance) { pos += distance; Update(); } } This is really bothering me and I spent several days trying different ways to accomplish the view matrix, but there always were different complications. I suspect the problem is with the Up vector in the creation of the view matrix. I'm open to suggestions to create the view matrix by other means,like matrix multiplications. If necessary I can post the original working Y+ Up version which creates view matrix "manually" by multiplying position and rotation matrices. Thank you.
  3. Winterhell

    [SlimDX] Tri's versus Poly's?

    Hi, There is a problem with the 4-sided polygons. You cant make many objects with them, on at least not accurate. For example- Pyramid, which's sides are from triangles. Yes, the original Egyptian version is from cube-shaped stones, if you prefer that look. Things like rocks are especially problematic. If I remember correctly Sega Saturn supports only Quads, not triangles, so you can see how the games look. And onto your problem - you want more detailed geometry, well nowadays the number of vertices isnt the usual bottleneck. Also if you use triangle strips, one 4-sided polygon takes on average 2 vertices, opposite to 4 for 4-sided poly, or 6 for 2 paired triangles. There are more important things like shader complexity, overdraw, that trip the performance .
  4. Winterhell

    Harry Potter MMORPG

    Make a prototype AND hundreds of documentation pages ,then present to WB the idea. Otherwise no one is going to care.
  5. Hi, I need to make and interactive Java application(to be run without a browser,etc) I read the way is to insert an Applet inside a Form ,but I'm not sure how to do it. I've made the applet with its functions start,stop,init,run,paint;loading images, and it works perfectly. I'm using the awt libraries and i dont know anything about swift.Thank you.
  6. Winterhell

    Memory Leak ?

    for(int i=0;i<hpvalbar;i++) //hp 498 max { hpsprite->Begin(D3DXSPRITE_ALPHABLEND);// begin sprite drawing // draw the sprite D3DXVECTOR3 center(0.0f, 0.0f, 0.0f); // center at the upper-left corner D3DXVECTOR3 position(i+14, 17, 0.0f); // position at 50, 50 with no depth hpsprite->Draw(hpbarfiller, NULL, ¢er, &position, D3DCOLOR_ARGB(255,255, 255, 255)); hpsprite->End(); // end sprite drawing } You are drawing up to 498 bitmaps of the health bar.Try using one bar instead. other tips,begin and draw can be out-side the loop,thus executing them only once . also the declarations of D3DXVECTOR3s' can too be outside the loop. I haven't used D3D ,but the value you are changing should be something like position.x=i+14; actually you can make it position.x=13 outside the loop and then inside only increment with position.x++; This is only for this loop.Most of the time the bottleneck is in the loops,check all of them .
  7. Hi, About my 1st question: I am making some transformations with the GPU,eg. Particle systems,that need to interact with the environment 2-way.First way is events like wind or pressure affect the particles.The other way the same particles push objects. So how do I remember the positions of the particles between the fremes?And how can my CPU /GPU read this information? And here is my 2nd question: I have coordinates of different objects and can generate them procedurally.I'm passing to the shader x,y,z coordinate and enumerated type of object. How can I make out of this single vertex several vertices?
  8. to razoorsharp : I think scripting/modding a game is a good start for a game developer.You get basic idea of objects,characters,etc. Well ,its not the only option,but it depends of the person. For books for easy/fast learning of the basics I prefer teach yourself ..in 21 days series. Dont know if its legal to post the link,so just search yourself for teach yourself c++ in 21 days in google . Its maybe easier to start with C, because its the predecessor of C++,the code is backwards compatible.(you can use C code in your C++ program with a tiny exceptions). For printed book ,I and many friends/teachers have good opinion of Herbert Schildt's C and C++ books,which in my country are fairly cheap(like 5euro each). hope that helps. Regards. Edit:you asked for the code .In C its like #include <stdio.h> void main() { int MyNumber; MyNumber=5; printf("%d",MyNumber); }
  9. Winterhell

    Super Mario source code

    Quote:Original post by Daniel Miller Wow. Did programmers feel ridiculously limited back then? Or was working around these limitations "all in a day's work"? considering the source takes up 8 KB,they've spent most of the time hacking.My guess is that an optimised-but-not-hacked version of the code can be made fairly quickly(the high level programming with C of similar games today takes several days at most). I wonder what they were doing with the Atari 2600,there a game often takes <1KB ,and the console has just 128 bytes of ram.
  10. Winterhell

    Help, i just started learning....

    when you compile the cpp files they are converted in obj files.Then they are linked,it takes the needed parts from them and from included libraries,and creates the executable file.
  11. I too am a glad user of the wireless reciever(got it today:) ). Though I had 2 problems 1)maybe its just me but i think to open the package you need one of those cutting-metal machines. 2)i installed the software,then started the controller,presed the reciever,then the controller's recieve button(same way as on the 360),but...nothing happened really.And so for 30 minutes.At last I found out I forgot the wireless reciever had an usb cable :D So,the joke aside,if you follow the instructions you'll have no problems.The controller is recognised almost instantly.It works automatically with any wired usb 360 controllers connected to the pc,though the limit is 4 controlers per PC.The headset is recognised as an usb audio device. On the package there is "please consider the 360 wheel" so i think it should too work out-of-the box ,though I am yet to get one . And btw the desktop pop-up screen has a 4-line indicator for the battery. edit: to ravyne2001: it is made so that the controller is bound with only one device's ID number. That way if the PC and/or several consoles are turned on,it will know on what machine to run. This connection system was maid also to prevent neighbors from "accidentaly" connecting to your 360. As far as i know there can be 16 wireless controllers at the same place,without interfering each other.
  12. Winterhell

    2d sidescroller (collision detection)

    Hi,you may want per-pixel collision detection.Making a masked array of the map and objects,like :1 if there is pixel,0 if there is nothing. In sonic ,like most 2D games ,they use tiled-base maps.They are squared bitmaps of 16*16 /32*32 pixels for example.You check if the player's bounding box collides with some of the objects' such box,and if it does you may want to perform further per-pixel check .
  13. Winterhell

    New track

    It reminds me of Heroes III Elementals' Castle theme.Good job :)
  14. Winterhell

    software to decompile an exe completely

    Many things are lost in the path of compiling.These include variable names,staticaly linked library references ,function names. If i remenber correctly there were several programs that reverse code to C-like,but even if your program was written in C,it may seem completely different.
  15. Winterhell

    Math and Programming

    My way of doing programs is learn-on-demand style. When you start learning programming you need the aritmetic operators +-/* , sqrt.If you go to 2D graphics most likely you'll face linear equation of line(like y=a*x+b ),the concept of vectors,trigonometry . In 3D you learn matrices,quaternions,vector operations. You may not need most of the geometry taught in high school,but its useful in order to get used to math,like the visualisation of the space in stereometry(geometry in 3d).
  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!