Jump to content
Xtreme .Net Talk

rifter1818

Avatar/Signature
  • Posts

    257
  • Joined

  • Last visited

Everything posted by rifter1818

  1. Well heres as far as i can tell 1) I dont know why you cant say POSITION pos, but if i remember correctly the : POSITION tells it to use the information that your vertexdeclaration defines as POSITION if you add a number say POSITION1 that would be position with a usage of 1 should i remember correctly. 2) a pass is well a pass (say you wanted to render the object normally (pass 0) then go over the whole thing again and render with a glow effect (pass 1) then maybe a fire effect (dont ask why but none the less pass 2) well you get the idea a technique can call multiple passes.. 3)float4 is roughly equivalent to a vector4 (its 4 float variables you can access as either .x,.y.z,.w or if im not mistaken .a,.r.g.b) a float4x4 on the other hand is more like a matrix (a 4x4 matrix at that). and im not sure exactly how you access each of the variables here though. 4)im gonna have to say im not sure here at all, because well im not. Anyways i hopes this helps a bit.
  2. That is what im gonna do But man oh man is that inefficiant, i hope someone can find a more efficiant way....
  3. Thats how i normally do it too, but in this case im using from bitmap and i cant find an overload that allows a colorkey.
  4. Transparancys not working hence i cant see clearly ha ha ok bad joke. Heres my problem. Ive loaded a set of textures from a Bitmap and i want all of the Black to be transparant so currently (d3d.dev is my Direct3d device) my settings are as follows (but it doesnt work theres black squares everywhere). [CS] d3d.Dev.RenderState.Lighting = false; d3d.Dev.RenderState.Ambient = Color.White;//redundant but when/if i enable lighting.... d3d.Dev.RenderState.CullMode = Cull.None; d3d.Dev.RenderState.AlphaBlendEnable = true; d3d.Dev.RenderState.AlphaTestEnable = true; d3d.Dev.RenderState.ReferenceAlpha = Color.Black.ToArgb(); d3d.Dev.RenderState.AlphaFunction = Compare.NotEqual; [/CS]
  5. Im Still suggesting my method and then a quick algorythm to make up the index buffer and its all done :D
  6. Couldnt find it when i searched for it. The question is if i write up a DLL file that uses Directx can i compile it in such a way that the user doesnt have to add the directx resources to his/her program (just the dll i made) for it to work?
  7. Vector3.unproject takes in the world matrix. (and viewport and one other matrix (cant think of it off the top of my head)). So yes thats where all of the World matrix transformations are accounted for.
  8. D3d is just a wrapper class of Edit(Managed) directx (custom made by yours truely) Most of its usefullness is in other areas such as Skinning Meshs where it has working implementations and has some good vertexBuffer constructors and such nothing really impressive.
  9. Thank you Pretty simple but you need to know its there. Edit ok now to show how little i know just to be sure how do i access the data from this embeded resource?
  10. Ok folks i dont want to have any dependancys for this program (dont ask me why) but i was wondering if you could include certain files (like text files in this case) inside the executable, i know that with vb6 you could (at least with images (if you used the ide to create the form with the image in the picturebox it would be included inside the executable). Just wondering how i would do something like that with text and other files (image files too actually). Edit oh ya dll files too not just executables.
  11. ok Im sure youd figure it out if you put your mind to it but its using mesh.intersect with world matrix translations (so i was right (im pretty sure)).
  12. Um then this shouldnt have worked However the following worked for using a single (150x150x0) square mesh to check the tops of a (3x150)x(2x150) landscape. For i = 0 To blgrid.GetUpperBound(0) For i2 = 0 To blgrid.GetUpperBound(1) If blgrid(i, i2).Exsists Then D3d.Device.Transform.World = D3d.Translate(blgrid(i, i2).pos.X, blgrid(i, i2).Alt, blgrid(i, i2).pos.Y) v3dmouse = Vector3.Subtract(D3d.UnProject(New Vector3(Mouse.X, Mouse.Y, -100)), D3d.UnProject(New Vector3(Mouse.X, Mouse.Y, 100))) If modBattle.GridTopMesh.Intersect(D3d.UnProject(New Vector3(Mouse.X, Mouse.Y, -100)), v3dmouse) Then BLP.x = i BLP.y = i2 Exit Sub End If End If Next Next
  13. Are you sure about the Mesh.Intersect thing Kavan cause i remember using only one mesh (a 2 triangle square) for all my intersects by translating it around my grid. (looks for code).
  14. Are you sure? d3d.Dev.Transform.View = Matrix.OrthoOffCenterLH(-512,512,-384,384,-50,0); d3d.Dev.Transform.Projection = Matrix.PerspectiveLH(1024,768,-50,0); Seems a little redundant to have Projection and View so simular and doesnt set campos,camtar,camup anywhere?! Edit After Testing doesnt seem to work, btw which Matrix makes it 10x larger in x,y? Matrix.Scaling(10,10,1) Matrix.Scaling(1/10,1/10,1) Never Mind Problem was my cull mode Thanks Pent.
  15. Not sure about lights But you can use mesh.intersect and whatever you check will be translated by the current world matrix should my memory serve me correct.
  16. Thanks Pent I was just so used to 3d myself that id forgotten the finer points of view/projection/all that stuff. Thanks.
  17. Ok this is a simple one, i want to use LeftHanded CC View CamPos 0,0,-100 CamTar 0,0,0 CamUp 0,1,0 Now how do i get my projection matric such that (on a 1024x768 resolution) 0,0,0 in the world is the center of the screen -512, 384 ,0 is top left of screen 512, 384 ,0 is top right of screen -512, -384,0 is bottom left of screen 512 , -384,0 is bottom right of screen Really simple question but i really dont know how to fine tune my projection matrix (at least i think thats what i need to modify) And before you as the question yes i know about transformed Vertices and all that.... Thanks in advance
  18. Are you trying to make or use a grayscale map? Make-Im sure theres a better way but you could use mesh.intersect (angle the ray from above) to get the height at any point then smack down a pixel of the corresponding shade and keep going like that? Use-Again im sure my way is really inefficiant, but create a mesh using an array of verticies, use the x,y for x,y and use the colorscale for z on the positions then run an optimize routine on the mesh when your done.
  19. Thanks for the Advice Ill look into buying that when i have some $.
  20. By run inheritance i mean to say how do i inherit in C#... Example in vb public class SuperSquare inherits SQUARE ....... end class
  21. Fixed Problem was that i wasnt using e.Graphics, thanks again PlausiblyDamp.
  22. [CS] unsafe private void Form1_Load(object sender, System.EventArgs e) { this.SetStyle(ControlStyles.AllPaintingInWmPaint,true); this.SetStyle(ControlStyles.DoubleBuffer,true); //.............. } protected override void OnPaint(PaintEventArgs e) { //base.OnPaint (e); Graphics G = base.CreateGraphics(); Pen p; Brush B;B = new SolidBrush(Color.Black); byte x,y;int v; for(x=0;x<6;x++) { for(y=0;y<6;y++) { v = (150 * S[x,y].Units); v /= S[x,y].Neighbors.GetUpperBound(0) + 1; v += 105; if(S[x,y].Owner == 0) { p = new Pen(Color.Gray); } else if(S[x,y].Owner == 1) { p = new Pen(Color.FromArgb(v,0,0)); } else { p = new Pen(Color.FromArgb(0,0,v)); } p.Brush = new SolidBrush(p.Color); G.DrawRectangle(p,Rect[x,y]); G.FillRectangle(p.Brush,Rect[x,y]); G.DrawString(S[x,y].Units.ToString(),Form1.ActiveForm.Font,B,Rect[x,y],new StringFormat()); } } G.Dispose(); Application.DoEvents(); this.Invalidate(); } [/CS] Anyways the flickering is driving me nuts,
  23. Thank you I wasnt Aware of the difference there with Classes/Structs Thanks for your help. Still intrested in a) Inheritance in C# and b) Creating UnManaged types in C# but youve answered my big problem. Ty.
  24. I guess the next question is how would i make an unmanaged version of the SQUARE Class/struct? The Neighbors would not have to be an undimensioned array (just have it as say 6 items then have a byte keep track of how many are actually being used... Also how do you Run Inheritance in C#?
×
×
  • Create New...