달력

52024  이전 다음

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
반응형

애플코딩 보고 따라 처봄

https://www.youtube.com/watch?v=CojyGfCMvuU

<!DOCTYPE html>
<html lang="en">
<head>    
    <title>Document</title>
</head>
<body>
    
    <canvas id="canvas" width="300" height="300"></canvas>
    
    <script type="importmap">
    {
      "imports": {
        "three": "https://unpkg.com/three@0.141.0/build/three.module.js",
        "GLTFLoader" : "https://unpkg.com/three@0.141.0/examples/jsm/loaders/GLTFLoader.js",
        "OrbitControls" : "https://unpkg.com/three@0.141.0/examples/jsm/controls/OrbitControls.js"
      }
    }
  </script>

  <script type="module">
    import {GLTFLoader} from 'GLTFLoader';
    import * as THREE from 'three';
    import { OrbitControls } from 'OrbitControls';

    let scene = new THREE.Scene();
    let renderer = new THREE.WebGLRenderer({
        canvas : document.querySelector('#canvas'),
        antialias : true
    });

    renderer.outputEncoding = THREE.sRGBEncoding;

    let camera = new THREE.PerspectiveCamera(30, 1);
    camera.position.set(0,0,5);

    scene.background = new THREE.Color('white');
    //let light = new THREE.DirectionalLight(0xffff00, 10);
    //scene.add(light);
    
    let loader = new GLTFLoader();
    
    let controls = new OrbitControls( camera, renderer.domElement );
    controls.rotateSpeed = 1.0; // 마우스로 카메라를 회전시킬 속도입니다. 기본값(Float)은 1입니다.        
    controls.zoomSpeed = 1.2; // 마우스 휠로 카메라를 줌 시키는 속도 입니다. 기본값(Float)은 1입니다.        
    controls.panSpeed = 0.8; // 패닝 속도 입니다. 기본값(Float)은 1입니다.        
    //controls.minDistance = 5; // 마우스 휠로 카메라 거리 조작시 최소 값. 기본값(Float)은 0 입니다.        
    //controls.maxDistance = 100; // 마우스 휠로 카메라 거리 조작시 최대 값. 기본값(Float)은 무제한 입니다.

    loader.load('shiba/scene.gltf', function(gltf){
        scene.add(gltf.scene);
        
        function animate(){
          requestAnimationFrame(animate)
          //gltf.scene.rotation.y += 0.01;

          renderer.render(scene, camera);
          controls.update();
        }

        animate();
    });
  </script>
</body>
</html>

 

결과물 스샷

 

Posted by 유령회사
|
반응형

See the Pen YzGgwyW by kcwchang00 (@it_ghost_company) on CodePen.

https://www.youtube.com/watch?v=gBA5zXPddtY&t=145s

 

원형이미지 만들기

Posted by 유령회사
|
반응형

See the Pen date add by kcwchang00 (@it_ghost_company) on CodePen.

Posted by 유령회사
|
반응형
Posted by 유령회사
|
반응형

https://www.youtube.com/watch?v=kEt5DCHeyJo&index=53&list=WL&t=21s

Posted by 유령회사
|
반응형

숫자 0, 문자형 ''(Empty), NaN, undefined, null은 false로 처리됨

Posted by 유령회사
|
반응형



index.jsp

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Document</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> 
<script>
    $(document).ready(function(){
        $("#btnAjax").click(function(){
            $.ajax({                
                url : "./ajaxData.jsp",
                dataType : "json",
                success : function(data){
                    
                    $("table").html( "<tr>"
                                   + "<th>Index</th>"
                                   + "<th>Data2</th>"
                                   + "<th>Data3</th>"
                                   + "<th>Data4</th>"
                                   + "</tr>");
                    
                    var strTableTr = "";
                    
                    $.each(data,function(index, item){
                        strTableTr += "<tr>";
                        strTableTr += "<td>"+(index+1)+"</td>";
                        strTableTr += "<td>"+item.data1+"</td>";
                        strTableTr += "<td>"+item.data2+"</td>";
                        strTableTr += "<td>"+item.data3+"</td>";
                        strTableTr += "</tr>";
                    });
                    
                    $("table").append(strTableTr);                    
                }            
            });
        });
    }); 
</script>
</head>
<body>
    <button id="btnAjax">버튼</button>
    <table>
    </table>
</body>
</html>
cs


ajaxData.jsp

1
2
3
4
5
6
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
[
{"data1":"A1","data2":"A2","data3":"A3"}, 
{"data1":"B1","data2":"B2","data3":"B3"},
{"data1":"C1","data2":"C3","data3":"B3"}
]
cs

실행화면




Posted by 유령회사
|
반응형

https://www.youtube.com/watch?v=r51wGIYjkrg

Posted by 유령회사
|
반응형

참조 : https://www.youtube.com/watch?v=v5OLSoGZBg0&t=335s

Posted by 유령회사
|
반응형

참조: https://www.youtube.com/watch?v=G0aAo0_smi8&t=367s

Posted by 유령회사
|