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



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

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

01-OOPConcepts(2).PDF

본문01

6자료집최종(6.8))

04_오픈지엘API.key

<C1DFB0B3BBE7B9FD3128B9FDB7C92C20B0B3C1A4B9DDBFB5292E687770>

보광31호(4)

Something that can be seen, touched or otherwise sensed

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,

Macaron Cooker Manual 1.0.key

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

No Slide Title

Orcad Capture 9.x


??

감각형 증강현실을 이용한

APOGEE Insight_KR_Base_3P11

DBPIA-NURIMEDIA

Motor

<32B1B3BDC32E687770>

K7VT2_QIG_v3

<B1E2C8B9BEC828BFCFBCBAC1F7C0FC29322E687770>

Chapter 1

농심-내지

DocsPin_Korean.pages


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

PowerPoint 프레젠테이션

DE1-SoC Board

<303220C7D1C5C2B9AE2E687770>

MVVM 패턴의 이해

PDF

DIY 챗봇 - LangCon

2011 <C560><B274><C5BC><B9AC><D3EC><D2B8> <CD5C><C885>.pdf

H3050(aap)

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

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

untitled

45-51 ¹Ú¼ø¸¸

IKC43_06.hwp

11¹Ú´ö±Ô

<B5B6BCADC7C1B7CEB1D7B7A52DC0DBBEF7C1DF E687770>

- 2 -

1) 음운 체계상의 특징 음운이란 언어를 구조적으로 분석할 때, 가장 작은 언어 단위이다. 즉 의미분화 를 가져오는 최소의 단위인데, 일반적으로 자음, 모음, 반모음 등의 분절음과 음장 (소리의 길이), 성조(소리의 높낮이) 등의 비분절음들이 있다. 금산방언에서는 중앙

<30362E20C6EDC1FD2DB0EDBFB5B4EBB4D420BCF6C1A42E687770>

歯M PDF

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.

<B3EDB9AEC1FD5F3235C1FD2E687770>

DBPIA-NURIMEDIA

<BCF6BDC D31385FB0EDBCD3B5B5B7CEC8DEB0D4C5B8BFEEB5B5C0D4B1B8BBF3BFACB1B85FB1C7BFB5C0CE2E687770>

우리나라의 전통문화에는 무엇이 있는지 알아봅시다. 우리나라의 전통문화를 체험합시다. 우리나라의 전통문화를 소중히 여기는 마음을 가집시다. 5. 우리 옷 한복의 특징 자료 3 참고 남자와 여자가 입는 한복의 종류 가 달랐다는 것을 알려 준다. 85쪽 문제 8, 9 자료

상품 전단지

::: 해당사항이 없을 경우 무 표시하시기 바랍니다. 검토항목 검 토 여 부 ( 표시) 시 민 : 유 ( ) 무 시 민 참 여 고 려 사 항 이 해 당 사 자 : 유 ( ) 무 전 문 가 : 유 ( ) 무 옴 브 즈 만 : 유 ( ) 무 법 령 규 정 : 교통 환경 재

2

DBPIA-NURIMEDIA

화이련(華以戀) hwp

ÆòÈ�´©¸® 94È£ ³»Áö_ÃÖÁ¾

歯1##01.PDF

<5BC1F8C7E0C1DF2D31B1C75D2DBCF6C1A4BABB2E687770>

120229(00)(1~3).indd

01Report_210-4.hwp

<C3D1BCB15FC0CCC8C45FBFECB8AE5FB1B3C0B0C0C75FB9E6C7E D352D32315FC5E4292E687770>



교육 과 학기 술부 고 시 제 호 초 중등교육법 제23조 제2항에 의거하여 초 중등학교 교육과정을 다음과 같이 고시합니다. 2011년 8월 9일 교육과학기술부장관 1. 초 중등학교 교육과정 총론은 별책 1 과 같습니다. 2. 초등학교 교육과정은 별책

