[Question] Drawing in game? menu

Shout-Out

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 15 of 27
  1. #1
    -Ryuk-'s Avatar Elite User CoreCoins Purchaser Authenticator enabled
    Reputation
    529
    Join Date
    Nov 2009
    Posts
    1,028
    Thanks G/R
    38/51
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Question] Drawing in game?

    Hi guys,

    I seem to be having an issue with drawing.

    I had it working 2 or 3 patches ago, but today it seems to fail -.-

    I am trying to draw 'in' the world, for example drawing a circle at my location, when I move away I can see it in the distance. However in my test it looked like nothing was drawn. However when I added this code:

    Code:
    Device.DrawPrimitives(PrimitiveType.TriangleFan, 0, 32000);
    to my DrawCircle function this happened:


    this leads me to believe that its drawing, but in the wrong place.

    I am not 100% sure what's wrong but ill post some code that I have below:

    My Camera Struct:
    Code:
        public struct CameraInfo    {
            public float Aspect;
            public float FarZ;
            public float FieldOfView;
            public Matrix3 Matrix;
            public float NearZ;
            public Vector3 Position;
            private uint unk0;
            private uint unk1;
            private float unk2;
            private int unk3;
        }
    Drawing Addresses:
    Code:
           
            internal class Drawing //16/08/2012        {
                internal static uint WorldFrame = 0xAD7A10;
                internal static uint ActiveCamera = 0x80D0;
                internal static uint AspectRatio = 0xAD74A4;
            }
    My Draw Circle code:
    Code:
            public static void DrawCircle(Location center, float radius, Color innerColor, Color outerColor, int complexity = 24, bool isFilled = true)        {
                var vertices = new List<PositionColored>();
    
    
                if (isFilled)
                    vertices.Add(new PositionColored(Vector3.Zero, innerColor.ToArgb()));
    
    
                double stepAngle = (Math.PI*2)/complexity;
                for (int i = 0; i <= complexity; i++)
                {
                    double angle = (Math.PI*2) - (i*stepAngle);
                    var x = (float) (radius*Math.Cos(angle));
                    var y = (float) (-radius*Math.Sin(angle));
                    vertices.Add(new PositionColored(new Vector3(x, y, 0), outerColor.ToArgb()));
                }
    
    
                PositionColored[] buffer = vertices.ToArray();
    
    
                InternalRender(center.ToSlimV3() + new Vector3(0, 0, 0.3f));
    
    
                //Device.DrawPrimitives(PrimitiveType.TriangleFan, 0, 32000);
                if (isFilled)
                    Device.DrawUserPrimitives(PrimitiveType.TriangleFan, buffer.Length - 2, buffer);
                else
                    Device.DrawUserPrimitives(PrimitiveType.LineStrip, buffer.Length - 1, buffer);
            }
    I am not sure if this is enough to help me along. As it worked before I am quite confident that the drawing code is fine(but ugly xD), I think its my Camera Struct.

    Also, I should point out that I probably found a lot of this code here on OwnedCore.

    Thanks
    Last edited by -Ryuk-; 08-17-2012 at 10:33 AM.
    |Leacher:11/2009|Donor:02/2010|Established Member:09/2010|Contributor:09/2010|Elite:08/2013|

    [Question] Drawing in game?
  2. #2
    miceiken's Avatar Contributor Authenticator enabled
    Reputation
    209
    Join Date
    Dec 2007
    Posts
    401
    Thanks G/R
    7/9
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
        public struct CameraInfo
        {
            uint unk0;
            uint unk1;
            public Vector3 Position;
            public Matrix3 Matrix;
            public float FieldOfView;
            float unk2;
            int unk3;
            public float NearZ;
            public float FarZ;
            public float Aspect;
        }

  3. #3
    -Ryuk-'s Avatar Elite User CoreCoins Purchaser Authenticator enabled
    Reputation
    529
    Join Date
    Nov 2009
    Posts
    1,028
    Thanks G/R
    38/51
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by miceiken View Post
    Code:
        public struct CameraInfo
        {
            uint unk0;
            uint unk1;
            public Vector3 Position;
            public Matrix3 Matrix;
            public float FieldOfView;
            float unk2;
            int unk3;
            public float NearZ;
            public float FarZ;
            public float Aspect;
        }
    Thanks!

    Seems to work +Rep
    |Leacher:11/2009|Donor:02/2010|Established Member:09/2010|Contributor:09/2010|Elite:08/2013|

  4. #4
    Master674's Avatar Elite User
    Reputation
    487
    Join Date
    May 2008
    Posts
    578
    Thanks G/R
    2/23
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <something used to be here... its gone now>
    Last edited by Master674; 10-15-2012 at 12:50 PM.

  5. #5
    -Ryuk-'s Avatar Elite User CoreCoins Purchaser Authenticator enabled
    Reputation
    529
    Join Date
    Nov 2009
    Posts
    1,028
    Thanks G/R
    38/51
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Master674 View Post
    Did anyone of you get depth collision working? Doesn't seem to work for us :c

    depth collision = clipping of drawn stuff by wow world objects (like if its behind a tree etc)
    Nope, It still shows through the tree =/
    |Leacher:11/2009|Donor:02/2010|Established Member:09/2010|Contributor:09/2010|Elite:08/2013|

  6. #6
    Master674's Avatar Elite User
    Reputation
    487
    Join Date
    May 2008
    Posts
    578
    Thanks G/R
    2/23
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <something used to be here... its gone now>
    Last edited by Master674; 10-15-2012 at 12:50 PM.

  7. #7
    Bananenbrot's Avatar Contributor
    Reputation
    153
    Join Date
    Nov 2009
    Posts
    384
    Thanks G/R
    1/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Depth testing works, if you hook the right function and perform your drawing there. I tracked that down to what I named RenderBackgound. It's called from CWorldScene::Render.
    Code:
    [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
    private delegate void RenderBackgroundDelegate();
    Currently (4.3.4.15595) located at base + 0x2532E0.
    Last edited by Bananenbrot; 08-22-2012 at 05:39 PM. Reason: linebreak

  8. #8
    Vandra's Avatar Contributor
    Reputation
    288
    Join Date
    Mar 2008
    Posts
    471
    Thanks G/R
    26/26
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Bananenbrot View Post
    Depth testing works, if you hook the right function and perform your drawing there. I tracked that down to what I named RenderBackgound. It's called from CWorldScene::Render.
    Code:
    [UnmanagedFunctionPointer(CallingConvention.Cdecl)]private delegate void RenderBackgroundDelegate();
    Currently (4.3.4.15595) located at base + 0x2532E0.
    Thanks for this ;p

  9. #9
    -Ryuk-'s Avatar Elite User CoreCoins Purchaser Authenticator enabled
    Reputation
    529
    Join Date
    Nov 2009
    Posts
    1,028
    Thanks G/R
    38/51
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can also do with using LoS:

    Just tested:



    EDIT:Bananenbrot are you sure you are correct? when I detour base + 0x2532E0 my detour is never fired.

    EDIT 2: forgot to apply the detour -.-
    Last edited by -Ryuk-; 08-17-2012 at 03:41 PM.
    |Leacher:11/2009|Donor:02/2010|Established Member:09/2010|Contributor:09/2010|Elite:08/2013|

  10. #10
    Master674's Avatar Elite User
    Reputation
    487
    Join Date
    May 2008
    Posts
    578
    Thanks G/R
    2/23
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <something used to be here... its gone now>
    Last edited by Master674; 10-15-2012 at 12:50 PM.

  11. #11
    Bananenbrot's Avatar Contributor
    Reputation
    153
    Join Date
    Nov 2009
    Posts
    384
    Thanks G/R
    1/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Remember that the hook is called before your EndScene hook. Which means that you have to access state from the previous frame, which isn't there when you just started the bot.

  12. #12
    Master674's Avatar Elite User
    Reputation
    487
    Join Date
    May 2008
    Posts
    578
    Thanks G/R
    2/23
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <something used to be here... its gone now>
    Last edited by Master674; 10-15-2012 at 12:50 PM.

  13. #13
    -Ryuk-'s Avatar Elite User CoreCoins Purchaser Authenticator enabled
    Reputation
    529
    Join Date
    Nov 2009
    Posts
    1,028
    Thanks G/R
    38/51
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Master674 View Post
    Which variables do you set before rendering?
    Off Topic: Please check you WoW+ PM box
    Last edited by -Ryuk-; 08-17-2012 at 04:34 PM.
    |Leacher:11/2009|Donor:02/2010|Established Member:09/2010|Contributor:09/2010|Elite:08/2013|

  14. #14
    Bananenbrot's Avatar Contributor
    Reputation
    153
    Join Date
    Nov 2009
    Posts
    384
    Thanks G/R
    1/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Master674 View Post
    Which variables do you set before rendering?
    I managed to draw it behind the whole world, so it renders behind the hills even though its way more near to me
    You should do your rendering before you call the original function... and I don't set any specific variables, but you should leave out the first tick, so have some initial state (objectmanager, etc) to work with.

  15. #15
    Master674's Avatar Elite User
    Reputation
    487
    Join Date
    May 2008
    Posts
    578
    Thanks G/R
    2/23
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <something used to be here... its gone now>
    Last edited by Master674; 10-15-2012 at 12:49 PM.

Page 1 of 2 12 LastLast

Similar Threads

  1. [Question] Drawing Dots in Colors on GUI
    By d3rrial in forum Programming
    Replies: 0
    Last Post: 09-28-2010, 02:12 PM
  2. Question about cracking games\applications in general.
    By deafrow in forum Community Chat
    Replies: 2
    Last Post: 03-03-2010, 01:23 PM
  3. [Question] Best in game guide?
    By JakezShadow in forum World of Warcraft General
    Replies: 8
    Last Post: 01-17-2009, 10:16 PM
  4. Question on custom Game Objects
    By spc4101 in forum World of Warcraft Emulator Servers
    Replies: 6
    Last Post: 07-05-2008, 04:19 PM
All times are GMT -5. The time now is 11:48 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search