관리자   |   포스트   |    로그아웃

아이튜브(itubes.co.kr)'s 반짝정보

아이튜브
아이튜브는 여성, 아동, 교육, 휴대폰 관련해 품질이 좋거나 가격이 저렴한 상품을 소개합니다. 아이튜브스 블로그에서 추천하는 제품들은 시간이 지나면 할인혜택이 종료되고 품절되는 경우가 많습니다. 발빠르게 혜택을 얻으시기 바랍니다.
ITUBE 아동, 육아정보

http://itubes.co.kr/rss
Importing the library( Box2D )
Category : Box2D/Basic Date : 2010/06/08 08:22

http://www.4feets.com/2009/03/2d-physics-on-android-using-box2d/


In Eclipse
  1. Create a folder /lib/
  2. Right Click on /lib, select Import
  3. Select General / File System
  4. Choose the directory of jbox2d.jar
  5. Import the file jbox2d.jar
  6. Right click on the project and select “Properties”
  7. Click on “Java Build Path” and select the “Libraries” tab
  8. Click on “Add JARs…” and pick the file jbox2d.jar



 

It is important to keep two things in mind:

  • Axis orientations: the coordinate (0, 0) with the G1 is typically the upper left corner of the screen, while (0, 0) in Box2D is the bottom left corner of the screen.
  • The other thing are dimensions: Box2D works fine with dimensions from 0.1 to 10 times the typical earth dimensions such as density, friction, gravity, …. Internally the engine is using meters and we will need to convert them to pixels. If we say, 1 meter shall be 10 pixels, that function could look like this:
public Vec2 toScreen(Vec2 pos) {
    pos.x = pos.x*10;
    pos.y = 480 - (pos.y*10);
    return pos;
}






엮인글 쓰기 0 | 덧글 쓰기 0 | 목록 열기 상위로
http://itubes.co.kr/trackback/741
Today 174 : Yesterday 306 : Total 416919 / Subscribe to RSS / Guest Book COPYRIGHT(C) 2008.01.07 아이튜브스(itubes.co.kr) ALL RIGHT RESERVED.
최근 올라온 글
전체 (507)
생활 (58)
이벤트 (317)
휴대폰 (49)
IT 제품 (12)
이슈 (3)
주식투자 (7)
소프트웨어 (15)
트윗 (25)
안드로이드 (8)
Open GL (12)
study (0)
program (0)
Box2D (1)
Http (0)
Notification (0)
JavaModeling (0)
Inten (0)
Bada (0)
ITUBE ENTERTAINMENT

블로그 최근 덧글
관리자만 볼 수 있는 댓글...
 2011 – 비밀방문자
dsdfsf
 2011 – Test
19