Quantcast

Jump to content

» «
Photo

Return point of ENTITY::GET_ENTITY_COORDS

3 replies to this topic
akrram
  • akrram

    Player Hater

  • Members
  • Joined: 08 Aug 2017
  • United-States

#1

Posted 4 weeks ago

Hi, Newbie here,

 

I am trying to understand this function. If I use it with vehicle entity, which point of vehicle does it return?

 

I am trying to draw a circle on the top of vehicle in the top view, (using _WORLD3D_TO_SCREEN2D and DRAW_RECT functions).

 

But i cant figure out the coordinates. 

 

Any help with this is greatly appreciated. 


LeeC2202
  • LeeC2202

    Mark Chump

  • Members
  • Joined: 24 Oct 2015
  • United-Kingdom

#2

Posted 4 weeks ago

It will return the location of the origin (usually the chassis dummy) at 0,0,0 in the model. However, given the inability of some modders to place dummies at the correct location, don't guarantee that it will be where you expect it to be. I have seen it under ground on some vehicles.

 

If you draw two lines, one directly up from that location and one to the side, you will get an idea of where it is located.

 

Use this native DRAW_LINE(float x1, float y1, float z1, float x2, float y2, float z2, int r, int g, int b, int alpha) and call it once for each line.

  • akrram likes this

Skorpro
  • Skorpro

    GTAholic

  • Members
  • Joined: 19 Jul 2009
  • Germany

#3

Posted 4 weeks ago

Vector3 vec3;
float cx, cy;
Vehicle car;

vec3 = GET_ENTITY_COORDS(car, 1);
GET_SCREEN_COORD_FROM_WORLD_COORD/*_WORLD3D_TO_SCREEN2D*/(vec3.x, vec3.y, vec3.z, &cx, &cy);

...

And read this.

  • akrram likes this

akrram
  • akrram

    Player Hater

  • Members
  • Joined: 08 Aug 2017
  • United-States

#4

Posted 4 weeks ago

Thanks to both of you.

I figured it out by placing a giant cube :lol:. I have solved this problem.

  • LeeC2202 likes this




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users