본문 바로가기

개발일지

[직소퍼즐] 직소 퍼즐 만들기 (7) - 드래그 정밀도 올리기

- canvas를 사용할거고, 거기서 drag n drop 기능을 이용해서 네모 조각을 움직이는 기능을 구현한다

- 특정한 조각의 배열이 순서를 이루면 정답으로 인정한다

- 네모 조각을 진짜 직소 퍼즐 조각처럼 만든다

 

피곤하다.... 일단 저번에 못했던 1. 드래그 정밀한 값으로 개선하려고 한다.

 

참고문서

https://discourse.threejs.org/t/dragging-3d-objects-using-mouse-in-three-js/12731

 

 

Dragging 3D objects using mouse in three.js

I need to drag a 3d object using mouse. The 3d objects has its face coloured and edges shown.The problems I am facing are: 1.I want to move the 3d objects and the edges together. Now, either the 3D object with face or the edges only moves, not both. 2. Eve

discourse.threejs.org

https://jsfiddle.net/xa9uscme/1/

 

Edit fiddle - JSFiddle - Code Playground

 

jsfiddle.net

 

 

위 문서의 도움을 많이 받았다.

거의 복붙만 했네.. 다음에는 이 코드 정리하고, 아래 2번을 할 예정이다.

 

 

 

 

다음에 할 일

 

2. 3D객체 z 축 position 생성 순서, z 값 말고 제어할 값 찾아보기

3. 코드 리팩토링