Quantcast

Jump to content

» «
Photo

Draw text inside world?

47 replies to this topic
InfamousSabre
  • InfamousSabre

    Harpocrates

  • Members
  • Joined: 03 Jan 2013

#31

Posted 21 January 2014 - 06:35 AM Edited by InfamousSabre, 21 January 2014 - 11:06 AM.

aha very cool usage! maybe even.... thermal vision? ;)
 

9933384-drawing-the-human-body-seen-with

 

thermography.jpg

 

507944-robocop-windows-screenshot-use-th


Michael Wojtanis
  • Michael Wojtanis

    Rinepim

  • Members
  • Joined: 17 Jul 2013
  • Poland

#32

Posted 21 January 2014 - 11:14 AM

JULIONIB... i made first Batman vision! :<


julionib
  • julionib

    Coder

  • Feroci
  • Joined: 13 Sep 2012
  • Brazil

#33

Posted 21 January 2014 - 02:38 PM

JULIONIB... i made first Batman vision! :<

 

lol, rlx man, i dont will release anything similar to what i show in my video and also i didnt knew about your mod when i made the code or the video yesterday :)


Michael Wojtanis
  • Michael Wojtanis

    Rinepim

  • Members
  • Joined: 17 Jul 2013
  • Poland

#34

Posted 21 January 2014 - 04:14 PM

Yeah i know, becasue this is easy to code script.

 

You can release Your version because my is same but with batman visions :) Mini missions etc. :)

 

I will release today i think.

 

I just little sad because You have active community ... :(


julionib
  • julionib

    Coder

  • Feroci
  • Joined: 13 Sep 2012
  • Brazil

#35

Posted 22 January 2014 - 05:04 PM

yeh, i have some followers hehe, but this was result of hard work and a lot of support, i answer questions on facebook/blogger/youtube and help people install mods almost everyday, this helps me get more attention from more people.

if you want i can share your release video on my facebook and at featured video on my blog:

http://www.facebook.com/GtaIVScripting
http://gtaxscripting.blogspot.com

at this moment i dont have plans to use this skeleton idea, now im creating a buzzard script and using this beautiful method to draw the crosshair, i will use this forever haha:

  • Michael Wojtanis likes this

Michael Wojtanis
  • Michael Wojtanis

    Rinepim

  • Members
  • Joined: 17 Jul 2013
  • Poland

#36

Posted 22 January 2014 - 10:10 PM

You can if You want.

BTw. Add me on Skype.

 

GTA IV: Los Santos wait for You... ;<


InfamousSabre
  • InfamousSabre

    Harpocrates

  • Members
  • Joined: 03 Jan 2013

#37

Posted 22 January 2014 - 11:10 PM

Looks good man. I left you a comment on YT with some constructive crits. :)


julionib
  • julionib

    Coder

  • Feroci
  • Joined: 13 Sep 2012
  • Brazil

#38

Posted 09 February 2014 - 04:59 AM

the method CAM_IS_SPHERE_VISIBLE seems to stop working after you use Load game feature (at least on patch 1.0.7.0), anyone knows a solution or cause?


Michael Wojtanis
  • Michael Wojtanis

    Rinepim

  • Members
  • Joined: 17 Jul 2013
  • Poland

#39

Posted 13 February 2014 - 11:31 AM

float direction_to_that_ped =  Vector3.Subtract(Vector3.Normalize(Vector3.Subtract(myPed, Game.CurrentCamera.Position)),Game.CurrentCamera.Direction).Length();
if (direction_to_that_ped >0.6F)
{
Game.Console.Print("NOT VISIBLE");
continue;
}

Simple works:

current camera direction - direction to that object [in example - ped] and result in float.

If distance from center [camera direction] is bigger than 0.6 then not visible.

 

Rember - there is 3 values!  I just make it simple to working in sphere detection.

If You want more precise just delete lenght and work on X and Y detections of screen.

 

Have fun ;)


