Ignore:
Timestamp:
Dec 19, 2018, 10:16:08 AM (5 years ago)
Author:
sommeria
Message:

projection repaired

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/set_object.m

    r1059 r1060  
    165165%     if isfield(data,'Angle') && isequal(numel(data.Angle),3)
    166166         set(handles.num_Angle_1,'String',num2str(data.Angle(1)))
    167          set(handles.num_Angle_2,'String',num2str(data.Angle(2)))
     167%          set(handles.num_Angle_2,'String',num2str(data.Angle(2)))
    168168%         set(handles.num_Angle_3,'String',num2str(data.Angle(3)))
    169169%     end
     
    332332        set(handles.num_RangeY_2,'TooltipString',['num_RangeY_2: half width of the ' ObjectStyle])
    333333    case {'plane','plane_z'} 
    334         set(handles.num_Angle_3,'Visible','on')
     334        set(handles.num_Angle_1,'Visible','on')
    335335        set(handles.num_RangeX_1,'Visible','on')
    336336        set(handles.num_RangeX_2,'Visible','on')
     
    418418PlaneAngle(2)=str2num(get(handles.num_Angle_2,'String'));%second  angle in degrees
    419419%PlaneAngle(3)=str2num(get(handles.num_Angle_3,'String'));%second  angle in degrees
    420 om=norm(PlaneAngle);%norm of rotation angle in radians
    421 OmAxis=PlaneAngle/om; %unit vector marking the rotation axis
    422 cos_om=cos(pi*om/180);
    423 sin_om=sin(pi*om/180);
    424 coeff=OmAxis(3)*(1-cos_om);
     420% om=norm(PlaneAngle);%norm of rotation angle in radians
     421% OmAxis=PlaneAngle/om; %unit vector marking the rotation axis
     422cos_om1=cos(pi*PlaneAngle(1)/180);
     423sin_om1=sin(pi*PlaneAngle(1)/180);
     424cos_om2=cos(pi*PlaneAngle(2)/180);
     425sin_om2=sin(pi*PlaneAngle(2)/180);
    425426%components of the unity vector norm_plane normal to the projection plane
    426 norm_plane(1)=OmAxis(1)*coeff+OmAxis(2)*sin_om;
    427 norm_plane(2)=OmAxis(2)*coeff-OmAxis(1)*sin_om;
    428 norm_plane(3)=OmAxis(3)*coeff+cos_om;
     427% norm_plane(1)=OmAxis(1)*coeff+OmAxis(2)*sin_om;
     428% norm_plane(2)=OmAxis(2)*coeff-OmAxis(1)*sin_om;
     429% norm_plane(3)=OmAxis(3)*coeff+cos_om;
    429430huvmat=findobj('Tag','uvmat');%find the current uvmat interface handle
    430431UvData=get(huvmat,'UserData');%Data associated to the current uvmat interface
    431432if isfield(UvData,'X') && isfield(UvData,'Y') && isfield(UvData,'Z')
    432     Z=norm_plane(1)*(UvData.X)+norm_plane(2)*(UvData.Y)+norm_plane(3)*(UvData.Z);
     433    Z=sin_om2*(cos_om1*(UvData.X)+sin_om1*(UvData.Y))+cos_om2*(UvData.Z);
    433434    set(handles.z_slider,'Min',min(Z))
    434435    set(handles.z_slider,'Max',max(Z))
Note: See TracChangeset for help on using the changeset viewer.