Hi.
Suppose we have a Boid with a circle of radius 2, how do I draw a line from the center of Boid up to the radius?
Number 2 translated in terms of carrier as it becomes?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi. Look in Annotation.h, it defines annotationLine which takes the two endpoints as Vec3 and a color. There are other kinds of annotations defined in that file. Annotations differ from basic drawing in that they are "optional" and can be turned on and off by the user. You can also use the "draw API" defined in Draw.h if that seems more appropriate for your application.
To draw the line you describe, if for example you want it along the boid's direction of travel, you would write something like this in the Boid's update (or draw) method:
annotationLine (position(), forward()*2, gGreen);
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you.
If I wanted to see a line from the center of the agent to his radius drawn around the agent, how can I do?
The radius is a float and the method requires a note Vec3.
the previous version would have drawn from each boid to near the origin of 3d space. If this is not what you need, I am having a hard time understanding exactly what you are trying to draw. You want a line "from the center of the agent to his radius drawn around the agent". I think "around" is the word I don't understand. If you want to draw a circle, see annotationXZCircle. Perhaps you mean you want the line to animate like the hands on a clock? Or draw from the center, toward some distant point but clipping at a certain radius?
Any of these can be done, but I need a better description of your goal.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello, I will try to explain.
I should draw a line from the center of my agent up to a radius for example
equal to 2 that need not represent anything, neither direction nor speed.
Hi.
Suppose we have a Boid with a circle of radius 2, how do I draw a line from the center of Boid up to the radius?
Number 2 translated in terms of carrier as it becomes?
Hi. Look in Annotation.h, it defines annotationLine which takes the two endpoints as Vec3 and a color. There are other kinds of annotations defined in that file. Annotations differ from basic drawing in that they are "optional" and can be turned on and off by the user. You can also use the "draw API" defined in Draw.h if that seems more appropriate for your application.
To draw the line you describe, if for example you want it along the boid's direction of travel, you would write something like this in the Boid's update (or draw) method:
annotationLine (position(), forward()*2, gGreen);
Thank you.
If I wanted to see a line from the center of the agent to his radius drawn around the agent, how can I do?
The radius is a float and the method requires a note Vec3.
annotationLine void (const Vec3 & startPoint,
const Vec3 & endpoint,
const Vec3 & color);
annotationLine (position (), Radius2??, color)
OK, first of all my previous code snippet was wrong, it should have been:
the previous version would have drawn from each boid to near the origin of 3d space. If this is not what you need, I am having a hard time understanding exactly what you are trying to draw. You want a line "from the center of the agent to his radius drawn around the agent". I think "around" is the word I don't understand. If you want to draw a circle, see annotationXZCircle. Perhaps you mean you want the line to animate like the hands on a clock? Or draw from the center, toward some distant point but clipping at a certain radius?
Any of these can be done, but I need a better description of your goal.
Jeez, the bold markup in this forum utility didn't work that should be:
annotationLine (position(), position() + (forward()*radius), gGreen);
Hello, I will try to explain.
I should draw a line from the center of my agent up to a radius for example
equal to 2 that need not represent anything, neither direction nor speed.
drawXZCircleOrDisk (Radius2, position (), color, 100, false);
annotationLine (position (),??? Radius2 ?????, gGreen);