Check-in [09450376b4]
Not logged in
Overview
Comment:working on rotating selected points.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 09450376b47136b80d3504b4f365a194fcceebb2
User & Date: Derek on 2012-12-30 19:55:23
Other Links: manifest | tags
Context
2012-12-30
22:51
got rotation of selected points to work check-in: e34dd1120f user: Jacob tags: trunk
19:55
working on rotating selected points. check-in: 09450376b4 user: Derek tags: trunk
2012-12-27
20:24
started working on some changes for rotating and scaling selected points. check-in: 29f4bb3e29 user: Derek tags: trunk
Changes

Modified draw.html from [a1adddf1a8] to [d374aefa95].

81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111


var selected_points = [];
var selected_lines = [];

var helpmsg = //"3D drawing tool\n\n" +
              "Select     Left Click\n" +
		      "Rotate     Right Click\n" +
		      "Move       wasd, qe\n" +
		      "Copy       Space\n" +
		      "Delete     x\n" +
		      "\n" +
		      "Click the red dot to create a point\n" +
			  "Spam a motion key to increase speed\n" +
			  "Drag between points to connect them\n";
	          
			  
var msg = helpmsg;


var view_transform =
    [[1, 0, 0],
     [0, 1, 0],
     [0, 0, 1]];


var key_state = {};
var key_state_augmentation_timeout = 150; // the permissible time in milliseconds since the last key event to still allow the key state to augment instead of clearing.










|
|
|
|
|
|
|
|






|
|
|







81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111


var selected_points = [];
var selected_lines = [];

var helpmsg = //"3D drawing tool\n\n" +
              "Select     Left Click\n" +
              "Rotate     Right Click\n" +
              "Move       wasd, qe\n" +
              "Copy       Space\n" +
              "Delete     x\n" +
              "\n" +
              "Click the red dot to create a point\n" +
              "Spam a motion key to increase speed\n" +
              "Drag between points to connect them\n";
	          
			  
var msg = helpmsg;


var view_transform =
            [[1, 0, 0],
             [0, 1, 0],
             [0, 0, 1]];


var key_state = {};
var key_state_augmentation_timeout = 150; // the permissible time in milliseconds since the last key event to still allow the key state to augment instead of clearing.



928
929
930
931
932
933
934
935


936
937






938
939
940
941
942
943
944
		if(selected_points.length && !getKeyState(1002)){  // move selection if exists
			for(var i = 0; i < selected_points.length; ++i){
				var pt = points[selected_points[i]];
				vector_add(pt, delta_position, pt); }}
		
		else{
			moveCamera(delta_position, false); }
      


        if(delta_horizontal_angle) rotateHorizontal(delta_horizontal_angle);
        if(delta_vertical_angle) rotateVertical(delta_vertical_angle);






        
       
        //  overwrite point projections
        //  TODO this may not be perfect if points are deleted etc.        
        point_projections.length = 0;
        for(var i = 0; i < points.length; ++i){
            point_projections[i] = project(canvas, points[i], view_transform, origin); }







|
>
>
|
|
>
>
>
>
>
>







928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
		if(selected_points.length && !getKeyState(1002)){  // move selection if exists
			for(var i = 0; i < selected_points.length; ++i){
				var pt = points[selected_points[i]];
				vector_add(pt, delta_position, pt); }}
		
		else{
			moveCamera(delta_position, false); }
			
			
		if(!selected_points.length){
			if(delta_horizontal_angle) rotateHorizontal(delta_horizontal_angle);
			if(delta_vertical_angle) rotateVertical(delta_vertical_angle); }
			
		else{
            var rotation_transform;
            if(selection_rotation_axis){  // 
                
            }}}
        
       
        //  overwrite point projections
        //  TODO this may not be perfect if points are deleted etc.        
        point_projections.length = 0;
        for(var i = 0; i < points.length; ++i){
            point_projections[i] = project(canvas, points[i], view_transform, origin); }