5
5
< head >
6
6
< meta charset ="UTF-8 ">
7
7
< link rel ="stylesheet " href ="styles.css ">
8
- < title > Drag</ title >
8
+ < title > Drag hugo3m </ title >
9
9
< script defer src ="js/bundleName.js "> </ script > </ head >
10
10
11
- < body >
11
+ < body style ="display:flex; flex:1; ">
12
+ < div style ="display: flex; flex: 1; flex-direction: column; min-width: 40%; max-width: 40%; overflow-y: auto; ">
13
+ < h1 > Drag from < a href ="https://github.com/hugo3m/drag " target ="_blank "> hugo3m</ a > </ h1 >
14
+ < h2 > Description:</ h2 >
15
+ < p > Drag is an open source project showing the mathematics behind dragging an object in a 3D environment. When
16
+ holding your cursor on an axis, the following happens:
17
+ < ul >
18
+ < li > A vector < b > Vinit</ b > is created with the direction from the camera to the intersection from the raycast
19
+ from the
20
+ camera to the cursor.</ li >
21
+ < li > From this vector, a plane is created using, as a normal, one of the two vectors normal to the one being
22
+ dragged. < i > If you choose to drag the vector < b > right</ b > , the vector used as a normal for the plane
23
+ will either be < b > top</ b > or < b > front</ b > .</ i > The vector which has the lowest angle with
24
+ < b > Vinit</ b > is chosen. < i > It ensures that the plane will morelikely face the camera.</ i >
25
+ </ li >
26
+ < li > The scene displays a plane with the color of the normal vector. The plane is used as a surface to
27
+ interesect with the raycast from the camera to your cursor when moving your cursor around. The result of
28
+ the intersection is a yellow sphere, following your cursor within the plane.
29
+ </ li >
30
+ < li > The final step is to project the intersection on the dragged axis and change the position according to
31
+ the distance from the initial dragged. The result of the projection is a sphere of the color of the
32
+ dragged axis.
33
+ </ li >
34
+ </ ul >
35
+ </ p >
36
+ < h2 > Todo:</ h2 >
37
+ < p >
38
+ < ul >
39
+ < li > Rotation of the cube.</ li >
40
+ < li > Dragging along a plane.</ li >
41
+ < li > Dragging from the root.</ li >
42
+ </ ul >
43
+ </ p >
44
+ </ div >
45
+
12
46
</ body >
13
47
48
+ < style >
49
+
50
+ </ style >
51
+
14
52
15
53
</ html >
0 commit comments