시험지 출제 양식

177

제주어 교육자료(중등)-작업.hwp

¸é¸ñ¼Ò½ÄÁö 63È£_³»Áö ÃÖÁ¾

<C3D6C1BE5FBBF5B1B9BEEEBBFDC8B0B0DCBFEFC8A C3D6C1BEBABB292E687770>

초등국어에서 관용표현 지도 방안 연구

6±Ç¸ñÂ÷

과 위 가 오는 경우에는 앞말 받침을 대표음으로 바꾼 [다가페]와 [흐귀 에]가 올바른 발음이 [안자서], [할튼], [업쓰므로], [절믐] 풀이 자음으로 끝나는 말인 앉- 과 핥-, 없-, 젊- 에 각각 모음으로 시작하는 형식형태소인 -아서, -은, -으므로, -음

민주장정-노동운동(분권).indd

untitled

<C0CEBCE2BABB2D33C2F7BCF6C1A420B1B9BFAAC3D1BCAD203130B1C72E687770>


E1-정답및풀이(1~24)ok

<C1B6BCB1B4EBBCBCBDC3B1E2342DC3D6C1BE2E687770>

< BDC3BAB8C1A4B1D4C6C75BC8A3BFDC D2E687770>

교사용지도서_쓰기.hwp

최우석.hwp

cls46-06(심우영).hwp

時 習 說 ) 5), 원호설( 元 昊 說 ) 6) 등이 있다. 7) 이 가운데 임제설에 동의하는바, 상세한 논의는 황패강의 논의로 미루나 그의 논의에 논거로서 빠져 있는 부분을 보강하여 임제설에 대한 변증( 辨 證 )을 덧붙이고자 한다. 우선, 다음의 인용문을 보도록

0429bodo.hwp

伐)이라고 하였는데, 라자(羅字)는 나자(那字)로 쓰기도 하고 야자(耶字)로 쓰기도 한다. 또 서벌(徐伐)이라고도 한다. 세속에서 경자(京字)를 새겨 서벌(徐伐)이라고 한다. 이 때문에 또 사라(斯羅)라고 하기도 하고, 또 사로(斯盧)라고 하기도 한다. 재위 기간은 6

<32382DC3BBB0A2C0E5BED6C0DA2E687770>

장양수

JMF3_심빈구.PDF

DBPIA-NURIMEDIA

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

public key private key Encryption Algorithm Decryption Algorithm 1

한국성인에서초기황반변성질환과 연관된위험요인연구

<B3EDB9AEC1FD5F3235C1FD2E687770>

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

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

슬라이드 1

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

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

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 2014 4/08/2014 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 p 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; Adding Animation to a Model Updates a model s position to make model animation protected override void Update(GameTime gametime) { totalelapsedtime += (fl t) Ti El dg Ti T t ls d (float)gametime.elapsedgametime.totalseconds; // determine how far along the duration value we are (0 to 1), duration=5 sec float fraction = totalelapsedtime / duration; // fraction = MathHelper.Clamp(fraction, 0, 1); while (fraction > 1) fraction -= 1; while (fraction > 1) fraction -= 1; // interpolate modelposition between startposition and endposition using fraction modelposition = Vector3.Lerp(startPosition, endposition, fraction); mymodel.world = Matrix.CreateTranslation(modelPosition); /// 중간생략... /// 중간생략... base.update(gametime);

Adding Animation to a Model endposition 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"); startposition 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 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 Add SkinnedModel.dll into the project as a reference Add SkinnedModelPipeline.dll into the content project p p j as a reference

Your solution explorer should be like this, showing SkinnedModel.dll & SkinnedModelPipeline Specify SkinnedModelProcessor for dude.fbx Content Processor Set a break point and check the Tag attribute of model

SkinnedModel(dude.fbx) & Model(p1_wedge.fbx) 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); Skinned Model + Kinect Avateering Kinect XNA Skinned Model