Jump to content
Xtreme .Net Talk

ThePentiumGuy

Avatar/Signature
  • Posts

    1152
  • Joined

  • Last visited

Everything posted by ThePentiumGuy

  1. Thanks, I tried SuSe Live Eval :-D, one of my friends had it and he burnt it for me (he's the kid who got me into linux lol, he uses debian but he's advanced ;)). The SuSe Live Eval is pretty much the same thing like you said about Knoppix - boots right off of a CD and requires no installation :). So far I think it's pretty good, the more I use it obviously the more i'll know about it. I have 2 options: IIS or Linux... 99% im going with Linux, if anything fails (e.g. my PC doesn't have enough memory...etc which is impossible for linux ;)), then i'll use IIS on my good pc. Getting hacked on linux? o_O I thought this was secure ;). Oh - uhh I got a question...... I don't exactly have an ethernet cord on my old Pc... however it does have a few USB ports - will it be able to recognize my wireless adapter? It's the Microsoft MN-250 or 350 (something along those lines).... hmm a Microsoft adapter on a Linux PC, I hope this works :). -The Pentium Guy
  2. Hey, I'm thinking of setting up a LAMP (Linux Apache mySql Php) server. I'm just wondering what distro you guys feel is better... I've done my research and found this info: Stuff I'm NOT looking at: Slackware - The "C++" of all linux Distro's... the most powerful - yet the hardest (meh.. yeah Assembly is the hardest actually ;)). I'll try to stay away from this one. ----- Stuff I'm looking at: Mandrake- Nice and simple to set up and use...etc. I heard Mandrake was VERY buggy and instable. Debian - A lot harder to set up, a very good balance of both power and simplicity. Stable SuSe - Meh.. you gotta love the Live Eval (boot Linux straight off the CD), but now they released 9.1 and its a free version as opposed to an Eval. This seems the easiest - but I heard it lacks in features... Great Tech support. Fedora Core - AKA Red Hat 9. I saw some screenshots, and this and Mandrake seem to be the "Easy to Use" stuff. I'm not sure if this lacks in features. Stable. ------ Stuff I'm not sure about and I probably want to avoid: Gentoo - Confusing to set up? Drivers and stuff to set up = pain? Not sure. <I can't think of any more o_O> Right now I seem to like Mandrake, SuSe and Fedora Core.... I'm not sure too much SuSe but I know mandrake is buggy. Fedora Core might be the best... Can anyone please give personal recommendations? I'm completely new to linux but I'm a fast learner. -The Pentium Guy
  3. Sigh.. I'm still waiting for my Hotmail account to get 250 MB... In either case - I'm gonna switch to gmail ( <doh> I haven't gotten an invite yet </doh> ). The junk mail filters in hotmail REALLY suck. Half the time they get rid of NEEDED mail, and think junk mail is normal ;). The only real reason I use msn is for convenience - I'm on MSN Messenger 24/7 and it notified me when I get mail <not that this is a help... every once in a while I get conecutive boxes saying " You have 1 new email message " "You have 2 new email messages" ...etc within like 5 seconds of each other. I hope the junk mail filters on gMail are good :-D! I also hope that mails from your contacts go to one folder - and mails from people that COULD be your contacts go to another folder and junk mail goes to... your junk mail folder. In response to the previous post... I don't really think that's possible o_O. Edit: I meant the post before that one - the one where he said email accounts could change their "adress". -The Pentium Guy
  4. Note about my Heightmap class, in my Render sub - before DrawPrimitaves - add this line: dxDevice.VertexFormat = CustomVertex.PositionNormalTextured.Format using this line, texturing will work and you wont get an error (which i recently realized ;))
  5. Through code, i dont know :-P, but without code - in start | run use dxDiag to find out the version number
  6. This was tested in FullScreen, a 393216 vertex Heightmap was rendered on a: 3.0c & 1 gb ddr3200 & radeon 9800 pro overclocked to XT speeds Using the "Paint Trick"... FPS = 44 Without using the Paint Trick... FPS = 43 ... DOH :), you're right, this has no effect on FullScreen whatsoever. -The Pentium Guy
  7. Very true :).
  8. --------- The other technique is really simple - We simply use Translation and use variables. It works something like this [ replace the Multiply line with this ] d3ddev.transform.world = matrix.Translation(x,y,0) Now, the translation is not based on FRAMERATE, its simply based on the amount that X and Y is. Go back to form 1 and revise the code in form1_keydown: [/color] [color=blue]If[/color][color=black] e.KeyCode = Keys.Right [/color][color=blue]Then[/color] [color=black]Game.X += 1[/color] [color=blue]End[/color][color=blue]If[/color] [color=blue]If[/color][color=black] e.KeyCode = Keys.Left [/color][color=blue]Then[/color] [color=black]Game.X -= 1[/color] [color=blue]End[/color][color=blue]If[/color] [color=blue]If[/color][color=black] e.KeyCode = Keys.Up [/color][color=blue]Then[/color] [color=black]Game.Y -= 1[/color] [color=blue]End[/color][color=blue]If[/color] [color=blue]If[/color][color=black] e.KeyCode = Keys.Down [/color][color=blue]Then[/color] [color=black]Game.Y += 1[/color] [color=blue]End[/color][color=blue]If[/color] [color=black] Its pretty simple, since its not based on framerate, we can use "normal sized" amounts as opposed to using .01 or .1. Oh yeah, delete the code in form1_keyup http://www.xtremedotnettalk.com/images/smilies/wink.gif. Now run the thing http://www.xtremedotnettalk.com/images/smilies/biggrin.gif, it works. As a matter of fact, you might actually have to increase the 1 to maybe 5 or 10. Well, here comes another question which people will ask/ Remember, you have to move the world to move an object... "what if you had Two objects??? What if object1 wanted to go right and object2 wanted to go left? Oh no! is this a limitation of Direct3D????" Of course its not ;P. This is a confusing explanation, and I gotta explain this through experimentation lol. In GameClass, Private Alex2 As clsSprite at the end of Initialize, Alex2 = new clsSprite(d3ddev, "down1.bmp", new point(5,5), 32,32) and in RenderScene after Alex.Render: Alex2.Render Run it, Again - as expected, you should see both alex and alex2 moving beucase you're moving the WORLD... Well, how do you move 2 objects at once? You translate the world again before rendering the 2nd object! In GameClass, Dim X2 as Single Dim Y2 As Single in form1_keydown, add: [color=#0000ff]If[/color] e.KeyCode = Keys.W [color=#0000ff]Then [/color]Game.y2 -= 1 [color=#0000ff]End[/color] [color=#0000ff]If [/color][color=#0000ff]If[/color] e.KeyCode = Keys.S [color=#0000ff]Then [/color]Game.y2 += 1 [color=#0000ff]End[/color] [color=#0000ff]If [/color][color=#0000ff]If[/color] e.KeyCode = Keys.A [color=#0000ff]Then [/color]Game.x2 -= 1 [color=#0000ff]End[/color] [color=#0000ff]If [/color][color=#0000ff]If[/color] e.KeyCode = Keys.D [color=#0000ff]Then [/color]Game.x2 += 1 [color=#0000ff]End[/color] [color=#0000ff]If [/color] Ok, now before alex2.Render: d3ddev.Transform.World = Matrix.Translation(x2,y2,0) Run it (don't worry if you don't understand the code), push W S A D and UP DOWN LEFT RIGHT to move the guys... they move SEPERATELY :). Now its time for an explanation... Here's how the program "reads" at the code Translates the world to Alex's position Renders Alex Translates the world to Alex2's position Renders Alex2 Its a weird concept to sink in :s, its really hard to explain.. but here's 1 other thing you should realize, After you render alex, any more translating after that won't really do anything to Alex's position... he's already been rendered :), and he "stays" there. Experiment a bit with this, and try to understand it before moving on... ------------------------------------------------------------------------ The View Matrix Here is a question which I said I would answer in the previous tutorial (Rendering a Sprite). I asked you earlier to type in the line: D3Ddev.Transform.View = Matrix.OrthoOffCenterLH(0, DP.Width, DP.Height, 0, 1, 10) near the end of GameClass, and I told you I would explain it in the next tutorial. The World matrix stores the objects, and the View matrix stores what you can see. In this view matrix, we define the left of the screen to have an x of 0, we define the right of the screen to be DP.Width (ex: if it was 800x600, the right of the screen would be 800), we define the bottom of the screen to be DP.Height (600 in our case), we define the Top of the screen to have a y of 0. The next 2 arguments tell us zNear plane and zFar plane. Here's what those things do (its not important in 2d but it certainly is important in 3d): -It basically says "If any object has a Z which is less than 1, dont render it, If any object has a Z greater than 0, don't render it". Its sort of a memory manager so that you don't render your ENTIRE world (imagine a HUGE 3d world), at the same time - you render it as you approach there. If we HADN'T speficied the View matrix, it would be by default: Left: -1 Right: 1 Top: -1 Bottom: 1 ZNearPlane: 1 ZFarPlane: <im not too sure, I think it may be 2> This means that point (0,0,0) is the CENTER of the screen, we certainly don't want that to happen. Now tto explain what OrthoOffCenterLH means... Ortho: No matter what Z value an object has, it's not gonna matter - ideal for 2d, bad for 3d... the Z value of an object only does 1 thing: determines what object renders on top of the other object. If and object had a z value of 1 and an other object had a z value of 5, then the object with a zvalue of 1 would be rendered on top. OffCenter: This means that the center of the screen isn't 0,0,0 LH: Left handed coordinate system, this means that the more Z an object has, the farther away it is. The reason why I said replace the 0 with a 1 < in my previous post > was for mathematical reasons. Never have a zNear of 0. That's all for this tutorial :). Mess around with some stuff, and learn more - It took me 2 weeks to understand this concept and I learned it by messing around. -The Pentium Guy 4 - Matrices and Transformations.zip
  9. I will be making a set of 5 or 6 tutorials, each of which include source for Visual Basic.NET 2002 and Visual Basic.NET 2003. C# tutorials may or may not follow. These tutorials are to give you guys a jumpstart to some Direct3D. I hope you enjoy these. This tutorial will teach you how to move stuff around using Matrices and Transformations. Hey welcome to the next tutorial.. this is the tutorial that will start to confuse the hell out of you.. just know 1 thing: As long as you keep an open mind and a positive attitude you'll understand this ;p. Heh, lets start with a few Q and A to get the ball rolling The obvious question: "How do you move stuff??" The n00b responses (which I expect from some of you at this stage): "Well, the first thing to do is recreate the vertices - its kinda simple, if you want to move a square right, all you gotta do is this: vertex(0) = new customvertex.positionTextured(<1 unit to the right>) and do the same with the other vertices" Sorry, wrong answer... http://www.xtremedotnettalk.com/x_images/images/smilies/frown.gif Direct3D doesn't allow this... why? Because you're changing data in the vertex buffer. The vertex buffer is loaded and ready to go (there is a way around this but this is not for now), and you can't change it! n00b response to that: "Well all you gotta do is recreate the vertex buffer and load in a new set of vertices" Well... yes that could work... but isn't that a TOTAL waste of memory? You're creating a TOTALLY new vertex buffer and you're filling it with ANOTHER set of vertices = lag fest & flicker mania http://www.xtremedotnettalk.com/images/smilies/biggrin.gif. So .... you're wrong ;p. A g33k comes up with a response: "Well, its rather simple actually, Direct3D has its own built-in functions for doing this, it involves a complex system of matrices. The world gets translated in the direction which you want your objects to move and the result is a mass-movement of all objects in that specified direction." Uhh... yeah that's the correct answer..... In english please??, here it is: -Every object is in the WORLD. These objects can't move on their own (by changing the vertices or recreating the vertex buffer..etc) because it would be too slow.... imagine moving a 3D Character this way...do you realize how many vertices we'd have to move in order to move him? Even if this was just 1 pixel to the right.. its a CRAZY way of doing this So, the ingenious Microsoft came up with a way of doing this: Move the world to move an object. ;P, scary huh? Again, keep an optimistic outlook and an open mind towards this concept, it might seem weird but everything has its reasons. If an object wants to move left... what do you do? Make the world move left as well :-P. The same goes for the other directions.. which ever direction the object wants to go in, the world goes in. So to move that high polygon 3D character model, you move the world rather than move the individual vertices over... you sort of understand what I mean? How do we move the world? Well... here's where it gets a bit confusing, Microsoft stores the world in a Matrix which is stored in your Device. The process of moving the world is called Translating... there are other transformations as well, such as Rotation and Scaling, but Translating is just moving it... Well here's how to translate the world 1 unit to the right.. assuming d3ddev is your device: d3ddev.Transform.World = Matrix.Translation(1,0,0). The 3 arguments are X, Y, and Z respecitively. That 1 indicates that the world is being moved 1 unit to the right. Now that our character has moved 1 unit to the right, how do we move him back to his original position? d3ddev.Transform.World = Matrix.Translation(0,0,0) Lets try experimenting with this http://www.xtremedotnettalk.com/x_images/images/smilies/smile.gif. Open up the previous project (Rendering a Sprite)... Go to GameClass and then go to the RenderScene sub.. Right before Alex.Render, type in d3ddev.transform.World = Matrix.Translation(30,0,0) Run it... edit: before you run it, do 1 thing, it is an error on my part in the previous tutorial, in the Initialize in GameClass, please change D3Ddev.Transform.View = Matrix.OrthoOffCenterLH(0, DP.Width, DP.Height, 0, 0, 10) to D3Ddev.Transform.View = Matrix.OrthoOffCenterLH(0, DP.Width, DP.Height, 0, 1, 10) Due to some mathematical reason, the zNearPlane argument must be 1 (don't worry if you don't understand this line anyways, i will explain later in the tutorial The character just shifted 30 units to the right. Be sure to realize one thing, remember that the top left of the character is position (0,0,0), which is the top left of the screen? Well now, the point (0,0,0) has now shifted 30 units to the right, it is now where 30,0,0 used to be.. the character's top left is still at point 0,0,0... the top left of the screen is now -30,0,0 http://www.xtremedotnettalk.com/images/smilies/biggrin.gif... starting to understand a bit? Now lets try something different How do we translate the world 1 unit to the right each frame[each time the object is rendered]? Well, first of all, we would have d3ddev.transform.world = matrix.translation(1,0,0) right? How would we make it move 1 unit to the right of its previous position, meaning how do we make it keep moving right 1 unit?? We'd simply do this [replace this line with the translation(30,0,0) line: d3ddev.transform.world = Matrix.Multiply(d3ddev.transform.world, matrix.translation(1,0,0)) Dont worry, the line may seem tricky, but just replace that line with your other translation line and run it... So now the guy moves REALLY quickly across the screen.. for those of you with fast computers, I suggest that you change the 1 into a 0.1 or a 0.01. Depending on the amount of FPS (Frames Per Second) you get, the faster he'll go .... so Multiply simply translates the world from the PREVIOUS position.. and without Multiply, it would translate the world from position (0,0,0)... got all that? If you don't - play around with it for a while and it might sink in http://www.xtremedotnettalk.com/images/smilies/biggrin.gif. ------------------------------------------------------------- Now that you've understood that (I dont expect you to understand it completely, but get the general gist of what it does), lets discuss a bit on how to animate. The first response that people come up with is usually "Simple, use the Multiply along with Translation to animate the character - except use variables.. for example: d3ddev.transform.world = Matrix.Multiply(d3ddev.transform.world, matrix.Translation(x,y,0)) since Z doesn't matter in a 2d game set it to 0. When the character presses (for example) right, set x = 1 so he can start animating, when there is no key pressed, set x = 0 so he can STOP animating" - I'll tell you right now that this is the wrong way, but.. I like to teach people Why we do things as opposed to simply How we do things... lets experiment: In GameClass: Public X as Single Public Y as Single replace that translation line [you should only have 1 translation line] with: d3ddev.transform.world = Matrix.Multiply(d3ddev.transform.world, matrix.Translation(x,y,0)) Now go back to form1.. add the following code [color=#0000ff]If[/color] e.KeyCode = Keys.Right [color=#0000ff]Then [/color]Game.X = 0.1 [color=#0000ff]End[/color][color=#0000ff]If [/color][color=#0000ff]If[/color] e.KeyCode = Keys.Left [color=#0000ff]Then [/color]Game.X = -0.1 [color=#0000ff]End[/color][color=#0000ff]If [/color][color=#0000ff]If[/color] e.KeyCode = Keys.Up [color=#0000ff]Then [/color]Game.Y = -0.1 [color=#0000ff]End[/color][color=#0000ff]If [/color][color=#0000ff]If[/color] e.KeyCode = Keys.Down [color=#0000ff]Then [/color]Game.Y = 0.1 [color=#0000ff]End[/color][color=#0000ff]If[/color] [color=#0000ff] [/color][color=#0000ff] [/color]And in form1_keyup: game.x = 0 game.y = 0 Now test out the code ;D... You see that it works right? Here's my reasoning behind why we shouldn't do this... the Matrix.Multiply thing is based on time (FPS) becuase it moves the world based on frame count.. you move it .1 in whatever direction, lets say the Frames Per Second is 1, that means that it moves the world by .1 (in whatever direction) every second. Based on the FPS only you'll know how much you're actually moving the world by... this leads to confusion.. So there's another technique which does not use multiply and translation, it just uses translation < i bet you guys now know what it is ;) > <I'm Splitting post to overcome limit>
  10. You got this from ".NET Game Programming with DirectX 9" eh? I love that book :). Hey btw, there are a couple problems with the sprite class from that book, and it has to do with creating the vertex buffer: First of all, the FVF_CUSTOMVERTEX in the class you attached is not defined :p. Second of all: Dim Vertices as CustomVertex() is not a good way to code... this is because you must specify the type of CustomVertex... for example Dim Vertices As CustomVertex.PositionTextured(). In either case, Dim Vertices as CustomVertex() would not work becuase in the book, it is defined in another class (GameClass I beleive) 3rd of all, in public sub Draw: If transparent then objDirect3DDevice.Alphablend = True End If would not work :), in the book they turn on the SourceBlend and the InvSourceBlend in the Initialize sub in the GameClass. 4th of all, CreateFlexVertex (arguments) as CUSTOMVERTEX would not work, becuase CUSTOMVERTEX is defined in GameClass in the book (or something like that).. The easiest thing to do is rather than use that function, just say Vertices(0) = new CustomVertex.<whatever>(arguments) The book is great(that's what my tutorials are mainly based off of), but its got a few quirks here and there :P) Just remember, don't define anything as "CustomVertex"... becuase CustomVertex is a DirectX class, -The Pentium Guy
  11. Could we still make DirectX the main forum? (I realize that this post is old :P), it seems as though the forum has been 'booming' lately :D. -The Pentium Guy
  12. Here's another tip to improve performance: http://www.xtremedotnettalk.com/showpost.php?p=428098&postcount=17 It was taken from this thread: http://www.xtremedotnettalk.com/showthread.php?t=88302&page=1 -The Pentium Guy
  13. Spotlights...hmm here you go: http://www.robydx.altervista.org/English/less3D06.htm Thanks RobyDX :)
  14. Please view this thread for the links and instructions on how to install it: http://www.xtremedotnettalk.com/showthread.php?t=87678
  15. Using loops take up a LOT more resources, the Paint trick is another way of doign a loop (becuase Me.Invalidate calls the paint event again :D). I'm not too sure how to compact the memory :s, im developing on a good computer (3.0c, 1 gb ram)- its actually sort of bad to develop on a good computer as opposed to an average computer becuase you assume that your program is fast enough :-D. -The Pentium Guy
  16. I'd say learn more languages for the fun of it - after all, you can do the exact same things in each language, stick with the language which you feel that "flows" the best for you. Be a Jack-Of-All-Trades, but a master of one at least :). My suggestion to you is look into Java. C# and VB.NET are similar, they can accomplish basically the same thing, choose one that you feel works best for you. As for C++ and Java, i'd recommend you try learning both :D. Java is a much more "organized" language I should say... C++ is "messier", but its powerful and you can push it to its limits. I'm learning some Java this year, it doesn't look that bad - as a matter of fact I think it looks like C# (after all, the rumor goes that Microsoft created C# to "match" with Java) My advice is to tackle some C++.. or if you don't feel like "stepping up" that high, try Java and then go to C++. Here's how I learned stuff: VB -> C# -> C++ -> Java I'm good mainly in VB and C++, but with C++ its mainly a "meh i know how to do this, I can do this later its easy 'nuff.. ah what the hell I'll just do this in VB! ", so I've never really 'practiced it' becuase vb is addicting :D. Keep in mind that VB.NET and C# are both RAD (Rapid Application Development) and are very user- (or should I say programmer :-P) friendly langauges. C++ and Java (im not sure about Java) are mainly for speed, control, and power. Edit: Lol, I said "my suggestion is java" and then i said "my advice is C++"... what I meant was, if you don't feel like "steppin up" to C++, look into Java first -The Pentium Guy
  17. Lol are you sure? I'll run an FPS test tomorow and see if I get a performance increase or not... -The Pentium Guy
  18. Yeah you can, there's a lot more resources for unmanaged though... Your app will definately go faster in Unmanaged C++, I guess it depends on what you want: RAD (Rapid App Dev) or Sheer Speed (if you're rendering thousands of polygons per frame and you NEED that speed). -The Pentium Guy
  19. www.robydx.altervista.org :D, italian, but great :).
  20. Email microsoft for their stupidity? :-P
  21. 3D maps? Look into Heightmaps.. Thanks to Phikwe for a LOT (and I mean a LOT) of help on this. Here's the attached heightmap class, Loffen you know the clsSprite class on the tutor's corner? You'd use it pretty much the same way.. Anyways, here it is: clsHeightMap.zip
  22. That's odd that its taking up so much space.. are you using a lot of bitmaps? Try using a more compressed jpg. The DirectX SDK has more information on spotlights I beleive :), -The Pentium GUy
  23. Here's a couple tips: Read up on SwapChains to get different views at the same time (there's some info on www.robydx.altervista.org). You're (obviously) going to have to do a lot of real time stuff, so scripts may be needed. Look into HLSL and .fx files... possibly you could create your own scrips using these.. I've never attempted this :), so I'm not sure -The Pentium Guy
  24. You should ask the admin to add this to the Code Respotory :-D its great :), although im not sure how to chat.. I started a session using the default IP: 127.0.0.1 and port 21.. server log says: Starting Communications Server Currently Hosting a session. How do you chat? :-P -The Pentiium Guy
  25. Loffen: You want performance? Here's a tip: [i'm assuming that you're using code similar to mine in the Tutor's Corner] Take out the render loop, so Public Sub RenderScene should just say: Clear Begin Scene ' Render Objects End Scene Present If GameOver = True Then Terminate() End If Application.DoEvents So there should be no loop. Now, in Overrides form1_onPaint (use the drop down menu and select Overrides instead of BaseClass Events and look for onPaint), type in: Game.Render() Me.Invalidate In form1_load, add this code: Me.SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.Opaque, True) Comment that line and see what happens :). The form will flicker like CRAZY. You should now see a major performance increase.
×
×
  • Create New...