Microsoft PowerPoint - GameProgramming7-Model [호환 모드]

Similar documents
Microsoft PowerPoint - GameProgramming7-Model.ppt [호환 모드]

3D 화면을그리기위해필요한기본기 XNA 에서 2D 화면을그릴때는 SpriteBatch 하나면끝났지만, 3D를그리기위해서는행렬과 Model, BasicEffect 등여러가지를알아야한다. 이제부터하나씩확인해보자. 먼저 XNA 에서 3D Model 을화면에나타내려면아래의 4

01-OOPConcepts(2).PDF

Something that can be seen, touched or otherwise sensed

6자료집최종(6.8))

Chapter 1

04_오픈지엘API.key

No Slide Title

Orcad Capture 9.x

Macaron Cooker Manual 1.0.key

01장

MVVM 패턴의 이해

H3050(aap)

DocsPin_Korean.pages

Page 2 of 5 아니다 means to not be, and is therefore the opposite of 이다. While English simply turns words like to be or to exist negative by adding not,

K7VT2_QIG_v3

Microsoft PowerPoint - ch03ysk2012.ppt [호환 모드]

¹Ìµå¹Ì3Â÷Àμâ

본문01

MAX+plus II Getting Started - 무작정따라하기

Dialog Box 실행파일을 Web에 포함시키는 방법

WebPACK 및 ModelSim 사용법.hwp

DE1-SoC Board

Page 2 of 6 Here are the rules for conjugating Whether (or not) and If when using a Descriptive Verb. The only difference here from Action Verbs is wh

Motor

2 min 응용 말하기 01 I set my alarm for It goes off. 03 It doesn t go off. 04 I sleep in. 05 I make my bed. 06 I brush my teeth. 07 I take a shower.

C# Programming Guide - Types

DBPIA-NURIMEDIA

감각형 증강현실을 이용한

APOGEE Insight_KR_Base_3P11

Analytics > Log & Crash Search > Unity ios SDK [Deprecated] Log & Crash Unity ios SDK. TOAST SDK. Log & Crash Unity SDK Log & Crash Search. Log & Cras

11¹Ú´ö±Ô

<B1E2C8B9BEC828BFCFBCBAC1F7C0FC29322E687770>

0125_ 워크샵 발표자료_완성.key

슬라이드 1

untitled

¾Æ½Ã¾ÆÀú³Î8È£-ÅëÇÕ

퇴좈저널36호-4차-T.ps, page Preflight (2)

PowerPoint 프레젠테이션

DIY 챗봇 - LangCon

<32382DC3BBB0A2C0E5BED6C0DA2E687770>

45-51 ¹Ú¼ø¸¸


untitled

2015 경제ㆍ재정수첩

Microsoft PowerPoint SDK설치.HelloAndroid(1.5h).pptx

IKC43_06.hwp

(Microsoft PowerPoint - \301\24613\260\255 - oFusion \276\300 \261\270\274\272)

농심-내지

Convenience Timetable Design

게임 기획서 표준양식 연구보고서

Studuino소프트웨어 설치

Å©·¹Àγ»Áö20p

DBPIA-NURIMEDIA

하나님의 선한 손의 도우심 이세상에서 가장 큰 축복은 하나님이 나와 함께 하시는 것입니다. 그 이 유는 하나님이 모든 축복의 근원이시기 때문입니다. 에스라서에 보면 하나님의 선한 손의 도우심이 함께 했던 사람의 이야기 가 나와 있는데 에스라 7장은 거듭해서 그 비결을

슬라이드 1

1 Nov-03 CST MICROWAVE STUDIO Microstrip Parameter sweeping Tutorial Computer Simulation Technology

Spring Boot/JDBC JdbcTemplate/CRUD 예제

rmi_박준용_final.PDF

May 2014 BROWN Education Webzine vol.3 감사합니다. 그리고 고맙습니다. 목차 From Editor 당신에게 소중한 사람은 누구인가요? Guidance 우리 아이 좋은 점 칭찬하기 고맙다고 말해주세요 Homeschool [TIP] Famil

歯Lecture2.PDF

public key private key Encryption Algorithm Decryption Algorithm 1

민속지_이건욱T 최종

ISP and CodeVisionAVR C Compiler.hwp

Microsoft PowerPoint Android-SDK설치.HelloAndroid(1.0h).pptx

<32B1B3BDC32E687770>

Connection 8 22 UniSQLConnection / / 9 3 UniSQL OID SET

JMF3_심빈구.PDF

3D MAX + WEEK 9 Hansung Univ. Interior Design

