Click here to Skip to main content
15,919,358 members
Home / Discussions / C#
   

C#

 
GeneralRe: crone file Pin
altafmohd16-Mar-12 2:07
altafmohd16-Mar-12 2:07 
QuestionCouldn't able to access functions in a web service reference Pin
NarVish15-Mar-12 0:58
NarVish15-Mar-12 0:58 
AnswerRe: Couldn't able to access functions in a web service reference Pin
dan!sh 15-Mar-12 1:30
professional dan!sh 15-Mar-12 1:30 
GeneralRe: Couldn't able to access functions in a web service reference Pin
NarVish15-Mar-12 1:43
NarVish15-Mar-12 1:43 
GeneralRe: Couldn't able to access functions in a web service reference Pin
dan!sh 15-Mar-12 1:44
professional dan!sh 15-Mar-12 1:44 
GeneralRe: Couldn't able to access functions in a web service reference Pin
NarVish15-Mar-12 2:13
NarVish15-Mar-12 2:13 
GeneralRe: Couldn't able to access functions in a web service reference Pin
NarVish15-Mar-12 2:55
NarVish15-Mar-12 2:55 
QuestionXNA framework Accelerometer values Pin
DerecL14-Mar-12 22:59
DerecL14-Mar-12 22:59 
I am doing some project where I read values from accelerometer sensor. I also want to apply XNA framework where I rotate model according to sensor values (angles). I am using example from App Hub website. However the Draw() method is protected and I don't know how to redraw model according to sensors values not to timer ElapsedSeconds. There is Draw() method:
C#
   partial class ModelViewerControl : GraphicsDeviceControl
    {
protected override void Draw()
        {
            // Clear to the default control background color.
            Color backColor = new Color(BackColor.R, BackColor.G, BackColor.B);

            GraphicsDevice.Clear(backColor);

            if (model != null)
            {
                // Compute camera matrices.
                float rotation = (float)timer.Elapsed.TotalSeconds;

                Vector3 eyePosition = modelCenter;

                eyePosition.Z += modelRadius * 2;
                eyePosition.Y += modelRadius;

                float aspectRatio = GraphicsDevice.Viewport.AspectRatio;

                float nearClip = modelRadius / 100;
                float farClip = modelRadius * 100;
                
                // Matrix world = Matrix.CreateRotationY(rotation);
                Matrix world = Matrix.CreateFromYawPitchRoll((float)0, (float)rotation, (float)rotation);

                Matrix view = Matrix.CreateLookAt(eyePosition, modelCenter, Vector3.Up);
                Matrix projection = Matrix.CreatePerspectiveFieldOfView(1, aspectRatio, nearClip, farClip);

                // Draw the model.
                foreach (ModelMesh mesh in model.Meshes)
                {
                    foreach (BasicEffect effect in mesh.Effects)
                    {
                        //effect.World = boneTransforms[mesh.ParentBone.Index] * worldX;
                        effect.World = boneTransforms[mesh.ParentBone.Index] * world;
                        
                        // effect.World = boneTransforms[mesh.ParentBone.Index] * worldZ;
                        //effect.World = Matrix.CreateFromYawPitchRoll(yaw, pitch, roll);
                        effect.View = view;
                        effect.Projection = projection;

                        effect.EnableDefaultLighting();
                        effect.PreferPerPixelLighting = true;
                        effect.SpecularPower = 16;
                    }

                    mesh.Draw();
                }
            }
        }
}


And there is port_DataReceived():
C#
private void port_DataReceived(object sender, SerialDataReceivedEventArgs e)
        {
            switch (comport.ReadChar())
            {
                case 'B':
                    byte[] angle;
                    angle = new byte[2];
                    comport.Read(angle, 0, 2);
                    break;
            }
        }

If somebody knows how to do that or who have any idea, please let me know that.
AnswerRe: XNA framework Accelerometer values Pin
Clark Kent12315-Mar-12 2:00
professionalClark Kent12315-Mar-12 2:00 
Questionhow to write part of application widow to vga or usb out as video stream Pin
jayachanakya14-Mar-12 19:13
jayachanakya14-Mar-12 19:13 
AnswerRe: how to write part of application widow to vga or usb out as video stream Pin
OriginalGriff15-Mar-12 1:59
mveOriginalGriff15-Mar-12 1:59 
QuestionMono tutorial required! Pin
jsdhgkjdsahklg14-Mar-12 10:51
jsdhgkjdsahklg14-Mar-12 10:51 
AnswerRe: Mono tutorial required! Pin
Dave Kreskowiak14-Mar-12 10:58
mveDave Kreskowiak14-Mar-12 10:58 
GeneralRe: Mono tutorial required! Pin
jsdhgkjdsahklg14-Mar-12 11:01
jsdhgkjdsahklg14-Mar-12 11:01 
GeneralRe: Mono tutorial required! Pin
Dave Kreskowiak14-Mar-12 11:30
mveDave Kreskowiak14-Mar-12 11:30 
AnswerRe: Mono tutorial required! Pin
Eddy Vluggen14-Mar-12 11:01
professionalEddy Vluggen14-Mar-12 11:01 
GeneralRe: Mono tutorial required! Pin
jsdhgkjdsahklg14-Mar-12 11:08
jsdhgkjdsahklg14-Mar-12 11:08 
AnswerRe: Mono tutorial required! Pin
Eddy Vluggen14-Mar-12 12:13
professionalEddy Vluggen14-Mar-12 12:13 
GeneralRe: Mono tutorial required! Pin
Pete O'Hanlon14-Mar-12 12:15
mvePete O'Hanlon14-Mar-12 12:15 
GeneralRe: Mono tutorial required! Pin
Mycroft Holmes14-Mar-12 19:51
professionalMycroft Holmes14-Mar-12 19:51 
GeneralRe: Mono tutorial required! Pin
Pete O'Hanlon14-Mar-12 22:31
mvePete O'Hanlon14-Mar-12 22:31 
GeneralRe: Mono tutorial required! Pin
DaveyM6915-Mar-12 5:19
professionalDaveyM6915-Mar-12 5:19 
GeneralC# coding example using AHP technique Pin
anwar90_scout@yahoo.com14-Mar-12 5:00
anwar90_scout@yahoo.com14-Mar-12 5:00 
GeneralRe: C# coding example using AHP technique Pin
OriginalGriff14-Mar-12 5:15
mveOriginalGriff14-Mar-12 5:15 
GeneralRe: C# coding example using AHP technique Pin
Keith Barrow14-Mar-12 11:28
professionalKeith Barrow14-Mar-12 11:28 

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.