julionib
  • julionib

    Coder

  • Feroci
  • Joined: 13 Sep 2012
  • Brazil

#40

Posted 13 February 2014 - 05:32 PM

i made something similar to fix this issue, i calc the distance from the camera center clsoer to the target object, if less than distance to camera its considered visible, unfortunately both methods dont will consider buildings/ground


LordOfTheBongs
  • LordOfTheBongs

    Deceased

  • Members
  • Joined: 21 Sep 2013
  • None

#41

Posted 13 February 2014 - 09:16 PM Edited by LordOfTheBongs, 14 February 2014 - 06:29 PM.

i made something similar to fix this issue, i calc the distance from the camera center clsoer to the target object, if less than distance to camera its considered visible, unfortunately both methods dont will consider buildings/ground

 

try to add a check for on screen, maybe it will fix issues with buildings...

GTA.Native.Function.Call<bool>("IS_OBJECT_ON_SCREEN", obj);

if that doesnt work u can always try metadata xD


julionib
  • julionib

    Coder

  • Feroci
  • Joined: 13 Sep 2012
  • Brazil

#42

Posted 14 February 2014 - 07:20 PM

metadata? i remember you hehe

  • LordOfTheBongs likes this

Michael Wojtanis
  • Michael Wojtanis

    Rinepim

  • Members
  • Joined: 17 Jul 2013
  • Poland

#43

Posted 16 February 2014 - 03:19 PM

Julio check this:

(CELL_CAM_ACTIVATE,true, false);
extern boolean CELL_CAM_IS_CHAR_VISIBLE(Ped ped);
extern boolean CELL_CAM_IS_CHAR_VISIBLE_NO_FACE_CHECK(Ped ped);

For me working fine for PEDs.

 

If You want detect if car is visible or object we just need find other way [attach ped to car, make invisible + without reactions + without collision?].


julionib
  • julionib

    Coder

  • Feroci
  • Joined: 13 Sep 2012
  • Brazil

#44

Posted 16 February 2014 - 03:30 PM

but this will activate the cellphone cam right?


Michael Wojtanis
  • Michael Wojtanis

    Rinepim

  • Members
  • Joined: 17 Jul 2013
  • Poland

#45

Posted 16 February 2014 - 03:32 PM

No, that is why i called "true,false". I just found and tested 20 sec, mayby this do not need activation? :)

Try :)


Jitnaught
  • Jitnaught

    ✰✰✰✰✰✰

  • Members
  • Joined: 24 Aug 2013
  • United-States

#46

Posted 09 June 2014 - 10:48 PM

today i made a test with this native call, its just perfect:

 

 

its possible create some cool effects like "x ray vision" or something like that

 

Can I ask what your coefficient (or whatever you want to call it) was for this? I can make things that are close to what I want, but in your video it's perfect.


julionib
  • julionib

    Coder

  • Feroci
  • Joined: 13 Sep 2012
  • Brazil

#47

Posted 10 June 2014 - 01:57 AM Edited by julionib, 10 June 2014 - 01:59 AM.

i used this code in that video, but it need some improvement:

Imports System
Imports System.Drawing
Imports System.Windows.Forms
Imports GTA
Imports System.IO
Imports System.Text

