Results 1 to 3 of 3

Math Help - Rotating object

  1. #1
    Newbie
    Joined
    Nov 2010
    Posts
    4

    Rotating object

    I have a space ship that I want to rotate.

    Here is my current code (it executes when .turning = true):

    Code:
                            a = System.Math.Sin(.destStoppingAngle + System.Math.PI)
                            b = System.Math.Cos(.destStoppingAngle + System.Math.PI)
                            c = System.Math.Sin(.msngFacing)
                            d = System.Math.Cos(.msngFacing)
    
                            det = a * d - b * c
    
                            If det > 0 Then
    
                                .msngFacing = .msngFacing - .ROTATION_RATE * TV.TimeElapsed
                                If det < 0.1 Then
                                    .msngFacing = .destStoppingAngle
                                    .turning = False
                                End If
                            Else
                                .msngFacing = .msngFacing + .ROTATION_RATE * TV.TimeElapsed 
                                If det > 0.1 Then
                                    .msngFacing = .destStoppingAngle
                                    .turning = False
                                End If
                            End If
    It works like 95% of the time.... however sometimes it 'jumps' to the destination angle. What would be causing this?

    thanks

    Canning
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Member sbhatnagar's Avatar
    Joined
    Sep 2011
    From
    New Delhi, India
    Posts
    200
    Thanks
    17

    Re: Rotating object

    What programming language is this?
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Nov 2010
    Posts
    4

    Re: Rotating object

    Vb.net 2010
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Replies: 0
    Last Post: April 25th 2010, 08:23 AM
  2. Rotating around x and y axis
    Posted in the Calculus Forum
    Replies: 3
    Last Post: January 12th 2010, 10:29 PM
  3. Replies: 1
    Last Post: October 7th 2008, 01:18 AM
  4. Rotating a Rectangle Help
    Posted in the Geometry Forum
    Replies: 1
    Last Post: August 13th 2008, 06:44 AM
  5. Rotating Figures
    Posted in the Advanced Math Topics Forum
    Replies: 2
    Last Post: June 19th 2005, 08:24 AM

Search Tags


/mathhelpforum @mathhelpforum