Find the vector which perpendicular to screen (c++)

Hi:
I am tray to find a 3dvector which perpendicular to screen, in this sample I can get the plane parallel to screen, but the zaxis is not the vector what i want. sorry for my english.

void GetPointt::DynamicDraw( HDC hdc, CRhinoViewport& vp ,const ON_3dPoint& poi)
{
    pl_con.CreateFromFrame(vp.Target(),vp.VP().CameraX(),vp.VP().CameraY());
    ON_3dPoint poi_e(poi);
    ON_Xform xf_vector_move;
    xf_vector_move.Translation(poi-pl_con.origin);
    ON_3dVector z_vector = pl_con.zaxis;
    z_vector.Transform(xf_vector_move);
    ON_Xform poi_move;
    poi_move.Translation(z_vector*100);
    poi_e.Transform(poi_move);
    vp.DrawLine(poi,poi_e);
    CRhinoGetPoint::DynamicDraw(hdc, vp, poi);
};

I am sorry I can not upload the picture.

– Dale

Perhaps we need more information. Why do you need this direction?

– Dale

Hi @dale

  1. I need a curve perpendicular to screen.

  2. And I hace call gp.PermitElevatorMode(0), but it still constrain
    p

Well, you previously said “I can get the plane parallel to screen, but the zaxis is not the vector what i want.” So apparently a curve perpendicular to screen isn’t what you want? Without more details as to what you are trying to do, I don’t see how we can help…

This seems to work here:

var gp = new GetPoint();
gp.SetCommandPrompt("Pick a point location");
gp.PermitElevatorMode(0);
gp.Get();

– Dale