Public Class SkeletonDraw
    Inherits Script

    Private bModOK As Boolean = False

    Shared TRandom As Random = New Random(Now.Millisecond)

    Public Sub New()
        Me.Interval = 10

        Wait(500)

        bModOK = Not Native.Function.Call(Of Boolean)("IS_NETWORK_SESSION") OrElse Native.Function.Call(Of Boolean)("IS_PARTY_MODE")

        If Not bModOK Then
            msg("You can't use this script in this kind of MP mode, only in party mode.", 3000)
            Game.Console.Print("You can't use this script in multiplayer because this is considered cheating.")
            Exit Sub
        End If
    End Sub

    Public Function CoordToScreen(posOn3D As Vector3) As Vector2
        Try
            Dim Screen As Int32 = 0
            Dim x As Native.Pointer = New GTA.Native.Pointer(GetType(Single))
            Dim y As Native.Pointer = New GTA.Native.Pointer(GetType(Single))
            Dim xPos As Vector3 = posOn3D
            Dim ViewportId As Native.Pointer = New GTA.Native.Pointer(GetType(Int32))

            GTA.Native.Function.Call("GET_GAME_VIEWPORT_ID", ViewportId)

            Screen = ViewportId

            GTA.Native.Function.Call("GET_VIEWPORT_POSITION_OF_COORD", xPos.X, xPos.Y, xPos.Z, Screen, x, y)

            Return New Vector2(x, y)
        Catch
        End Try

        Return New Vector2(0, 0)
    End Function

    Public Function isCoordVisible(WorldCoord As Vector3, Optional AreaSize As Double = 1.0F) As Boolean
        Try
            If Game.Exists(Game.CurrentCamera) Then
                Return Native.Function.Call(Of Boolean)("CAM_IS_SPHERE_VISIBLE", Game.CurrentCamera, WorldCoord.X, WorldCoord.Y, WorldCoord.Z, AreaSize)
            Else
                Return False
            End If
        Catch
        End Try

        Return False
    End Function

    Shared Sub msg(ByVal smsg As String, ByVal time As Int32)
        Native.Function.Call("PRINT_STRING_WITH_LITERAL_STRING_NOW", "STRING", smsg, time, 1)
    End Sub

    Private Sub keyDown(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyDown
        If Not bModOK Then
            Exit Sub
        End If

        If e.Key = Keys.B Then
            bVisible = Not bVisible
            msg("Peds visible: " & bVisible, 5000)
        End If
    End Sub

    Private Sub keyUp(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyUp
        If Not bModOK Then
            Exit Sub
        End If
    End Sub

    Private Class TSkeleton
        Public p As Ped = Nothing
        Public bonePos2D As New List(Of Vector2)
        Public sizeMulti As Double = 1

        Public Sub New(tped As Ped)
            p = tped
            sizeMulti = 33 / p.Position.DistanceTo(Game.CurrentCamera.Position)
            skeletonList.Add(Me)
        End Sub
    End Class

    Shared skeletonList As New List(Of TSkeleton)
    Private tmpSkeleton As TSkeleton

    Private bVisible As Boolean = True
    Private bDrawSkeleton As Boolean = False

    Private bchangeRot As Boolean = False 

    Private bReset As Boolean = True

    Private Sub general_tick(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Tick
        If Not bModOK Then
            Exit Sub
        End If

        If bDrawSkeleton Then
            skeletonList.Clear()

            For Each p As Ped In World.GetPeds(Player.Character.Position, 20)
                If Exists(p) Then
                    p.Visible = bVisible
                    tmpSkeleton = New TSkeleton(p)
                End If
            Next

            For Each s As TSkeleton In skeletonList
                s.bonePos2D.Clear()

                If Not s.p.isOnScreen Then Continue For

                s.bonePos2D.Add(CoordToScreen(s.p.GetBonePosition(Bone.Head)))
                s.bonePos2D.Add(CoordToScreen(s.p.GetBonePosition(Bone.Neck)))
                s.bonePos2D.Add(CoordToScreen(s.p.GetBonePosition(Bone.LeftArmRoll)))
                s.bonePos2D.Add(CoordToScreen(s.p.GetBonePosition(Bone.RightArmRoll)))
                s.bonePos2D.Add(CoordToScreen(s.p.GetBonePosition(Bone.LeftForearmTwist)))
                s.bonePos2D.Add(CoordToScreen(s.p.GetBonePosition(Bone.RightForearmTwist)))
                s.bonePos2D.Add(CoordToScreen(s.p.GetBonePosition(Bone.LeftHand)))
                s.bonePos2D.Add(CoordToScreen(s.p.GetBonePosition(Bone.RightHand)))
                s.bonePos2D.Add(CoordToScreen(s.p.GetBonePosition(Bone.LeftFinger1)))
                s.bonePos2D.Add(CoordToScreen(s.p.GetBonePosition(Bone.RightFinger1)))
                s.bonePos2D.Add(CoordToScreen(s.p.GetBonePosition(Bone.Spine)))
                s.bonePos2D.Add(CoordToScreen(s.p.GetBonePosition(Bone.LeftThigh)))
                s.bonePos2D.Add(CoordToScreen(s.p.GetBonePosition(Bone.RightThigh)))
                s.bonePos2D.Add(CoordToScreen(s.p.GetBonePosition(Bone.LeftCalfRoll)))
                s.bonePos2D.Add(CoordToScreen(s.p.GetBonePosition(Bone.RightCalfRoll)))
                s.bonePos2D.Add(CoordToScreen(s.p.GetBonePosition(Bone.LeftFoot)))
                s.bonePos2D.Add(CoordToScreen(s.p.GetBonePosition(Bone.RightFoot)))
                s.bonePos2D.Add(CoordToScreen(s.p.GetBonePosition(Bone.LeftToe)))
                s.bonePos2D.Add(CoordToScreen(s.p.GetBonePosition(Bone.RightToe)))
                s.bonePos2D.Add(CoordToScreen(s.p.GetBonePosition(Bone.Head) + Vector3.WorldUp * 0.15))
            Next
        End If
    End Sub

    Private Sub console_CMD(ByVal sender As Object, ByVal e As ConsoleEventArgs) Handles MyBase.ConsoleCommand
        If Not bModOK Then
            Exit Sub
        End If

        If e.Command = "skeleton" Then
            bDrawSkeleton = Not bDrawSkeleton
        End If
    End Sub

    Shared Sub waitEx(time As Int16)
        Dim timeIni As DateTime = Now
        Dim timeSpan As TimeSpan = Now.Subtract(timeIni)

        While timeSpan.TotalMilliseconds < time
            Game.WaitInCurrentScript(10)
            timeSpan = Now.Subtract(timeIni)
        End While
    End Sub

    Private Sub GraphicsEventHandler(ByVal sender As Object, ByVal e As GTA.GraphicsEventArgs) Handles MyBase.PerFrameDrawing
        If bDrawSkeleton Then
            For Each s As TSkeleton In skeletonList
                If s.bonePos2D.Count > 0 Then
                    e.Graphics.DrawLine(s.bonePos2D.Item(1).X, s.bonePos2D.Item(1).Y, s.bonePos2D.Item(2).X, s.bonePos2D.Item(2).Y, s.sizeMulti, Color.Red)
                    e.Graphics.DrawLine(s.bonePos2D.Item(1).X, s.bonePos2D.Item(1).Y, s.bonePos2D.Item(3).X, s.bonePos2D.Item(3).Y, s.sizeMulti, Color.Red)
                    e.Graphics.DrawLine(s.bonePos2D.Item(2).X, s.bonePos2D.Item(2).Y, s.bonePos2D.Item(4).X, s.bonePos2D.Item(4).Y, s.sizeMulti, Color.Blue)
                    e.Graphics.DrawLine(s.bonePos2D.Item(3).X, s.bonePos2D.Item(3).Y, s.bonePos2D.Item(5).X, s.bonePos2D.Item(5).Y, s.sizeMulti, Color.Blue)
                    e.Graphics.DrawLine(s.bonePos2D.Item(4).X, s.bonePos2D.Item(4).Y, s.bonePos2D.Item(6).X, s.bonePos2D.Item(6).Y, s.sizeMulti, Color.Yellow)
                    e.Graphics.DrawLine(s.bonePos2D.Item(5).X, s.bonePos2D.Item(5).Y, s.bonePos2D.Item(7).X, s.bonePos2D.Item(7).Y, s.sizeMulti, Color.Yellow)
                    e.Graphics.DrawLine(s.bonePos2D.Item(6).X, s.bonePos2D.Item(6).Y, s.bonePos2D.Item(8).X, s.bonePos2D.Item(8).Y, s.sizeMulti, Color.Orange)
                    e.Graphics.DrawLine(s.bonePos2D.Item(7).X, s.bonePos2D.Item(7).Y, s.bonePos2D.Item(9).X, s.bonePos2D.Item(9).Y, s.sizeMulti, Color.Orange)
                    e.Graphics.DrawLine(s.bonePos2D.Item(1).X, s.bonePos2D.Item(1).Y, s.bonePos2D.Item(10).X, s.bonePos2D.Item(10).Y, s.sizeMulti, Color.Aqua)
                    e.Graphics.DrawLine(s.bonePos2D.Item(10).X, s.bonePos2D.Item(10).Y, s.bonePos2D.Item(11).X, s.bonePos2D.Item(11).Y, s.sizeMulti, Color.Aquamarine)
                    e.Graphics.DrawLine(s.bonePos2D.Item(10).X, s.bonePos2D.Item(10).Y, s.bonePos2D.Item(12).X, s.bonePos2D.Item(12).Y, s.sizeMulti, Color.Aquamarine)
                    e.Graphics.DrawLine(s.bonePos2D.Item(11).X, s.bonePos2D.Item(11).Y, s.bonePos2D.Item(13).X, s.bonePos2D.Item(13).Y, s.sizeMulti, Color.BlueViolet)
                    e.Graphics.DrawLine(s.bonePos2D.Item(12).X, s.bonePos2D.Item(12).Y, s.bonePos2D.Item(14).X, s.bonePos2D.Item(14).Y, s.sizeMulti, Color.BlueViolet)
                    e.Graphics.DrawLine(s.bonePos2D.Item(13).X, s.bonePos2D.Item(13).Y, s.bonePos2D.Item(15).X, s.bonePos2D.Item(15).Y, s.sizeMulti, Color.CadetBlue)
                    e.Graphics.DrawLine(s.bonePos2D.Item(14).X, s.bonePos2D.Item(14).Y, s.bonePos2D.Item(16).X, s.bonePos2D.Item(16).Y, s.sizeMulti, Color.CadetBlue)
                    e.Graphics.DrawLine(s.bonePos2D.Item(15).X, s.bonePos2D.Item(15).Y, s.bonePos2D.Item(17).X, s.bonePos2D.Item(17).Y, s.sizeMulti, Color.GreenYellow)
                    e.Graphics.DrawLine(s.bonePos2D.Item(16).X, s.bonePos2D.Item(16).Y, s.bonePos2D.Item(18).X, s.bonePos2D.Item(18).Y, s.sizeMulti, Color.GreenYellow)

                    For c As Int16 = 0 To 19
                        e.Graphics.DrawRectangle(s.bonePos2D.Item(c).X, s.bonePos2D.Item(c).Y, s.sizeMulti * 2, s.sizeMulti * 2, Color.White)
                    Next

                    e.Graphics.DrawLine(s.bonePos2D.Item(0).X, s.bonePos2D.Item(0).Y, s.bonePos2D.Item(19).X, s.bonePos2D.Item(19).Y, s.sizeMulti * 4, Color.Red)
                End If
            Next
        End If
    End Sub
End Class

  • Wiebrendh likes this

Jitnaught
  • Jitnaught

    ✰✰✰✰✰✰

  • Members
  • Joined: 24 Aug 2013
  • United-States

#48

Posted 10 June 2014 - 02:35 AM

 

i used this code in that video, but it need some improvement:

Imports System
Imports System.Drawing
Imports System.Windows.Forms
Imports GTA
Imports System.IO
Imports System.Text

Public Class SkeletonDraw
    Inherits Script

    Private bModOK As Boolean = False

    Shared TRandom As Random = New Random(Now.Millisecond)

    Public Sub New()
        Me.Interval = 10

        Wait(500)

        bModOK = Not Native.Function.Call(Of Boolean)("IS_NETWORK_SESSION") OrElse Native.Function.Call(Of Boolean)("IS_PARTY_MODE")

        If Not bModOK Then
            msg("You can't use this script in this kind of MP mode, only in party mode.", 3000)
            Game.Console.Print("You can't use this script in multiplayer because this is considered cheating.")
            Exit Sub
        End If
    End Sub

    Public Function CoordToScreen(posOn3D As Vector3) As Vector2
        Try
            Dim Screen As Int32 = 0
            Dim x As Native.Pointer = New GTA.Native.Pointer(GetType(Single))
            Dim y As Native.Pointer = New GTA.Native.Pointer(GetType(Single))
            Dim xPos As Vector3 = posOn3D
            Dim ViewportId As Native.Pointer = New GTA.Native.Pointer(GetType(Int32))

            GTA.Native.Function.Call("GET_GAME_VIEWPORT_ID", ViewportId)

            Screen = ViewportId

            GTA.Native.Function.Call("GET_VIEWPORT_POSITION_OF_COORD", xPos.X, xPos.Y, xPos.Z, Screen, x, y)

            Return New Vector2(x, y)
        Catch
        End Try

        Return New Vector2(0, 0)
    End Function

    Public Function isCoordVisible(WorldCoord As Vector3, Optional AreaSize As Double = 1.0F) As Boolean
        Try
            If Game.Exists(Game.CurrentCamera) Then
                Return Native.Function.Call(Of Boolean)("CAM_IS_SPHERE_VISIBLE", Game.CurrentCamera, WorldCoord.X, WorldCoord.Y, WorldCoord.Z, AreaSize)
            Else
                Return False
            End If
        Catch
        End Try

        Return False
    End Function

    Shared Sub msg(ByVal smsg As String, ByVal time As Int32)
        Native.Function.Call("PRINT_STRING_WITH_LITERAL_STRING_NOW", "STRING", smsg, time, 1)
    End Sub

    Private Sub keyDown(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyDown
        If Not bModOK Then
            Exit Sub
        End If

        If e.Key = Keys.B Then
            bVisible = Not bVisible
            msg("Peds visible: " & bVisible, 5000)
        End If
    End Sub

    Private Sub keyUp(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyUp
        If Not bModOK Then
            Exit Sub
        End If
    End Sub

    Private Class TSkeleton
        Public p As Ped = Nothing
        Public bonePos2D As New List(Of Vector2)
        Public sizeMulti As Double = 1

        Public Sub New(tped As Ped)
            p = tped
            sizeMulti = 33 / p.Position.DistanceTo(Game.CurrentCamera.Position)
            skeletonList.Add(Me)
        End Sub
    End Class

    Shared skeletonList As New List(Of TSkeleton)
    Private tmpSkeleton As TSkeleton

    Private bVisible As Boolean = True
    Private bDrawSkeleton As Boolean = False

    Private bchangeRot As Boolean = False 

    Private bReset As Boolean = True

    Private Sub general_tick(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Tick
        If Not bModOK Then
            Exit Sub
        End If

        If bDrawSkeleton Then
            skeletonList.Clear()

            For Each p As Ped In World.GetPeds(Player.Character.Position, 20)
                If Exists(p) Then
                    p.Visible = bVisible
                    tmpSkeleton = New TSkeleton(p)
                End If
            Next

            For Each s As TSkeleton In skeletonList
                s.bonePos2D.Clear()

                If Not s.p.isOnScreen Then Continue For

                s.bonePos2D.Add(CoordToScreen(s.p.GetBonePosition(Bone.Head)))
                s.bonePos2D.Add(CoordToScreen(s.p.GetBonePosition(Bone.Neck)))
                s.bonePos2D.Add(CoordToScreen(s.p.GetBonePosition(Bone.LeftArmRoll)))
                s.bonePos2D.Add(CoordToScreen(s.p.GetBonePosition(Bone.RightArmRoll)))
                s.bonePos2D.Add(CoordToScreen(s.p.GetBonePosition(Bone.LeftForearmTwist)))
                s.bonePos2D.Add(CoordToScreen(s.p.GetBonePosition(Bone.RightForearmTwist)))
                s.bonePos2D.Add(CoordToScreen(s.p.GetBonePosition(Bone.LeftHand)))
                s.bonePos2D.Add(CoordToScreen(s.p.GetBonePosition(Bone.RightHand)))
                s.bonePos2D.Add(CoordToScreen(s.p.GetBonePosition(Bone.LeftFinger1)))
                s.bonePos2D.Add(CoordToScreen(s.p.GetBonePosition(Bone.RightFinger1)))
                s.bonePos2D.Add(CoordToScreen(s.p.GetBonePosition(Bone.Spine)))
                s.bonePos2D.Add(CoordToScreen(s.p.GetBonePosition(Bone.LeftThigh)))
                s.bonePos2D.Add(CoordToScreen(s.p.GetBonePosition(Bone.RightThigh)))
                s.bonePos2D.Add(CoordToScreen(s.p.GetBonePosition(Bone.LeftCalfRoll)))
                s.bonePos2D.Add(CoordToScreen(s.p.GetBonePosition(Bone.RightCalfRoll)))
                s.bonePos2D.Add(CoordToScreen(s.p.GetBonePosition(Bone.LeftFoot)))
                s.bonePos2D.Add(CoordToScreen(s.p.GetBonePosition(Bone.RightFoot)))
                s.bonePos2D.Add(CoordToScreen(s.p.GetBonePosition(Bone.LeftToe)))
                s.bonePos2D.Add(CoordToScreen(s.p.GetBonePosition(Bone.RightToe)))
                s.bonePos2D.Add(CoordToScreen(s.p.GetBonePosition(Bone.Head) + Vector3.WorldUp * 0.15))
            Next
        End If
    End Sub

    Private Sub console_CMD(ByVal sender As Object, ByVal e As ConsoleEventArgs) Handles MyBase.ConsoleCommand
        If Not bModOK Then
            Exit Sub
        End If

        If e.Command = "skeleton" Then
            bDrawSkeleton = Not bDrawSkeleton
        End If
    End Sub

    Shared Sub waitEx(time As Int16)
        Dim timeIni As DateTime = Now
        Dim timeSpan As TimeSpan = Now.Subtract(timeIni)

        While timeSpan.TotalMilliseconds < time
            Game.WaitInCurrentScript(10)
            timeSpan = Now.Subtract(timeIni)
        End While
    End Sub

    Private Sub GraphicsEventHandler(ByVal sender As Object, ByVal e As GTA.GraphicsEventArgs) Handles MyBase.PerFrameDrawing
        If bDrawSkeleton Then
            For Each s As TSkeleton In skeletonList
                If s.bonePos2D.Count > 0 Then
                    e.Graphics.DrawLine(s.bonePos2D.Item(1).X, s.bonePos2D.Item(1).Y, s.bonePos2D.Item(2).X, s.bonePos2D.Item(2).Y, s.sizeMulti, Color.Red)
                    e.Graphics.DrawLine(s.bonePos2D.Item(1).X, s.bonePos2D.Item(1).Y, s.bonePos2D.Item(3).X, s.bonePos2D.Item(3).Y, s.sizeMulti, Color.Red)
                    e.Graphics.DrawLine(s.bonePos2D.Item(2).X, s.bonePos2D.Item(2).Y, s.bonePos2D.Item(4).X, s.bonePos2D.Item(4).Y, s.sizeMulti, Color.Blue)
                    e.Graphics.DrawLine(s.bonePos2D.Item(3).X, s.bonePos2D.Item(3).Y, s.bonePos2D.Item(5).X, s.bonePos2D.Item(5).Y, s.sizeMulti, Color.Blue)
                    e.Graphics.DrawLine(s.bonePos2D.Item(4).X, s.bonePos2D.Item(4).Y, s.bonePos2D.Item(6).X, s.bonePos2D.Item(6).Y, s.sizeMulti, Color.Yellow)
                    e.Graphics.DrawLine(s.bonePos2D.Item(5).X, s.bonePos2D.Item(5).Y, s.bonePos2D.Item(7).X, s.bonePos2D.Item(7).Y, s.sizeMulti, Color.Yellow)
                    e.Graphics.DrawLine(s.bonePos2D.Item(6).X, s.bonePos2D.Item(6).Y, s.bonePos2D.Item(8).X, s.bonePos2D.Item(8).Y, s.sizeMulti, Color.Orange)
                    e.Graphics.DrawLine(s.bonePos2D.Item(7).X, s.bonePos2D.Item(7).Y, s.bonePos2D.Item(9).X, s.bonePos2D.Item(9).Y, s.sizeMulti, Color.Orange)
                    e.Graphics.DrawLine(s.bonePos2D.Item(1).X, s.bonePos2D.Item(1).Y, s.bonePos2D.Item(10).X, s.bonePos2D.Item(10).Y, s.sizeMulti, Color.Aqua)
                    e.Graphics.DrawLine(s.bonePos2D.Item(10).X, s.bonePos2D.Item(10).Y, s.bonePos2D.Item(11).X, s.bonePos2D.Item(11).Y, s.sizeMulti, Color.Aquamarine)
                    e.Graphics.DrawLine(s.bonePos2D.Item(10).X, s.bonePos2D.Item(10).Y, s.bonePos2D.Item(12).X, s.bonePos2D.Item(12).Y, s.sizeMulti, Color.Aquamarine)
                    e.Graphics.DrawLine(s.bonePos2D.Item(11).X, s.bonePos2D.Item(11).Y, s.bonePos2D.Item(13).X, s.bonePos2D.Item(13).Y, s.sizeMulti, Color.BlueViolet)
                    e.Graphics.DrawLine(s.bonePos2D.Item(12).X, s.bonePos2D.Item(12).Y, s.bonePos2D.Item(14).X, s.bonePos2D.Item(14).Y, s.sizeMulti, Color.BlueViolet)
                    e.Graphics.DrawLine(s.bonePos2D.Item(13).X, s.bonePos2D.Item(13).Y, s.bonePos2D.Item(15).X, s.bonePos2D.Item(15).Y, s.sizeMulti, Color.CadetBlue)
                    e.Graphics.DrawLine(s.bonePos2D.Item(14).X, s.bonePos2D.Item(14).Y, s.bonePos2D.Item(16).X, s.bonePos2D.Item(16).Y, s.sizeMulti, Color.CadetBlue)
                    e.Graphics.DrawLine(s.bonePos2D.Item(15).X, s.bonePos2D.Item(15).Y, s.bonePos2D.Item(17).X, s.bonePos2D.Item(17).Y, s.sizeMulti, Color.GreenYellow)
                    e.Graphics.DrawLine(s.bonePos2D.Item(16).X, s.bonePos2D.Item(16).Y, s.bonePos2D.Item(18).X, s.bonePos2D.Item(18).Y, s.sizeMulti, Color.GreenYellow)

                    For c As Int16 = 0 To 19
                        e.Graphics.DrawRectangle(s.bonePos2D.Item(c).X, s.bonePos2D.Item(c).Y, s.sizeMulti * 2, s.sizeMulti * 2, Color.White)
                    Next

                    e.Graphics.DrawLine(s.bonePos2D.Item(0).X, s.bonePos2D.Item(0).Y, s.bonePos2D.Item(19).X, s.bonePos2D.Item(19).Y, s.sizeMulti * 4, Color.Red)
                End If
            Next
        End If
    End Sub
End Class

 

Thanks! :D





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users