@Dokota628 Thanks for the work. I've got the console running, but still got some problem when I tried to get the location of vehicles and pedestrian on the screen. the coordinates are not correct. I am using the following code:
Rectangle3D bb3d = new Rectangle3D(location, size).Rotate(GTAFuncs.GetEntityQuaternion(v)); // to get the 3d bounding box of entity v
foreach (var cv in bb3d.Corners)
{
// get the 3d corner mapped to 2d screen
GTA.Math.Vector2 cv2 = GTAFuncs.WorldToScreen(cv.Value);
....
}
// draw the lines to show the 3d bounding box mapped to screen.
....
It seems that does not work. And the method Rectangle3D.DrawWireFrame() does not work too on my laptop.
I have done some modifications on you code to make it work with latest ScriptHookVDotNet,
UI.WIDTH --> UI.Screen.Width
UI.Height --> UI.Screen.Height etc.
Why I need the pixel coordinates of vehicles and pedestrians on screen? Is that
I am using GTA5 for training an AI that can detect and recognize the vehicle and pedestrians on the screen.
Can you help me with this problem, that could means a lot to my research.
@Dokota628 Thanks for the work. I've got the console running, but still got some problem when I tried to get the location of vehicles and pedestrian on the screen. the coordinates are not correct. I am using the following code:
Rectangle3D bb3d = new Rectangle3D(location, size).Rotate(GTAFuncs.GetEntityQuaternion(v)); // to get the 3d bounding box of entity v
foreach (var cv in bb3d.Corners)
{
// get the 3d corner mapped to 2d screen
GTA.Math.Vector2 cv2 = GTAFuncs.WorldToScreen(cv.Value);
....
}
// draw the lines to show the 3d bounding box mapped to screen.
....
It seems that does not work. And the method Rectangle3D.DrawWireFrame() does not work too on my laptop.
I have done some modifications on you code to make it work with latest ScriptHookVDotNet,
UI.WIDTH --> UI.Screen.Width
UI.Height --> UI.Screen.Height etc.
Why I need the pixel coordinates of vehicles and pedestrians on screen? Is that
I am using GTA5 for training an AI that can detect and recognize the vehicle and pedestrians on the screen.
Can you help me with this problem, that could means a lot to my research.