Jump to content
Xtreme .Net Talk

ThePentiumGuy

Avatar/Signature
  • Posts

    1152
  • Joined

  • Last visited

Everything posted by ThePentiumGuy

  1. ohh i think there's something called Bounding Volumes, u shoudl look into that
  2. heh! you know what that thought never entered my mind O_o thanks man pent
  3. D3DXMeshIntersect lol its yourmesh->Intersect(v3,v3 [intersectinfo,intersectinfo]) the stuff in []'s are optional check out the directX SDK help file
  4. http://www.xtremedotnettalk.com/showthread.php?t=86046 i posted some code there showing how you would check it, not every frame, but every 5 seconds
  5. also, you need to lock the vertex buffer before setting the vertices and remember to unlock them when you're done private void OnVertexBufferCreate(object sender, EventArgs e) { VertexBuffer buffer = (VertexBuffer)sender; CustomVertex.PositionColored[] verts = new CustomVertex.PositionColored[3]; buffer.lock(0,0) = verts[] //sry dude i dont remember the actual syntax of the command verts[0].SetPosition(new Vector3(0.0f, 1.0f, 1.0f)); verts[0].Color = System.Drawing.Color.Aqua.ToArgb(); verts[1].SetPosition(new Vector3(-1.0f, -1.0f, 1.0f)); verts[1].Color = System.Drawing.Color.Black.ToArgb(); verts[2].SetPosition(new Vector3(1.0f, -1.0f, 1.0f)); verts[2].Color = System.Drawing.Color.Purple.ToArgb(); buffer.unlock; // buffer.SetData(verts, 0, LockFlags.None); //not too sure what this line does(its in your code above) }
  6. Matrix Translations in D3D hey, im a little hazy about the subject of matrix transformations, im trying to develop a (3d) racing game. i have a mesh class which has an instance of a camera class, so my car and my platform mesh bothj have their own "cameras" (or you could say their own vector3's for Position, Target, and .. well the Up vector is the same for all of them - i have instances for each mesh so i can use them for world translatiion purposes) ok, my (skimmed down) render loop looks like this(in pseudocode as i dont really have a computer and im trying to figure this out) BeginScene Platform.SetupWorld Platform.Render Car.SetupWorld Car.Render EndScene Present (i dont remmeber whether its present before Endscene or endsene before present lol but that doesnt matter ;)) my setup world sets up a LookAtLH view matrix and a perspectiveFOVLH projection matrix for each of htem my dillema is this: in order to get the effect that the car is moving (for example) forwards, i have to make the platform move backwards... that's all said and done becuase whjen i push up i move the platform's camera down..etc however, i want to be able to get the car's actual position and be able to do a mesh.intersect with it, for that ill need the car's "real" position, i tried doing this platform.setupworld 'becusae the platform moves platform.render car.render 'dotn move the car just rendfer it and when i push(for example) space, the platform moves down, and the car moves up but it gets confusing when i have to do Mesh.Intersect becuase the car is really 2x further into the platform then it thinks it is.. --- im sorta confusing myself here as i write this my real plea is - can someone clarify matrix Transformations for me please and tell me the best way to render my objects pent
  7. - the paint event is for GDI+ and the invalidate event is for GDI+ (im guessing you accidentally clicked "new thead" rather than "reply" from your old post which speaks about directX) pent
  8. ControlStyles.DOubleBuffer is for GDI+ :)
  9. hey, i know that you need to use SetStyle(AllPaintingInWMPaint,True) SetStyle(DoubleBuffer,True) SetStyle(UserPaint,True) to reduce flicker... but ive been wondering whatthey do, i know what DoubleBuffer does, but what do the other ones do also how would you use SetStyle(UserClick,True) 'i beleive its UserClick does that make the objects... clickable, if so then how would you be able to click the objects and.. for example.. drag them pent
  10. or you could rasterize
  11. if your using D3D, just use Mesh.intersect what it does is it checks whether a ray hits another object like --- --- |(M) ©| --- --- 0,0 10,0 (horrible illustration...lol) if you weanted to test whether guy(M) hit anything in front of him (pretend the "M" is 0,0 and the "C" is 10,0) by lets say... 20 pixels (i dont remember the exact command and arguments but here it is anyways) If TheGuyA.Intersect(New Vector3(0,0,0),New Vector3(10,0,0)) Then //A hit something(you cant tell if its B, it just tells you it hit something) End if ..at least i think i got the syntax (and the concept) right but i cant tell you right now cuz i donthave a comp w/ .net anymore lol pent
  12. heh, i guess i went a little too far on that last message huh?
  13. hmmm, well tests every frame might have a great overall impact. for example you're testing 3 booleans 100 times per second(cuz of 100 FPS), that's testing 3 variables every 10 milliseconds.. but you're right, i mean of course, rendering itself would take up a lot of FPS's (a HECK of a lot more than testing 3 booleans :) ) :p -hey "FOO" , if you were getting 360 FPS's earlier, and 1 boolean test added about 70 FPS... and im saying elimate 3 booleans - 3 * 70 = 210.. 100 + 210 = 310 heh, close to 360 huh? hey by the way, when are you displaying the FPS? maybe your FPS counter's messed up or something(i really dont know anything about them sry) maybe you're displaying them at a time when your PC's working hard (like for example when you close the program, your PresentParameter's garbage collector is trying to delete the PP, and you're displaying the FPS at that moment, or are you displaying it continuously (try, in your Loop: Console::WriteLine(YourFPS); pent
  14. sorry man i really dont know how to help you in this one
  15. oh yeah dude also, u seem to be doing a lot of tests when you render, i dunno man try commenting those out and seeing their effects, i mean do u really need: this->ready try cutting some slack on some boolean tests, TestCooperativeLevel and this->Focused seem to be the ones u need, pent
  16. 67 FRAMES??? WOW that's CRAZY! I thought it would gain a few but not 67 ;) try eliminating other tests, like while(this->Created) i mean i know you have to have that there, but idk try checking it .. not-so-often like for example bool Created = this->Created; while Created { //etc //every 5 seconds check whether its created again - not after every frame if(NumberOfSecondsTheProgramHasBeenRunning Mod 5 = 0) { Created = this->Created; } } i forgot what the Modulus operator was in C++ :) - if you have an FPS counter in your program just use the "NumberOfSeconds" variable... or maybe instead of while(this->Created) try while(this->Show) (i think Show is the right one, or maybe its a method rather than a variable..sorry man if i had my computer i could tell you what it is, but my comp's dead - all i know is that in my programs i use something else besidse Created), pent
  17. hey, here's how you would accomplish that: (VB.NET code, sorry) If KeyPressed(Keys.Left) Then If KeyPressed(Keys.Space) Then //do something when you pushed space and left at the same time end if end if .. of course, you'd have to use your own function name, and your own way of checking individual key strokes my point to you is, DirectInput doesn't care about priority (whether you pushed left or space first doesnt matter), as long as you check individual keys, and "check them together" like in an If statement, you should be able to check 2 or more at once
  18. is it possible that these lines are slowing it down: while(this->Created) { if(this->Focused) //this.renderscene or something similar in your RenderScene function, you're testing again whether the form is in focus if(this->Focused && this->ready) then again, i'm not a very experienced C++ programmer, but maybe this will help, pent
  19. hey guys, it's been almost a year since ive registered at EDNF(or now, XDNT). I just want toi say thanks for all this forum's done for me. I started off as a 14 year old Visual Basic programmer who was just getting in to .NET, programming games with Pictureboxes. Then I came up with the idea of creating "Mario" with pictureboxes. I posted on this forum for help with the whole 'flickering thing'. A very helpful member named Mutant taught me GDI+ and told me how to eliminate flickering. Unfortunately, I was kind of a brat(and i still am lol) at that time and kept on persisting with tiny little questions that I could have answered myself(sorry mutant). As time went by, i learned new programming tricks & optimizations..etc from other members <10-12 months later> Now im a C++ programmer who is (trying to) make 3d games lol. This forum was a great source of motivation for me as a programmer, as everyone would help me out whenever i ran into difficulties. I couldn't have made so much progress without this forum. Thanks to everyone on this forum for your great help, especially Mutant, Wyrd, and Nerseus. -Pent
  20. or if that doesn't work: picturebox.image = image.fromFile(""), pent
  21. really?? never knew that, thanks for lettin me know, pent
  22. wessamzeidan http://www.xtremedotnettalk.com/x_images/images/statusicon/user_offline.gif Junior Contributor try closing the Form Designer boomster http://www.xtremedotnettalk.com/x_images/images/statusicon/user_offline.gif Newcomer i have no idea what to do lol.. i mean ur using C++, and there's no form designer.. (the ocmputer with vb.net died a few months ago and i have no other good comp to use until my birthday so this is off the top of my head) try going into the vs.net options and unchecking stuff that might take up too much memory.. i cant think of anything else... edit: oh yeah also dude - before openign up vs.net try restarting Explorer.exe control alt delete, right click explorer.exe and hit end process tree then go to file and type in "explorer" and hit enter.., pent
  23. wow :) that's..a lot lol, umm try closing Dynamic Help over in the bottom right hand corner - dynamic help eats away memory like crazy.. scaning every word of code you type in to help you lol; try doing that try the same boomster, maybe that'll work pent
  24. wow this is amazing, i have vb.net 2002 and now im getting 2003 :):):) why would MS give away $100 software for free like that
×
×
  • Create New...