Option to show what is applied in the Touch ABLine

Since we got rid of the full zoom button, and the little view in the left corner is hard to see. Wondering if we could show or not show the applied area on the Touch ABLine form. Small button near the bottom to turn applied off or on in the view. Or click the little view and it would bring up a zoom to field form. Or, just a zoom to field button that when clicked it shows the whole field on the main screen centered and north about the field center, not the tractor. Just food for thought.

I got this working fairly well last night. Just copied the code from the little window into a subroutine, edited it to get rid of the double step, set the color, the button turns on or off a bool, code looks for the right bool and draws it if called for. Also added the current field position. Of course this is the OCT 22 code. Not the new GUI. But would be the same. This may or may not be usable to anyone but it gives a full view of what has been applied in a centered view.

Screen%20shot%20of%20applied

All right, got to thinking about the Raven controller that died. It did have a zoom to field button. So with some tinkering with the camera, fairly simple to add a click to field function in the camera button. The view is centered on the field not the tractor. It also draws the circle around the vehicle when in field view. The circle size is based on the field size so it is always the same size on the screen.

Document2

3 Likes

I think that is really useful. I have wished to have such a kind of overview several times on the field!
One thought: What about a gesture-like action to activate this view? Like a double tap on the screen center…
But I would keep the button anyway.

It’s kind of funny how buttons and features come and go. Field min max was on and off a few times now lol. Always meaning to add little reticle when zoomed out for vehicle. Want to share the code?

I never left the sections thinking it was too busy - but maybe not. Could make sections in much darker color so easier to see the lines created.

Here is the code for the foggy circle around the vehicle. It goes in the vehicle.cs after everything in the DrawVehicle() routine.

Cloudy Circle.txt (1.5 KB)

The code for the field zoom goes in the OpenGLDesigener somewhere about line 66 after GL.LoadIdentity() and is as follows (You must create a bool “fieldZoom” and initialize it to false.):

<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>

if (fieldZoom)
{
CalculateMinMax();

                //back the camera up
                GL.Translate(0, 0, (-maxFieldDistance*1.25));

                //translate to that spot in the world 
                GL.Translate(-fieldCenterX, -fieldCenterY, 0);
            }
            else
            {
                camera.SetWorldCam(pivotAxlePos.easting, pivotAxlePos.northing, camHeading);
            }
1 Like

This one shows the circle with the google map style arrow. I simply did a if(!fieldZoom) way up the chain to turn off and on the vehicle.

I did find a glitch. If zoomed in too far it will just show a blue screen when you click the field zoom. Or if you click zoom + while in the field view it will show the same blue screen. Zoom - brings it back. Any thoughts?

With Google map arrow.txt (2.7 KB)

1 Like

The camera.camSetDistance is the distance the camera is away from the scene. Then your circle won’t change in size as you zoom in and out.

Try this :slight_smile:

        if (mf.camera.camSetDistance < -400)
        {
            GL.Color4(0.9f, 0.9f, 0.9f, 0.15);
            double theta = glm.twoPI / 20;
            double c = Math.Cos(theta);//precalculate the sine and cosine
            double s = Math.Sin(theta);

            double x = mf.camera.camSetDistance * -.025;//we start at angle = 0
            double y = 0;
            GL.LineWidth(1);
            GL.Begin(PrimitiveType.TriangleFan);
            GL.Vertex3(x, y, 0.0);
            for (int ii = 0; ii < 20; ii++)
            {
                //output vertex
                GL.Vertex3(x, y, 0.0);

                //apply the rotation matrix
                double t = x;
                x = (c * x) - (s * y);
                y = (s * t) + (c * y);
                // GL.Vertex3(x, y, 0.0);
            }
            GL.End();
            GL.Color3(0.99f, 0.99f, 0.99f);
            GL.LineWidth(1);
            GL.Begin(PrimitiveType.LineLoop);

            for (int ii = 0; ii < 20; ii++)
            {
                //output vertex
                GL.Vertex3(x, y, 0.0);

                //apply the rotation matrix
                double t = x;
                x = (c * x) - (s * y);
                y = (s * t) + (c * y);
                // GL.Vertex3(x, y, 0.0);
            }
            GL.End();
        }

That does work better. I set the camera to the maxfield when you click the button. Then, zoom works normal. However, if you are zoomed in up close in the world view (game view), it goes straight to a blue screen. Investigating, if camera zoom is 12 or less that is when it happens. Once in the field view, you can zoom right in, less than 12. Any thoughts?

Edit: Never mind, needed to call a setZoom() that clears it up. Here it is.

image

I can easily add the sections back in draw, cool!