Click here to Skip to main content
15,914,111 members
Home / Discussions / C#
   

C#

 
QuestionWindows Management Help !!! Pin
snouto15-Feb-06 6:04
snouto15-Feb-06 6:04 
AnswerRe: Windows Management Help !!! Pin
Dave Kreskowiak15-Feb-06 14:46
mveDave Kreskowiak15-Feb-06 14:46 
QuestionHow do i make an XML document only read/writeable by my ASP.NET app? Pin
Red_Wizard_Shot_The_Food15-Feb-06 5:32
Red_Wizard_Shot_The_Food15-Feb-06 5:32 
AnswerRe: How do i make an XML document only read/writeable by my ASP.NET app? Pin
Guffa15-Feb-06 6:42
Guffa15-Feb-06 6:42 
GeneralRe: How do i make an XML document only read/writeable by my ASP.NET app? Pin
Red_Wizard_Shot_The_Food15-Feb-06 6:46
Red_Wizard_Shot_The_Food15-Feb-06 6:46 
GeneralRe: How do i make an XML document only read/writeable by my ASP.NET app? Pin
Dan Neely15-Feb-06 7:10
Dan Neely15-Feb-06 7:10 
GeneralRe: How do i make an XML document only read/writeable by my ASP.NET app? Pin
J4amieC15-Feb-06 21:58
J4amieC15-Feb-06 21:58 
QuestionCutting out a triangular chunk in DirectX Pin
melanieab15-Feb-06 4:45
melanieab15-Feb-06 4:45 
Hi,
I'm completely new to DirectX, and have managed to create a 3D yawing, pitching, and rolling rectangle that zooms in (with the help of the graphics & game programming book by Tom Miller). I need to cut out a 3D triangle chunk (straight through, nothing fancy) from one of the long sides of the rectangle (about 1/4 size of that side and midway down).
To create my yawing, pitching, rolling rectangle, I used this:
private Mesh mesh = null;<br />
		public void InitializeGraphics()<br />
		{<br />
...<br />
			mesh = Mesh.Box(device, 0.78f, 2.0f, 0.5f);<br />
...<br />
		}<br />
		protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)<br />
		{<br />
...<br />
				DrawBox(angle / (float)Math.PI, angle / (float)Math.PI * 8.0f, angle / (float)Math.PI, -0.41f, 0.8f, hDepth);<br />
...<br />
}<br />
		private void DrawBox(float yaw, float pitch, float roll, float x, float y, float z)<br />
		{<br />
			angle += 0.01f;<br />
			device.Transform.World = Matrix.RotationYawPitchRoll(yaw, pitch, roll) * Matrix.Translation(x, y, z);<br />
			Material boxMaterial = new Material();<br />
			device.Lights[0].Type = LightType.Directional;<br />
			device.Lights[0].Diffuse = Color.Red;<br />
			device.Lights[0].Direction = new Vector3(0,-1,-1);<br />
			device.Lights[0].Commit();<br />
			device.Lights[0].Enabled = true;<br />
			boxMaterial.Diffuse = Color.White;<br />
			device.Material = boxMaterial;<br />
			mesh.DrawSubset(0);<br />
		}

I basically tried following the same steps as above to put a black triangle into that chunk of rectangle.
private Mesh tmesh = null;
(in InitializeGraphics) tmesh = Mesh.Polygon(device, 0.5f, 3);
(in OnPaint override) DrawTriangle(angle / (float)Math.PI, angle / (float)Math.PI * 8.0f, angle / (float)Math.PI, -0.41f, 0.8f, hDepth);
and then a private void DrawTriangle(float yaw, float pitch, float roll, float x, float y, float z) with basically the same innards as the DrawBox (replace mesh with tmesh, got rid of boxMaterial, and made Color.White (so I could see it)).
I'm thinking that this isn't the way to go because it's not doing what I'd like it to do. It appears to create a triangle, but only in 1 plane (Mesh.Polygon doesn't ask for for depth like Mesh.Box does). I then tried creating a bunch of triangles to create layers and it didn't work so well either. What's the best way to cut this chunk out?
Thanks so much! Smile | :)
Mel
QuestionLocalization issues with custom controls Pin
User 190837815-Feb-06 3:44
User 190837815-Feb-06 3:44 
AnswerRe: Localization issues with custom controls Pin
Andy Moore15-Feb-06 5:17
Andy Moore15-Feb-06 5:17 
GeneralRe: Localization issues with custom controls Pin
User 190837815-Feb-06 5:39
User 190837815-Feb-06 5:39 
AnswerRe: Localization issues with custom controls Pin
Andy Moore15-Feb-06 5:25
Andy Moore15-Feb-06 5:25 
Questionhow to represent xml document on treeviewer using c# Pin
panter_rose15-Feb-06 3:39
panter_rose15-Feb-06 3:39 
AnswerRe: how to represent xml document on treeviewer using c# Pin
PicklesTheClown15-Feb-06 6:18
PicklesTheClown15-Feb-06 6:18 
GeneralRe: how to represent xml document on treeviewer using c# Pin
panter_rose17-Feb-06 21:40
panter_rose17-Feb-06 21:40 
QuestionHelp Me! Pin
am2h15-Feb-06 3:08
am2h15-Feb-06 3:08 
AnswerRe: Help Me! Pin
J4amieC15-Feb-06 4:45
J4amieC15-Feb-06 4:45 
QuestionWin32 API Problems Pin
snouto15-Feb-06 2:13
snouto15-Feb-06 2:13 
AnswerRe: Win32 API Problems Pin
Dan Neely15-Feb-06 2:16
Dan Neely15-Feb-06 2:16 
QuestionHttp basic authentication problem Pin
khaasJ15-Feb-06 2:12
khaasJ15-Feb-06 2:12 
QuestionWhere can i find MSR.LST.Net.Rtp.dll? Pin
Divyang Mithaiwala15-Feb-06 1:28
Divyang Mithaiwala15-Feb-06 1:28 
AnswerRe: Where can i find MSR.LST.Net.Rtp.dll? Pin
Dave Kreskowiak15-Feb-06 14:38
mveDave Kreskowiak15-Feb-06 14:38 
GeneralRe: Where can i find MSR.LST.Net.Rtp.dll? Pin
KarstenK15-May-14 4:40
mveKarstenK15-May-14 4:40 
GeneralRe: Where can i find MSR.LST.Net.Rtp.dll? Pin
Dave Kreskowiak15-May-14 9:32
mveDave Kreskowiak15-May-14 9:32 
Questioncar plate recognition Pin
jianloong15-Feb-06 1:14
jianloong15-Feb-06 1:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.