File tree 2 files changed +41
-16
lines changed
2 files changed +41
-16
lines changed Original file line number Diff line number Diff line change 4
4
</ head >
5
5
< link rel ="stylesheet " href ="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css " integrity ="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u " crossorigin ="anonymous ">
6
6
< body onload ="InitDemo(); ">
7
- < div class ="main ">
8
- < div class ="left_pane col-lg-2 ">
9
- < br > < br > < br > < br >
10
- < button type ="button " id ="xAxis " onclick ="setXAxis() " class ="btn btn-primary "> X-axis</ button >
11
- < br > < br > < br > < br >
12
- < button type ="button " id ="yAxis " onclick ="setYAxis() " class ="btn btn-primary "> Y-axis</ button >
13
- < br > < br > < br > < br >
14
- < button type ="button " id ="zAxis " onclick ="setZAxis() " class ="btn btn-primary "> Z-axis</ button >
7
+ < div id ="WebGL_output " class ="container ">
8
+ < div class ="row col-lg-12 h1 text-center font-weight-bold text-info ">
9
+ < b > Standard Rotations in Computer Graphics Fundamentals</ b >
15
10
</ div >
16
- < div class ="canvas_div col-lg-9 ">
17
- < canvas id ="canvasId "> </ canvas >
11
+ < div class ="row ">
12
+ < div class ="left_pane col-lg-1 ">
13
+ < br > < br > < br > < br >
14
+ < button type ="button " id ="xAxis " onclick ="setXAxis() " class ="btn btn-primary "> X-axis</ button >
15
+ < br > < br > < br > < br >
16
+ < button type ="button " id ="yAxis " onclick ="setYAxis() " class ="btn btn-primary "> Y-axis</ button >
17
+ < br > < br > < br > < br >
18
+ < button type ="button " id ="zAxis " onclick ="setZAxis() " class ="btn btn-primary "> Z-axis</ button >
19
+ </ div >
20
+ < canvas id ="canvasId " class =" col-lg-11 "> </ canvas >
18
21
</ div >
19
22
</ div >
20
23
< script src ="gl-matrix.js "> </ script >
Original file line number Diff line number Diff line change 10
10
< head >
11
11
< title > WebGL - Naive Line Algorithm.</ title >
12
12
</ head >
13
- < body >
14
- < canvas id ="canvas " width ="1200 " height ="600 ">
15
- Your browser does not support HTML5
13
+ < link rel ="stylesheet " href ="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css " integrity ="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u " crossorigin ="anonymous ">
14
+ < body onload ="showOutput() ">
15
+ < div id ="WebGL_output " class ="container ">
16
+ < div class ="row col-lg-12 h1 text-center font-weight-bold text-info ">
17
+ < b > Line rasterization with Naive Appraoch y = mx + c</ b >
18
+ </ div >
19
+ < div class ="row col-sm-12 col-md-12 col-lg-12 col-xl-12 ">
20
+ < form class ="form-inline col-lg-2 ">
21
+ < label class ="text-info "> Grid Size</ label >
22
+
23
+ < input id ="xGrid " type ="number " min ="10 " max ="1000 " value ="100 " class ="">
24
+ < br > < br >
25
+ < button type ="button " onclick ="changeGrid() " class ="btn btn-outline-success "> Change Grid</ button >
26
+ </ form >
27
+ < canvas id ="canvas " class ="col-lg-10 ">
28
+ </ div >
29
+ </ div >
16
30
</ canvas >
17
31
< br />
18
32
< script >
19
33
//////////////////////////////// YOUR CODE SHOULD START AFTER THIS LINE //////////////////////
20
- var SCREEN_SIZE = 100 ;
21
- var verticesData = [ ] ;
22
-
34
+ var SCREEN_SIZE = 100 ;
35
+ var verticesData = [ ] ;
23
36
37
+ function changeGrid ( ) {
38
+ var x = document . getElementById ( "xGrid" ) . value ;
39
+ SCREEN_SIZE = x ;
40
+ showOutput ( ) ;
41
+ }
42
+
43
+ function showOutput ( )
44
+ {
24
45
var INTERCEPT = 0 ;
25
46
var x1 = 10 , y1 = 10 ;
26
47
var x2 = 60 , y2 = 50 ;
34
55
}
35
56
36
57
draw ( verticesData ) ;
58
+ }
37
59
//////////////////////////////// YOUR CODE SHOULD END BEFORE THIS LINE //////////////////////
38
60
39
61
function XY_mapping ( ) {
You can’t perform that action at this time.
0 commit comments