1. 서론 1-1 연구 배경과 목적 1-2 연구 방법과 범위 2. 클라우드 게임 서비스 2-1 클라우드 게임 서비스의 정의 2-2 클라우드 게임 서비스의 특징 2-3 클라우드 게임 서비스의 시장 현황 2-4 클라우드 게임 서비스 사례 연구 2-5 클라우드 게임 서비스에

Data Sync Manager(DSM) Example Guide Data Sync Manager (DSM) Example Guide DSM Copyright 2003 Ari System, Inc. All Rights reserved. Data Sync Manager

untitled

PowerPoint 프레젠테이션

PRO1_04E [읽기 전용]

초판 1쇄 발행 2013년 10월 25일 지은이 박승제 펴낸이 장성두 펴낸곳 제이펍 출판신고 2009년 11월 10일 제 호 주소 경기도 파주시 문발동 파주출판도시 뮤즈빌딩 403호 전화 / 팩스

JMF2_심빈구.PDF

사용시 기본적인 주의사항 경고 : 전기 기구를 사용할 때는 다음의 기본적인 주의 사항을 반드시 유의하여야 합니다..제품을 사용하기 전에 반드시 사용법을 정독하십시오. 2.물과 가까운 곳, 욕실이나 부엌 그리고 수영장 같은 곳에서 제품을 사용하지 마십시오. 3.이 제품은

언리얼엔진4_내지_ indd

63-69±è´ë¿µ

#KM-250(PB)

06_±è¼öö_0323

Assign an IP Address and Access the Video Stream - Installation Guide

Mentor_PCB설계입문

<B3EDB9AEC1FD5F3235C1FD2E687770>

歯M PDF

13주-14주proc.PDF

Microsoft PowerPoint - Java7.pptx

SMV Vending Machine Implementation and Verification 김성민 정혁준 손영석

장양수

USER GUIDE

- 2 -

Microsoft Word - Modelsim_QuartusII타이밍시뮬레이션.doc


Why 3D Max?

Endpoint Protector - Active Directory Deployment Guide

<30362E20C6EDC1FD2DB0EDBFB5B4EBB4D420BCF6C1A42E687770>

<BFA9BAD02DB0A1BBF3B1A4B0ED28C0CCBCF6B9FC2920B3BBC1F62E706466>

C. KHU-EE xmega Board 에서는 Button 을 2 개만사용하기때문에 GPIO_PUSH_BUTTON_2 과 GPIO_PUSH_BUTTON_3 define 을 Comment 처리 한다. D. AT45DBX 도사용하지않기때문에 Comment 처리한다. E.

01_피부과Part-01

작동 원리

Transcription:

Overview Model Model class represents a 3D model composed of multiple ModelMesh objects which may be moved independently. ModelMesh class represents a mesh that is part of a Model. 305890 Spring 2012 4/16/2012 Kyoung Shin Park ModelMeshPart class represents a batch of geometry information to submit to the graphics device during rendering. Each ModelMeshPart is a subdivision of a ModelMesh object. To learn how to load the data of an.x file into a Model object and render a 3D model. Model Class Bones property Gets a collection of ModelBone objects which describe how each mesh in the Meshes collection for this model relates to its parent mesh. Meshes property Gets a collection of ModelMesh objects which compose the model. Each ModelMesh in a model may be moved independently and may be composed of multiple materials identified as ModelMeshPart objects. Model Class CopyAbsoluteBoneTransformsTo method Copies a transform of each bone in a model relative to all parent bones of the bone into a given array. When using more complicated models, which often use hierarchical structure (where mesh positions, scales, and rotations are controlled by bones ), this method ensures that any mesh is first transformed by the bone that controls it, if such a bone exists. The mesh is then transformed relative to the bone transformation.

SimpleModel Draw a Model Load a model using the XNA Framework Content Pipeline You need some art assets (i.e., a 3D model and an associated texture files), and extract its contents to the project Content directory. Add a model p1_wedge.fbx in the Content To load the model by using the Content Pipeline Model model = Content.Load<Model>( Models\\p1_wedge"); This function can load any of the following model formats: FBX and X. Draw a Model Render a model using the XNA Framework Content Pipeline Create a new private method called DrawModel(Model m) pi private void oidda DrawModel(Model Model(Modelm) { Matrix[] transforms = new Matrix[m.Bones.Count]; m.copyabsolutebonetransformsto(transforms); // Draw the model. A model can have multiple meshes, so loop. foreach (ModelMesh mesh in m.meshes) { foreach (BasicEffect effect in mesh.effects) { effect.enabledefaultlighting(); // world, view, projection matrix 중간생략 // Draw the mesh, using the effects set above. mesh.draw(); Draw a Model with a Custom Effect Load and render a model using a custom effect without modifying the Content Pipeline. Add a model Terrain.fbx in the Content Load the model, typically using the Content t Pipeline Model terrain = Content.Load<Model>( Terrain"); Matrix terrainworld = Matrix.Identity; Texture2D terraintex = Content.Load<Texture2D>( TerrainTex ); Load the effect, typically using the ContentManager Effect effect = Content.Load<Effect>( CustomEffect"); t t>( C t t")

