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

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

    81     81   
    82     82   
    83     83   var selected_points = [];
    84     84   var selected_lines = [];
    85     85   
    86     86   var helpmsg = //"3D drawing tool\n\n" +
    87     87                 "Select     Left Click\n" +
    88         -		      "Rotate     Right Click\n" +
    89         -		      "Move       wasd, qe\n" +
    90         -		      "Copy       Space\n" +
    91         -		      "Delete     x\n" +
    92         -		      "\n" +
    93         -		      "Click the red dot to create a point\n" +
    94         -			  "Spam a motion key to increase speed\n" +
    95         -			  "Drag between points to connect them\n";
           88  +              "Rotate     Right Click\n" +
           89  +              "Move       wasd, qe\n" +
           90  +              "Copy       Space\n" +
           91  +              "Delete     x\n" +
           92  +              "\n" +
           93  +              "Click the red dot to create a point\n" +
           94  +              "Spam a motion key to increase speed\n" +
           95  +              "Drag between points to connect them\n";
    96     96   	          
    97     97   			  
    98     98   var msg = helpmsg;
    99     99   
   100    100   
   101    101   var view_transform =
   102         -    [[1, 0, 0],
   103         -     [0, 1, 0],
   104         -     [0, 0, 1]];
          102  +            [[1, 0, 0],
          103  +             [0, 1, 0],
          104  +             [0, 0, 1]];
   105    105   
   106    106   
   107    107   var key_state = {};
   108    108   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.
   109    109   
   110    110   
   111    111   
................................................................................
   928    928   		if(selected_points.length && !getKeyState(1002)){  // move selection if exists
   929    929   			for(var i = 0; i < selected_points.length; ++i){
   930    930   				var pt = points[selected_points[i]];
   931    931   				vector_add(pt, delta_position, pt); }}
   932    932   		
   933    933   		else{
   934    934   			moveCamera(delta_position, false); }
   935         -      
   936         -        if(delta_horizontal_angle) rotateHorizontal(delta_horizontal_angle);
   937         -        if(delta_vertical_angle) rotateVertical(delta_vertical_angle);
          935  +			
          936  +			
          937  +		if(!selected_points.length){
          938  +			if(delta_horizontal_angle) rotateHorizontal(delta_horizontal_angle);
          939  +			if(delta_vertical_angle) rotateVertical(delta_vertical_angle); }
          940  +			
          941  +		else{
          942  +            var rotation_transform;
          943  +            if(selection_rotation_axis){  // 
          944  +                
          945  +            }}}
   938    946           
   939    947          
   940    948           //  overwrite point projections
   941    949           //  TODO this may not be perfect if points are deleted etc.        
   942    950           point_projections.length = 0;
   943    951           for(var i = 0; i < points.length; ++i){
   944    952               point_projections[i] = project(canvas, points[i], view_transform, origin); }