Diff
Not logged in

Differences From Artifact [a1adddf1a8]:

To Artifact [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
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";
              "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]];
            [[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
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(delta_horizontal_angle) rotateHorizontal(delta_horizontal_angle);
        if(delta_vertical_angle) rotateVertical(delta_vertical_angle);
			
			
		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); }