Draw a Model with a Custom Effect Iterate through each ModelMeshPart in the model, and assign the effect to the Effect property of the ModelMeshPart public static void RemapModel(Model model, Effect effect) { foreach (ModelMesh mesh in model.meshes) { foreach (ModelMeshPart part in mesh.meshparts) { part.effect = effect; Draw a model foreach (ModelMesh mesh in terrain.meshes) { foreach (Effect effect in mesh.effects) { mesh.draw(); Make a Model Move Using Input Connect Xbox360 controller or Use keyboard Create variables to turn and move the model Take input from the user to control the model Make a Model Move Using Input HandleInput private void CheckKeyboardInput(GameTime gametime) { // 중간생략 if (currentkeyboardstate.iskeydown(keys.left)) n(ke s modelrotation += elapsedtime * 3.0f; else if (currentkeyboardstate.iskeydown(keys.right)) modelrotation -= elapsedtime * 3.0f; else if (currentkeyboardstate.iskeydown(keys.up)) { modelvelocity = Vector3.Forward * 3.0f; modelposition += modelvelocity; else if (currentkeyboardstate.iskeydown(keys.down)) { modelvelocity = Vector3.Backward * 3.0f; modelposition += modelvelocity; Draw Models Load and render various models models[0] = Content.Load<Model>( airplane2"); models[1] = Content.Load<Model>( starfish"); models[2] = Content.Load<Model>( cactus");

Skinned Model with Skeletal Animation XNA Skinned Model with Skeletal Animation Character animation is widely used in video games. Skinned mesh with skeleton animation is usually used for character animation. This example shows how to create a skinned mesh content processor to import a skinned model through the content pipeline, establish skeletal hierarchy, store and use animation information, blend animation s transformations, and play animations. A skinned model has a skeleton. This skeleton has a number of bones starting from a root. http://create.msdn.com/en-us/education/catalog/sample/skinned_model SkinningSample SkinnedModel Sample http://create.msdn.com/en-us/education/catalog/sample/skinned_model SkinningSample SkinnedModel AnimationClip, AnimationPlayer, Keyframe, SkinningData

http://create.msdn.com/en-us/education/catalog/sample/skinned_model SkinningSample http://create.msdn.com/en-us/education/catalog/sample/skinned_model SkinningSample SkinnedModelPipeline SkinnedModelProcessor http://create.msdn.com/en-us/education/catalog/sample/skinned_model SkinningSample SkinningSample Load dude.fbx Skinned Model with Skeletal Animation Compile SkinningSample_4_0 to get SkinnedModel.dll & SkinnedModelPipeline.dll at SkinningSample_4_0\SkinnedModel\bin\x86\Debug g SkinningSample_4_0\SkinnedModelPipeline\bin\x86\Debug Copy them into content s SkinnedModel directory

Skinned Model with Skeletal Animation Add SkinnedModel.dll into the project as a reference Skinned Model with Skeletal Animation Add SkinnedModelPipeline.dll into the content project as a reference Skinned Model with Skeletal Animation Your solution explorer should be like this, showing SkinnedModel.dll & SkinnedModelPipeline Skinned Model with Skeletal Animation Specify SkinnedModelProcessor for dude.fbx Content Processor

Skinned Model with Skeletal Animation Skinned Model with Skeletal Animation Set a break point and check the Tag attribute of model Skinned Model with Skeletal Animation SkinnedModel(dude.fbx) & Model(p1_wedge.fbx) Creating a Skinned Creating a Skinned Model in 3DS MAX

Create a Skinned Model 3DS Max 에 3D model 을불러온다 Create a Skinned Model All 을 Bone 으로선택한다. - 모델링에서 Bone 만선택이가능하다. F3 을눌러 Wireframe 로바꿔주면, 모델링안의 Biped 가보인다. Create a Skinned Model Create a Skinned Model Time configuration 을누른다 가운데있는다이아몬드형태의도형을더블클릭하여 Biped 전체를선택한다. Animation에서 End Time에원하는프레임 ( 시간 ) 만큼입력해준다. (30fps = 1 초 ) 화면아래쪽의타임라인이 90fps로변경된걸확인할수있다.

Create a Skinned Model 전체가선택된상태에서 Auto Key 를눌러활성화시킨후 Time Slider 를 0fps로이동시킨다. Create a Skinned Model 설정이완료되면 0 번과 90 번프레임에표시가되는것을확인할수있다. 앞에서전체선택한 Biped에대한표시이다. (Time Slider) 가장위에있는 Biped 를더블클릭할경우아래 Biped 까지선택이된다. Time Slider 를우클릭하면, 왼쪽과같은화면이나오는데 Destination Time 에첫프레임인 0 과마지막프레임인 90 을입력해준다. - 각각해줘야한다. - 처음과마지막을같은동작으로해줘야자연스럽게움직이는화면처럼보인다. Create a Skinned Model Create a Skinned Model 단축키 Q - 선택 단축키 W - 이동 Timeline 에서움직임이들어갈프레임으로위치를옮긴후 Biped를선택, 움직임을주면자동으로프레임에표시가된다. 단축키 E - 회전 단축키 R - 크기조절 움직임을확인하는방법은버튼을누르면재생이된다. < 단축키 > / : 재생, 정지 < : 이전프레임 > : 다음프레임

Tip 모델링에 Texture 가적용되지않았을경우 M 을눌러 Material Editor 창을연다. Tip 중간에 Diffuse 옆 M 이라고써있는버튼을클릭한다. 모델링에 Texture 가적용된모습. Bitmap 옆에 Texture 의경로가있는데버튼을누른후적용하고자하는 Texture 를찾아선택해준다. Tip Tip 각진모델링을부드럽게해주기위해서는 smooth 를해줘야하는데오른쪽 Toolbar 에서두번째메뉴를선택, 아래 Polygon 을선택한다. Polygon 전체가선택된상태에서숫자를누르면 smooth 가적용이된다.

Tip Key Info 에서 Set Planted Key 를누르면설정한지점아래로내려가지않는다. Export the Model into.x File 모델링에움직임을넣어주는작업이끝났으면파일을 export 해야한다. File -> export 를선택한다. 파일창이열리면파일형식을 Panda DirectX (*.X) 로선택한후원하는위치에저장을한다. ( 한글이들어간폴더는되도록피한다.) 발모두에 Set Planted Key를적용한상태. 몸전체를내려도지면아래로발이내려가지않고다리를굽힌모습처럼된다. 적용을하지않은경우몸을내리면지면아래로내려간다. Export the Model into.x File 저장을누르면옵션창이나오는데왼쪽과같이 Bones에체크를해야한다. 하지않을경우애니메이션이없는모델링만추출이된다. Export the Model into.x File Textures &.fx files 탭에서는 Texture의파일형식변경이가능하다. Animation 탭에서는이름을기억하고있어야한다. XNA SkinningSample에서불러올때사용한이름을써야하기때문이다. Start, End는시작프레임과끝나는프레임을정해준다. 설정이끝난후확인을누르면저장된위치에.X 파일과 Texture 파일이저장된다. Edit 에서수정이가능하다.

Export the Model into.x File http://create.msdn.com/en-us/education/catalog/sample/skinned_model Using XNA SkinningSample Export 한.x 파일은 DirectX Viewer 로확인이가능하다. 모델링에 Texture가적용되지않을경우 Texture의이름이바뀌었거나위치가잘못되었기때문에위치설정을다시해줘야한다. 앞에서 export 한.x 파일을 Content 에서불러온다. polar_bear.x 파일을선택한후속성에서 Content Processor을 SkinnedModelProcessor을선택한다. Using XNA SkinningSample SkinningSample.cs 에서수정할부분 protected override void LoadContent() { // Load the model. currentmodel = Content.Load<Model>("polar_bear\\polar_bear"); d l l b // Load Content에서북극곰모델링의위치를지정해준다. Using XNA SkinningSample 실행을하면움직이는북극곰을확인할수있다. if (skinningdata == null) throw new InvalidOperationException ("This model does not contain a SkinningData tag."); // Create an animation i player, and start decoding di an animation i clip. animationplayer = new AnimationPlayer(skinningData); AnimationClip clip = skinningdata.animationclips["anim-1"]; 1]; // 앞에서.x파일을 export할때사용한이름으로수정한다. (Take 001->Anim-1) animationplayer.startclip(clip);

Kinect XNA Skinned Model Skinned Model + Kinect