
israel
Members-
Posts
17 -
Joined
-
Last visited
israel's Achievements
Newbie (1/14)
0
Reputation
-
I'm working with visual studio 2003 and I want to publish my web service to a remote server running windows 2003 server, does anyone know how to do that?
-
Nevermind, I got it. Thanx everybody Thanks all for your help, I followed Phikwe's implementation (thanks alot man) to come up with a routine to find which triangle I hit with the mouse (I'm drawing primitives). In this function I'm testing for just one triangle that's why my vectors zero, one and two are hard-coded. I'm pasting my function here just in case anybody is interested: private bool intersectedTriangle() { Point pt = Cursor.Position; pt = this.PointToClient(pt); Viewport vp; Matrix world; Matrix proj; Matrix view; IntersectInformation closeHit Vector3 vIn, vNear, vFar, vDir; vp = device.Viewport; world = device.Transform.World; proj = device.Transform.Projection; view = device.Transform.View; vIn.X = pt.X; vIn.Y = pt.Y; // Compute point on near clip plane at cursor vIn.Z = 0; vNear = Vector3.Unproject(vIn, vp, proj, view, world); // Compute point on far clip plane at cursor vIn.Z = 1; vFar = Vector3.Unproject(vIn, vp, proj, view, world); // Compute direction vector vDir = Vector3.Subtract(vFar, vNear); Vector3 zero, one, two; // The vertexes of my triangle zero = new Vector3(0.0f, 1.0f, 1.0f); one = new Vector3(-1.0f, -1.0f, 1.0f); two = new Vector3(1.0f, -1.0f, 1.0f); if (Geometry.IntersectTri(zero, one, two, vNear, vDir, ref closeHit)) { return true; } return false; }
-
Hey Phikwe, Good job man! I have a question for you. Are the (x,y) values you're passing to your function in pixels and starting from the top left corner of your screen? Thanks again
-
Thanks all Thanks all for your help. I think I'm going to be trying what Phikwe found, but in C# (Phikwe, let me know if you made it work). And I'm also going to keep looking for more info.
-
Does anybody know if there's a way of selecting a vertex of a 3D object using the mouse? For instance, I have a 3D view of a foot (I'm in the medical industry) and when the user drags the mouse over the shape I need to draw a point on top of the vertex where the mouse is pointing to, excluding the hidden vertexes. Does anybody know how to do that? Thanks,
-
Hi all, I'm using the following function to create my device: public void initializeGraphics() { PresentParameters pres = new PresentParameters(); pres.Windowed = true; pres.SwapEffect = SwapEffect.Copy; pres.EnableAutoDepthStencil = true; pres.AutoDepthStencilFormat = DepthFormat.D24SingleS8; device = new Device(0, DeviceType.Reference, this.picDevice, CreateFlags.HardwareVertexProcessing | CreateFlags.MultiThreaded, pres); device.RenderState.CullMode = Cull.None; vertices = CreateVertexBuffer(device); } As you can see, I'm using DeviceType.Reference because my users have lousy video cards. The problem I have is that the models I'm trying to display are pretty large and my application runs incredibly slow (probably less than two frames per second). Does anybody know if there's a way of making my application faster without the help of Hardware? Do you think OpenGL would be faster than DirectX? (without using hardware of course) Thanks
-
Thanks Thanx everybody, I just stopped overriding the OnPaint method and created a Render method and now everything works perfectly.
-
I�m starting to learn Managed Direct X and I�m having a little problem. I�m using a pictureBox as the device and I have other components in my window as well. When I run my application none of the other components show up; instead, I have empty rectangles and I can see whatever is behind my form(i.e. the Visual Studio window) Does anybody know why this happen? I�m overriding the OnPaint method like this: protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) { device.Clear(ClearFlags.Target, System.Drawing.Color.CornflowerBlue, 1.0f, 0); SetupCamera(); // some code to draw something device.BeginScene(); device.VertexFormat = CustomVertex.PositionColored.Format; device.DrawUserPrimitives(PrimitiveType.TriangleList, 1, verts); device.EndScene(); device.Present(); this.Invalidate(); }
-
Thx Thanks man, I�m writing some examples in C# now but before I work on the definitive application I�m giving one more try to MC++ Thanks
-
Thanks again I know you didn�t suggest me to move to C# but I had been trying to follow examples written in MFC or C# and it was not working. I spent one complete day struggling with one line of code, I searched for books, tutorials, in the msdn, posted questions in discussion groups and after that I have nothing. It�s possible that I could get stuck for days in one thing. And moving to C# it�s not the end of the world, I can make a .dll from the code I already have (I�m writing a medium size application) and create the gui (with the directX part) in C#. Thanks for all your help
-
Thanks for the advice Thanx, I think so too. I'm going to try CSharp now, I cannot spend one complete day struggling with one line of code.
-
Here are some of my errors I'm getting Yes, as far as I know in MC++ the PresentParameters is an array. There's a few differences from VB and CSharp. error C3635: 'Microsoft.DirectX.PrivateImplementationDetails.IDirect3DDevice9': undefined native type used in 'Microsoft.DirectX.Direct3D.Device'; imported native types must be defined in the importing source code error C3377: 'Microsoft.DirectX.Direct3D:Device..ctor' : cannot import method - a parameter type or the return type is inaccessible Note: I changed the :: for . because it was not letting me post the reply
-
Thank you Thanks a lot, but my problem is that it seems like the syntax for MC++ is slightly different from the syntax in VB or C#; and I�ve found almost nothing about MC++ and Managed DirectX, not even in the msdn I found a snippet of code but it doesn�t compile either. Here�s what I found: public: bool InitializeGraphics(void) { try { // Now let's setup our D3D stuff PresentParameters *presentParams[] = new PresentParameters *[1]; presentParams[0] = new PresentParameters; presentParams[0]->Windowed = true; presentParams[0]->SwapEffect = SwapEffect::Discard; device = new Device(0, DeviceType::Hardware, this->get_Handle(), CreateFlags::SoftwareVertexProcessing, presentParams ); return true; }
-
Thanx I appreciate your help, but all the sources you sent me are for C# and I'm looking for MC++. I already spent a couple of hours at amazon and chapters but I found nothing about Managed DirectX and MC++. Does anybody know where to download the teapot sample in Managed DirectX and MC++ just to get me started?
-
Does anybody know a book or tutorial about Managed DirectX with MC++?