'OGRE3D' 카테고리의 다른 글
| ogre3d for iPhone (0) | 2009/12/08 |
|---|---|
| OGRE에서 빌보딩 사용하기 (0) | 2009/11/16 |
| '와우' 같은 근거리 처리법 (0) | 2009/11/16 |
| OGREMAX 플러그인에서 메쉬 통합하기 (0) | 2009/11/16 |
| 자작 FPS (0) | 2009/11/16 |
| 자작 슈팅게임 (0) | 2009/11/16 |
| ogre3d for iPhone (0) | 2009/12/08 |
|---|---|
| OGRE에서 빌보딩 사용하기 (0) | 2009/11/16 |
| '와우' 같은 근거리 처리법 (0) | 2009/11/16 |
| OGREMAX 플러그인에서 메쉬 통합하기 (0) | 2009/11/16 |
| 자작 FPS (0) | 2009/11/16 |
| 자작 슈팅게임 (0) | 2009/11/16 |
- Billboard 클래스와 BillboardSet 클래스를 이용
- 우선 BillboardSet 클래스의 인스턴스를 생성
- BillboardSet클래스의 createBillboard() 함수를 이용하여 Billboard 인스턴스 생성
- BillboardSet을 SceneNode에 갖다 붙인다.
코드로 보면
// SceneNode생성. 필요한 SceneNode를 사용하면 된다. 여기서는 그냥 참고용.
SceneNode* myNode = static_cast<SceneNode *>
(mSceneMgr->getRootSceneNode()->createChild());
BillboardSet* mySet = mSceneMgr->createBillboardSet("mySet");
// 다음과같이 BillboardSet 의 재질을 정의할 수 있다.
mySet->setMaterialName("Examples/FlyingLightMaterial");
Billboard* myBillboard = mySet->createBillboard(Vector3(100, 0, 200));
myBillboard->setColour(ColourValue::Red);
myBillboard->setDimensions(1500.0f,1500.0f);
myNode->attachObject(mySet);
| ogre3d for iPhone (0) | 2009/12/08 |
|---|---|
| OGRE에서 빌보딩 사용하기 (0) | 2009/11/16 |
| '와우' 같은 근거리 처리법 (0) | 2009/11/16 |
| OGREMAX 플러그인에서 메쉬 통합하기 (0) | 2009/11/16 |
| 자작 FPS (0) | 2009/11/16 |
| 자작 슈팅게임 (0) | 2009/11/16 |
기본개념은 페이지(타일)별로 기본 높이맵 데이타(RENDER_QUEUE_WORLD_GEOMETRY_1)와 저해상도 단일 메쉬(RENDER_QUEUE_WORLD_GEOMETRY_2) 두벌을 준비합니다. 먼저 고해상도 지형을 랜더링하고, 스텐실버퍼에 랜더링된 부분을 기록 해둡니다. 그리고, 나머지 부분에 저해상도 메쉬로 채워넣습니다. 이때 두 부분을 자연스럽게 연결하기위해 포그를 고해상도 지형의 끝부분에 주고, 저해상도 메쉬는 전부 포그색으로 덮어버립니다.
이때 카메라의 NearClip/FarClip 스텐실버퍼 설정을 한 랜더링 주기에서 조절을 해줘야되는, 오거에서는 랜더링큐 리슨어를 이용해야 됩니다. 샘플 코드와 간단한 설명 그림을 첨부하겠습니다. 참고하세요.
#define STENCIL_VALUE_FOR_TERRAIN 0x1
#define STENCIL_FULL_MASK 0xFFFFFFFF
#define NEAR_CLIPDIST 1.0f
#define FAR_CLIPDIST 733.0f
#define FOG_DIST 200.0f
#define FARFAR_CLIPDIST 2000.0f
class TerrainOpRenderQueueListener : public RenderQueueListener {
public:
TerrainOpRenderQueueListener()
{
}
virtual void renderQueueStarted(uint8 queueGroupId, const String& invocation, bool &skipThisInvocation)
{
if (queueGroupId == RENDER_QUEUE_WORLD_GEOMETRY_1) {
RenderSystem *renderSystem = Root::getSingleton().getRenderSystem();
renderSystem->clearFrameBuffer(Ogre::FBT_STENCIL);
renderSystem->setStencilCheckEnabled(true);
renderSystem->setStencilBufferParams(Ogre::CMPF_ALWAYS_PASS,
STENCIL_VALUE_FOR_TERRAIN, STENCIL_FULL_MASK,
SOP_KEEP,SOP_KEEP,SOP_REPLACE,false);
} else if (queueGroupId == RENDER_QUEUE_WORLD_GEOMETRY_2) {
RenderSystem *renderSystem = Root::getSingleton().getRenderSystem();
Camera *camera = renderSystem->_getViewport()->getCamera();
Real nearDist = camera->getNearClipDistance();
Real farDist = camera->getFarClipDistance();
camera->setNearClipDistance(NEAR_CLIPDIST);
camera->setFarClipDistance(FARFAR_CLIPDIST);
renderSystem->_setProjectionMatrix(camera->getProjectionMatrixRS());
renderSystem->_setViewMatrix(camera->getViewMatrix(true));
camera->setNearClipDistance(nearDist); //이전값 복원
camera->setFarClipDistance(farDist);
renderSystem->setStencilCheckEnabled(true);
renderSystem->setStencilBufferParams(Ogre::CMPF_NOT_EQUAL,
STENCIL_VALUE_FOR_TERRAIN, STENCIL_FULL_MASK,
SOP_KEEP,SOP_KEEP,SOP_REPLACE,false);
}
}
virtual void renderQueueEnded(uint8 queueGroupId, const String& invocation, bool &repeatThisInvocation)
{
if (queueGroupId == RENDER_QUEUE_WORLD_GEOMETRY_2 - 1) {
} else if (queueGroupId == RENDER_QUEUE_WORLD_GEOMETRY_2) {
RenderSystem *renderSystem = Root::getSingleton().getRenderSystem();
renderSystem->setStencilCheckEnabled(false);
renderSystem->setStencilBufferParams();
}
}
};
void createScene()
{
//저해상도 지형은 Entity::setRenderQueueGroup(RENDER_QUEUE_WORLD_GEOMETRY_2); 으로 등록
...
m_pAppCamera->setClipDistance(NEAR_CLIPDIST, FAR_CLIPDIST);
ColourValue skyColour(0.557, 0.996, 1.000);
ColourValue fogColour(0.373, 0.737, 0.906);
m_pSceneManager->setFog( FOG_LINEAR, fogColour, 1, FAR_CLIPDIST-FOG_DIST, FAR_CLIPDIST);
m_pRenderWindow->getViewport(0)->setBackgroundColour(skyColour);
m_pSceneManager->addRenderQueueListener(new TerrainOpRenderQueueListener());
...
}
| ogre3d for iPhone (0) | 2009/12/08 |
|---|---|
| OGRE에서 빌보딩 사용하기 (0) | 2009/11/16 |
| '와우' 같은 근거리 처리법 (0) | 2009/11/16 |
| OGREMAX 플러그인에서 메쉬 통합하기 (0) | 2009/11/16 |
| 자작 FPS (0) | 2009/11/16 |
| 자작 슈팅게임 (0) | 2009/11/16 |
안녕하세요.
ogremax를 사용하는 개발자 입니다~
개발도중에 문제가 생겨서 이렇게 질문을 올립니다.
질문은요~~
통매쉬로 되어 있는 max파일은 익스포팅하면 정상정으로 익스포팅이 되고 재생이 되는데요~
매쉬가3개로 되어 있는 max파일은 특정 한개의 매쉬만 익스포팅되어 재생이 되는것을 확인했습니다.
이 현상에 대해서 아시는 분 있나요?ㅠ_ㅠ
도통 모르겠습니다~~ㅠ_ㅠ
첫 이미지는 익스포팅할때 이상하게 되는 것( 매쉬가 여러개 있습니다. )
두번째 이미지는 익스포팅했을때 이상없이 잘 되는 것( 매쉬가 하나 있습니다. )입니다.
매쉬가 다수개로 있으면 안되는 것인가요??흠..잘 모르겠습니다.ㅠ_ㅠ
[출처] 캐릭터 본 애니메이션 익스포터 질문입니다.ㅠ_ㅠ (OGRE3D) |작성자 불꽃남자
====================================
| | 신고 | |
| | 신고 | |
| | 신고 | |
| OGRE에서 빌보딩 사용하기 (0) | 2009/11/16 |
|---|---|
| '와우' 같은 근거리 처리법 (0) | 2009/11/16 |
| OGREMAX 플러그인에서 메쉬 통합하기 (0) | 2009/11/16 |
| 자작 FPS (0) | 2009/11/16 |
| 자작 슈팅게임 (0) | 2009/11/16 |
| 길찾기 AI (0) | 2009/11/16 |
| '와우' 같은 근거리 처리법 (0) | 2009/11/16 |
|---|---|
| OGREMAX 플러그인에서 메쉬 통합하기 (0) | 2009/11/16 |
| 자작 FPS (0) | 2009/11/16 |
| 자작 슈팅게임 (0) | 2009/11/16 |
| 길찾기 AI (0) | 2009/11/16 |
| 눈 내리는 지형 Rendering (0) | 2009/11/16 |
| OGREMAX 플러그인에서 메쉬 통합하기 (0) | 2009/11/16 |
|---|---|
| 자작 FPS (0) | 2009/11/16 |
| 자작 슈팅게임 (0) | 2009/11/16 |
| 길찾기 AI (0) | 2009/11/16 |
| 눈 내리는 지형 Rendering (0) | 2009/11/16 |
| ogre3d 자작 게임 소스 (0) | 2009/11/16 |
| 자작 FPS (0) | 2009/11/16 |
|---|---|
| 자작 슈팅게임 (0) | 2009/11/16 |
| 길찾기 AI (0) | 2009/11/16 |
| 눈 내리는 지형 Rendering (0) | 2009/11/16 |
| ogre3d 자작 게임 소스 (0) | 2009/11/16 |
| Ogre3D Tutorial 소스코드 모음입니다. (0) | 2009/11/16 |
| 자작 슈팅게임 (0) | 2009/11/16 |
|---|---|
| 길찾기 AI (0) | 2009/11/16 |
| 눈 내리는 지형 Rendering (0) | 2009/11/16 |
| ogre3d 자작 게임 소스 (0) | 2009/11/16 |
| Ogre3D Tutorial 소스코드 모음입니다. (0) | 2009/11/16 |
| OGRE3D Tutorial.03 카메라 뷰포트 설정 (0) | 2009/11/16 |
| 길찾기 AI (0) | 2009/11/16 |
|---|---|
| 눈 내리는 지형 Rendering (0) | 2009/11/16 |
| ogre3d 자작 게임 소스 (0) | 2009/11/16 |
| Ogre3D Tutorial 소스코드 모음입니다. (0) | 2009/11/16 |
| OGRE3D Tutorial.03 카메라 뷰포트 설정 (0) | 2009/11/16 |
| OBB 를 이용한 충돌처리!!!! (2) | 2009/11/16 |
http://rockenrollz.tistory.com
Ogre3D Tutorial Source-Code 최종형태 묶음 project file 입니다.
Visual Studio 2008로 작성되었습니다.
다른 버젼을 사용하시는 분은 디렉토리별 소스코드를 개별적으로 참조해 주세요.
A1~A7 까지는 Advenced Tutorial 편이며
B1~B8 까지는 Basic Tutorial 편 입니다.
몇 개 튜토리얼은 결과물을 보기좋게 볼 수 있도록 ViewPoint나 특정 수치값이 조금 바뀐경우도 있습니다.
| 눈 내리는 지형 Rendering (0) | 2009/11/16 |
|---|---|
| ogre3d 자작 게임 소스 (0) | 2009/11/16 |
| Ogre3D Tutorial 소스코드 모음입니다. (0) | 2009/11/16 |
| OGRE3D Tutorial.03 카메라 뷰포트 설정 (0) | 2009/11/16 |
| OBB 를 이용한 충돌처리!!!! (2) | 2009/11/16 |
| BillBoard를 이용한 EffectManager 구현!! (0) | 2009/11/16 |
| ogre3d 자작 게임 소스 (0) | 2009/11/16 |
|---|---|
| Ogre3D Tutorial 소스코드 모음입니다. (0) | 2009/11/16 |
| OGRE3D Tutorial.03 카메라 뷰포트 설정 (0) | 2009/11/16 |
| OBB 를 이용한 충돌처리!!!! (2) | 2009/11/16 |
| BillBoard를 이용한 EffectManager 구현!! (0) | 2009/11/16 |
| Ogre 마우스 Picking && Robot 이동 (0) | 2009/11/16 |
//box1이 이동하는 OBB / box2는 고정되어 있는 OBB
Vector3 obb1_center, obb2_center, T, LL; //box1,box2 의 각각 센터 좌표,
Real box_len, a1, a2, a3, b1, b2, b3, TL;
Matrix4 obb1_invers_mat, obb2_rotae_mat;
Matrix4 R ;
//OBB 박스의 월드 좌표??
obb1_invers_mat = OBB1->getCharMat.inverse();
obb2_rotae_mat = OBB2->getMonMat();
//box1 의 좌표계를 box2의 좌표계로 회전변환 행렬 R = RA-1 * RB(-1은 iverse)
R = obb1_invers_mat * obb2_rotae_mat;
//box의 좌표축의 normal vector x, y, z 값 (제가 이해한 내용 - 틀린 내용 일 수도 있음 ㅋ)
Vector3 obb1_size = OBB1->getWorldBoundingBox().getSize();
Vector3 obb2_size = OBB2->getWorldBoundingBox().getSize();
a1 = obb1_size.x;
a2 = obb1_size.y ;
a3 = obb1_size.z ;
b1 = obb2_size.x ;
b2 = obb2_size.y ;
b3 = obb2_size.z ;
obb1_center = OBB1->getWorldBoundingBox().getCenter();
obb2_center = OBB2->getWorldBoundingBox().getCenter();
//box1 의좌표계에서 box1 중심에서 box2의 중심으로의 이동을 나타내는 vector3
T = Vector3(obb1_center.x - obb2_center.x, obb1_center.y - obb2_center.y, obb1_center.z - obb2_center.z);
//0. LL = A1
box_len = a1 + b1 * R[0][0] + b2*R[0][1] + b3*R[0][2];
LL =Vector3(1.0f, 0.0f, 0.0f); //분할 축의 벡터
TL = T.absDotProduct(LL); //T 와 L의 내적의 절대값
box_len = Math::Abs(box_len);
if(TL > box_len)
{
/*cout << "충돌되지 않음" << endl;*/
return 0;
}
//1. LL = A2
box_len = a2 + b1 * R[1][0] + b2*R[1][1] + b3*R[1][2];
LL = Vector3(0.0f, 1.0f, 0.0f);
TL = T.absDotProduct(LL);
box_len = Math::Abs(box_len);
if(TL > box_len)
{
/*cout << "충돌되지 않음" << endl;*/
return 0;
}
//2. LL = A3
box_len = a3 + b1 * R[2][0] + b2*R[2][1] + b3*R[2][2];
LL = Vector3(0.0f, 0.0f, 1.0f);
TL = T.absDotProduct(LL);
box_len = Math::Abs(box_len);
if(TL > box_len)
{
/*cout << "충돌되지 않음" << endl;*/
return 0;
}
//3. LL = RB1[R11 R21 R31]
box_len = a1*R[0][0] + a2 * R[1][0] + a3*R[2][0] + b1;
LL = Vector3(R[0][0], R[1][0], R[2][0]);
TL = T.absDotProduct(LL);
box_len = Math::Abs(box_len);
if(TL > box_len)
{
/*cout << "충돌되지 않음" << endl;*/
return 0;
}
//4. LL = RB2[R12 R22 R32]
box_len = a1*R[0][1] + a2 * R[1][1] + a3*R[2][1] + b2;
LL = Vector3(R[0][1], R[1][1], R[2][1]);
TL = T.absDotProduct(LL);
box_len = Math::Abs(box_len);
if(TL > box_len)
{
/*cout << "충돌되지 않음" << endl;*/
return 0;
}
//5. LL = RB3[R13 R23 R33]
box_len = a1*R[0][2] + a2 * R[1][2] + a3*R[2][2] + b3;
LL = Vector3(R[0][2], R[1][2], R[2][2]);
TL = T.absDotProduct(LL);
box_len = Math::Abs(box_len);
if(TL > box_len)
{
/*cout << "충돌되지 않음" << endl;*/
return 0;
}
//6. LL = A1 X RB1 = [1 0 0] X [R13 R23 R33] = [ 0 -R31 R21 ]
box_len = a2*R[2][0] + a3*R[1][0] + b2*R[0][2] + b3*R[0][1];
LL = Vector3(0.0f, R[2][0], R[1][0]);
TL = T.absDotProduct(LL);
box_len = Math::Abs(box_len);
if(TL > box_len)
{
/*cout << "충돌되지 않음" << endl;*/
return 0;
}
//7. LL = A1 X RB2 = [1 0 0] X [R12 R22 R32] = [ 0 -R32 R22 ]
box_len = a2*R[2][1] + a3*R[1][1] + b1*R[0][2] + b3*R[0][0];
LL = Vector3(0.0f, -R[2][1], R[1][1]);
TL = T.absDotProduct(LL);
box_len = Math::Abs(box_len);
if(TL > box_len)
{
/*cout << "충돌되지 않음" << endl;*/
return 0;
}
//8. LL = A1 X RB3 = [1 0 0] X [R13 R23 R33] = [ 0 -R33 R23 ]
box_len = a2*R[2][2] + a3*R[1][2] + b1*R[0][1] + b2*R[0][0];
LL = Vector3(0.0f, -R[2][2], R[1][2]);
TL = T.absDotProduct(LL);
box_len = Math::Abs(box_len);
if(TL > box_len)
{
/*cout << "충돌되지 않음" << endl;*/
return 0;
}
//9. LL = A2 X RB1 = [0 1 0] X [R11 R21 R31] = [R31 0 -R11]
box_len = a1*R[2][0] + a3*R[0][0] + b2*R[1][2] + b3*R[1][1];
LL = Vector3(R[2][0], 0.0f, R[0][0]);
TL = LL.absDotProduct(T);
box_len = Math::Abs(box_len);
if(TL > box_len)
{
/*cout << "충돌되지 않음" << endl;*/
return 0;
}
//10. LL = A2 X RB2 = [0 1 0] X [R12 R22 R32] = [R32 0 -R12]
box_len = a1*R[2][1] + a3*R[0][1] + b1*R[1][2] + b3*R[1][0];
LL = Vector3(R[2][1], 0.0f, -R[0][1]);
TL = T.absDotProduct(LL);
box_len = Math::Abs(box_len);
if(TL > box_len)
{
/*cout << "충돌되지 않음" << endl;*/
return 0;
}
//11. LL = A2 X RB3 = [0 1 0] X [R13 R23 R33] = [R33 0 -R13]
box_len = a1*R[2][2] + a3*R[0][2] + b1*R[1][1] + b2*R[1][0];
LL = Vector3(R[2][2], 0.0f, -R[0][2]);
TL = T.absDotProduct(LL);
box_len = Math::Abs(box_len);
if(TL > box_len)
{
/* cout << "충돌되지 않음" << endl;*/
return 0;
}
//12. LL = A3 X RB1 = [0 0 1] X [R11 R21 R31] = [-R21 R11 0]
box_len = a1*R[1][0] + a2*R[0][0] + b2*R[2][2] + b3*R[2][1];
LL = Vector3(-R[1][0], R[0][0], 0.0f);
TL = T.absDotProduct(LL);
box_len = Math::Abs(box_len);
if(TL > box_len)
{
/*cout << "충돌되지 않음" << endl;*/
return 0;
}
//13. LL = A3 X RB2 = [0 0 1] X [R12 R22 R32] = [-R22 R12 0]
box_len = a1*R[1][1] + a2*R[0][1] + b1*R[2][2] + b3*R[2][0];
LL = Vector3(-R[1][1], R[0][1], 0.0f);
TL = T.absDotProduct(LL);
box_len = Math::Abs(box_len);
if(TL > box_len)
{
/*cout << "충돌되지 않음" << endl;*/
return 0;
}
//14. LL = A3 X RB3 = [0 0 1] X [R13 R23 R33] = [-R23 R13 0]
box_len = a1*R[1][2] + a2*R[0][2] + b1*R[2][1] + b2*R[2][0];
LL = Vector3(-R[1][2], R[0][2], 0.0f);
TL = T.absDotProduct(LL);
box_len = Math::Abs(box_len);
if(TL > box_len)
{
/* cout << "충돌되지 않음" << endl;*/
return 0;
}
//cout << "충돌!!" << endl;
return 1;
}
구현을 해서 실행을 시켜본 결과 충돌 검출은 잘 하는데 살짝 떨어져 있어도 충돌 체크를 하는 경우가 있는데,
이유는 저도 잘...ㅠㅠ 그래도 이렇게해서 충돌 체크를 한다는거에 감사할 따름입니다. ㅋㅋ
혹시 소스 자체에 수정 할 부분이 있다고 생각되시는 분은 가르침 부탁 드리겠습니다^^ㅋ
인증샷!!!!
Ps. box의 Matrix를 받아 오는 함수를 사용해서 Matrix값을 받아오게 했었는데, 값이 이상 했나 보네여 ;; 충돌 처리가 정확히 되지 않았습니다. 그래서 객체의 Entity 의_getBoneMatrices.transpose()를 사용해서 Matrix값을 받아 와서 충돌처리를 했더니 정확하게 OBB의 충돌 위치에서 멈추는 것을 확인 할 수 있었습니다.
아직 정확한 Ogre의 분석이 되지 않은 상태에서 이것 저것 해보다가 얻어 걸린 것이라서 정확하게 어떻다라는 것을 제가 말씀 드릴 수는 없을 것 같습니다. 이해해 주시길..^^;; ㅋㅋ
(소스에서 이상한점을 발견 하시거나 잘못 된 곳을 발견하시면 저에게도 살포시 알려주세요~ㅋㅋㅋ)
| Ogre3D Tutorial 소스코드 모음입니다. (0) | 2009/11/16 |
|---|---|
| OGRE3D Tutorial.03 카메라 뷰포트 설정 (0) | 2009/11/16 |
| OBB 를 이용한 충돌처리!!!! (2) | 2009/11/16 |
| BillBoard를 이용한 EffectManager 구현!! (0) | 2009/11/16 |
| Ogre 마우스 Picking && Robot 이동 (0) | 2009/11/16 |
| ogre3d 투터리얼 (0) | 2009/11/16 |
음.. 프로젝트에서 사용되는 이펙트 처리를 어떻게 할까 생각하다가 3D 그래픽 툴을 사용할 줄 몰라서 결국
BillBoard를 사용하기로 했습니다. ㅠㅠ
//Effect.h
class Effect
{
private:
SceneManager* eSceneMgr; //빌보드를 생성할 SceneManager
SceneNode* myBillBoard; //빌보드 Scene 생성
Billboard* myBill; //빌보드 생성
BillboardSet* myBillSet; //빌보드 Set
Real mLast;
bool eAlive;
OBBoxRenderable *billOBB;
public:
void initEffect(SceneManager* mSceneMgr);
void makeEffect(int eType, String eName, String materName, Vector3 oPosition);
void updateEffect(const FrameEvent& evt);
bool getAlive();
};
//Effect.cpp
using namespace std;
void Effect::initEffect(SceneManager* mSceneMgr)
{
eSceneMgr = mSceneMgr;
mLast = 0;
}
void Effect::makeEffect(int eType, String eName, String materName , Vector3 oPosition)
{
static int i = 0;
myBillBoard = eSceneMgr->getRootSceneNode()->createChildSceneNode();
myBillSet = eSceneMgr->createBillboardSet("My" + StringConverter::toString(i++));
myBillSet->setMaterialName(materName);
myBill = myBillSet->createBillboard(oPosition);
myBill->setDimensions(100.0f, 100.0f);
std::vector<FloatRect> coords;
int row = 60;
int col = 1;
float rf = 1.0f / row;
float cf = 1.0f / col;
for(int j = 0; j < 60; j++)
{
coords.push_back(FloatRect(rf*j,cf*0, rf*(j+1), cf*1));
}
myBillSet->setTextureCoords(&coords[0], coords.size());
//FloatRect r(0,0,.25,.25);
//b->setTexcoordRect(r);
myBillBoard->attachObject(myBillSet);
billOBB = new OBBoxRenderable();
billOBB->setupVertices(myBillSet->getBoundingBox());
myBillBoard->attachObject(billOBB);
mLast = 0.05;
eAlive = true;
}
void Effect::updateEffect(const FrameEvent& evt)
{
if(eAlive)
{
if(mLast < 0)
{
mLast = 0.05f;
Ogre::uint16 it = myBill->getTexcoordIndex();
myBill->setTexcoordIndex(++it%60);
cout << it << endl;
}
else
{
mLast -= evt.timeSinceLastFrame;
}
//eAlive = false;
}
else
{
mLast = 0;
myBillBoard->detachAllObjects();
myBillSet->removeBillboard(myBill);
eSceneMgr->destroyAllBillboardSets();
eSceneMgr->destroySceneNode(myBillBoard);
myBillBoard = NULL;
myBill = NULL;
myBillSet = NULL;
}
}
앞서 말씀드린 것과 같이 Effect 클래스를 list로 사용하기 위해서 EffectMgr 이라는 매니저 클래스를 따로 만들었습니다.
Effect가 불려질때 여러개가 불려지고 사라지고 할 수 있기때문에 싱글톤으로 구현을 해보았습니다.
//EffectMgr.h
class EffectMgr
{
private:
static EffectMgr* mEffectMgr;
std::list<Effect *> elist;
EffectMgr(){};
public:
~EffectMgr(){};
void makeEffectMgr(SceneManager* eSceneMgr, String eName, String materName, int eType, Vector3 oPosition);
void updateMgr(const FrameEvent& evt);
static EffectMgr* getinstance();
};
//EffectMgr.cpp
EffectMgr* EffectMgr::mEffectMgr;
void EffectMgr::makeEffectMgr(Ogre::SceneManager *eSceneMgr,
Ogre::String eName, String materName, int eType, Ogre::Vector3
oPosition)
{
static int i = 0;
Effect* E = new Effect();
E->initEffect(eSceneMgr);
E->makeEffect(eType, eName + StringConverter::toString(i++), materName , oPosition);
elist.push_back(E);
}
void EffectMgr::updateMgr(const FrameEvent& evt)
{
if(!elist.empty())
{
Effect* E;
std::list<Effect *>::iterator i = elist.begin();
while(i != elist.end())
{
E = *i;
if(E->getAlive())
{
E->updateEffect(evt);
i++;
}
else
{
i = elist.erase(i);
}
}
}
}
EffectMgr* EffectMgr::getinstance()
{
if(!mEffectMgr)
{
mEffectMgr = new EffectMgr();
}
return mEffectMgr;
}
싱클톤은 친구의 도움으로 구현 했습니다.;;;(아.. 공부좀를 더 해야지 이거 원...ㅠㅠ )
이상 허접한 저의 소스를 보셨습니다.^^ㅋ
| OGRE3D Tutorial.03 카메라 뷰포트 설정 (0) | 2009/11/16 |
|---|---|
| OBB 를 이용한 충돌처리!!!! (2) | 2009/11/16 |
| BillBoard를 이용한 EffectManager 구현!! (0) | 2009/11/16 |
| Ogre 마우스 Picking && Robot 이동 (0) | 2009/11/16 |
| ogre3d 투터리얼 (0) | 2009/11/16 |
| 통 MESH 가 아닌 여러개로 구성된 object 를 오우거에서 로딩하기 [출처] [ogre3d] 통 MESH 가 아닌 여러개로 구성된 object 를 오우거에서 로딩하기|작성자 놀부 (0) | 2009/11/16 |
RaySceneQueryResult &result = mRaySceneQuery->execute();
RaySceneQueryResult::iterator itr = result.begin();
| OBB 를 이용한 충돌처리!!!! (2) | 2009/11/16 |
|---|---|
| BillBoard를 이용한 EffectManager 구현!! (0) | 2009/11/16 |
| Ogre 마우스 Picking && Robot 이동 (0) | 2009/11/16 |
| ogre3d 투터리얼 (0) | 2009/11/16 |
| 통 MESH 가 아닌 여러개로 구성된 object 를 오우거에서 로딩하기 [출처] [ogre3d] 통 MESH 가 아닌 여러개로 구성된 object 를 오우거에서 로딩하기|작성자 놀부 (0) | 2009/11/16 |
| 컴파일 방법 (0) | 2009/11/16 |
| BillBoard를 이용한 EffectManager 구현!! (0) | 2009/11/16 |
|---|---|
| Ogre 마우스 Picking && Robot 이동 (0) | 2009/11/16 |
| ogre3d 투터리얼 (0) | 2009/11/16 |
| 통 MESH 가 아닌 여러개로 구성된 object 를 오우거에서 로딩하기 [출처] [ogre3d] 통 MESH 가 아닌 여러개로 구성된 object 를 오우거에서 로딩하기|작성자 놀부 (0) | 2009/11/16 |
| 컴파일 방법 (0) | 2009/11/16 |
| CEGUI 한글설정 (0) | 2009/11/16 |
먼저 기본이 되는 Mesh 와 Skeleton, Material 을 익스포트하고
난 뒤 나머지 메쉬들은 메쉬와 재질만 익스포트 한다.
그뒤에 오우거에서는
Entity *ent = mSceneMgr->createEntity( "Body", "body.mesh" );
SceneNode *node = mSceneMgr->getRootSceneNode()->createChildSceneNode( "BodyNode"
);
node->attachObject( ent );
node->scale( 2, 2, 2 );
Entity *ent2 = mSceneMgr->createEntity("Head", "head.mesh");
ent->attachObjectToBone( "Bip01_Neck", ent2, Quaternion::ZERO );
요렇게 하면 된다
더 좋은 방법이 있을 줄 알지만 서도..-_-;;
머리가 않따가주네..ㅋㅋ
| Ogre 마우스 Picking && Robot 이동 (0) | 2009/11/16 |
|---|---|
| ogre3d 투터리얼 (0) | 2009/11/16 |
| 통 MESH 가 아닌 여러개로 구성된 object 를 오우거에서 로딩하기 [출처] [ogre3d] 통 MESH 가 아닌 여러개로 구성된 object 를 오우거에서 로딩하기|작성자 놀부 (0) | 2009/11/16 |
| 컴파일 방법 (0) | 2009/11/16 |
| CEGUI 한글설정 (0) | 2009/11/16 |
| cegui 한글 ime 입출력 (0) | 2009/11/16 |
Those libraries & versions are required:
Soon
See the article Member Function Pointer and the Fastest Possible C++ Delegates from CodeProject to get the code.
ogeroot/oge/include/fastdelegates
See Ogre and Ogre wiki for infomations about Ogre. Ogre must be build with thread support (and ogre memory manager disabled) hence you must build it from source: see Building_From_Source for instructions.
OgreSDK/include in ogeroot/oge/include/ogre.
OgreSDK/lib in ogeroot/oge/lib/release.
OgreSDK/lib in ogeroot/oge/lib/debug.
OgreSDK/bin/debug in ogeroot/samples/lib/debug.
OgreSDK/bin/release in ogeroot/samples/lib/release.
OgreSDK/media in ogeroot/samples/.
OgreSDK/samples/include/OgreCEGUIRenderer.h and OgreCEGUIResourceProvider.h into ogeroot/oge/include/OGRE. Important: The Ogre memory manager must be disabled to run
the debug version of Oge. The easiest is to comment out the line 353 to
373 of file include/ogre/ogrememorymanager.h and replace
the line 381 by "#include "OgreNoMemoryMacros.h". (Btw you don't need
to rebuild ogre with the memory manager disabled.). Be sure that in
OgreConfig.h the following define is set to 0:
/** Set this to 0 if you want to use the standard memory manager in Debug builds
Release builds always use the standard memory manager
*/
#define OGRE_DEBUG_MEMORY_MANAGER 0
Important: Ogre3D must be compiled with thread support. This means you need to set 1 in OgreConfig.h to have:
#ifndef OGRE_THREAD_SUPPORT
#define OGRE_THREAD_SUPPORT 1
#endif
Note: The two files OgreCEGUIRenderer.h and
OgreCEGUIResourceProvider.h will perhaps be rewritten to simplify the
include path search and make the copying of those two files obsolete.
See CEGUIs website
OGE currently uses the version that comes with OGRE 1.4.x dependencies.
See Object Oriented Input System.
ogeroot/oge/lib (with each debug/release version in its appropriate folder).
oisroot/includes in ogeroot/oge/include/ois.
ogeroot/oge/bin and ogeroot/samples/bin.
RakNet/Lib/ in ogeroot/oge/lib/release
RakNet/Lib/ in ogeroot/oge/lib/debug
RakNet/Lib/ in ogeroot/samples/lib/release
RakNet/Lib/ in ogeroot/samples/lib/debug
See OPALs website
OPAL and ODE must be built with the same floating point precision. My current version uses double precision as its defaulted to that.
Note: There are two versions of OpenAl: One is totally open-source (this is the one you get when you download the source), the other (the windows Openal SDK) is promoted by Creative and contain features that are NOT open-source and availble only one Windows. For now we decided to develop only with the first one and because of this we didn't try to use (and link against) the second version.
OpenAl/OpenAL-Windows/ to get the OpenAl32 libs and .dlls
OpenAL/alut/VisualStudioDotNET to get alut libs and .dlls
ogeroot/oge/lib/release and debug
ogeroot/samples/lib/release and debug
In fact we are using SqPlus which is an easy to use binding system for Squirrel. It contains the squirrel code.
http://squirrel-lang.org/default.aspx
http://wiki.squirrel-lang.org/default.aspx/SquirrelWiki/SqPlus.html
SQUIRREL2_1_1_sqplus_23/include in ogeroot/oge/include/squirrel/include
SQUIRREL2_1_1_sqplus_23/sqplus in ogeroot/oge/include/squirrel/sqplus
SQUIRREL2_1_1_sqplus_23/lib in ogeroot/oge/lib. Those with ***D.lib are for the debug folder.
TiCpp is also a static library hence no dll.
We will use the zip libraries coming with OGRE.
Those two libraries will enable us to support .ogg audio file. This format is especially useful for large audio file (such as background music and dialogs)
The ogg-vorbis tool is composed of:
We will not need vorbisenc in oge now but I will provide it anyway in the sdk. Perhaps we can use it in OGEd to convert file to the ogg format :)
-- OGG --
-- vorbis --
Note: You really only need the vorbis_dynamic libs but I will give some explanations that apply to all vorbis project.
| ogre3d 투터리얼 (0) | 2009/11/16 |
|---|---|
| 통 MESH 가 아닌 여러개로 구성된 object 를 오우거에서 로딩하기 [출처] [ogre3d] 통 MESH 가 아닌 여러개로 구성된 object 를 오우거에서 로딩하기|작성자 놀부 (0) | 2009/11/16 |
| 컴파일 방법 (0) | 2009/11/16 |
| CEGUI 한글설정 (0) | 2009/11/16 |
| cegui 한글 ime 입출력 (0) | 2009/11/16 |
| ogre3d 빌더~굿~~~~~초강추 (0) | 2009/11/15 |

| 통 MESH 가 아닌 여러개로 구성된 object 를 오우거에서 로딩하기 [출처] [ogre3d] 통 MESH 가 아닌 여러개로 구성된 object 를 오우거에서 로딩하기|작성자 놀부 (0) | 2009/11/16 |
|---|---|
| 컴파일 방법 (0) | 2009/11/16 |
| CEGUI 한글설정 (0) | 2009/11/16 |
| cegui 한글 ime 입출력 (0) | 2009/11/16 |
| ogre3d 빌더~굿~~~~~초강추 (0) | 2009/11/15 |
| ogre3d 씬 빌더~ (0) | 2009/11/15 |
| 컴파일 방법 (0) | 2009/11/16 |
|---|---|
| CEGUI 한글설정 (0) | 2009/11/16 |
| cegui 한글 ime 입출력 (0) | 2009/11/16 |
| ogre3d 빌더~굿~~~~~초강추 (0) | 2009/11/15 |
| ogre3d 씬 빌더~ (0) | 2009/11/15 |
| OGRE3D EXPORTER 모음 (0) | 2009/11/15 |
| CEGUI 한글설정 (0) | 2009/11/16 |
|---|---|
| cegui 한글 ime 입출력 (0) | 2009/11/16 |
| ogre3d 빌더~굿~~~~~초강추 (0) | 2009/11/15 |
| ogre3d 씬 빌더~ (0) | 2009/11/15 |
| OGRE3D EXPORTER 모음 (0) | 2009/11/15 |
| OGRE3D TOOLS (0) | 2009/11/15 |
| cegui 한글 ime 입출력 (0) | 2009/11/16 |
|---|---|
| ogre3d 빌더~굿~~~~~초강추 (0) | 2009/11/15 |
| ogre3d 씬 빌더~ (0) | 2009/11/15 |
| OGRE3D EXPORTER 모음 (0) | 2009/11/15 |
| OGRE3D TOOLS (0) | 2009/11/15 |
| OGRE3D 매쉬 뷰어 (0) | 2009/11/15 |
| ogre3d 빌더~굿~~~~~초강추 (0) | 2009/11/15 |
|---|---|
| ogre3d 씬 빌더~ (0) | 2009/11/15 |
| OGRE3D EXPORTER 모음 (0) | 2009/11/15 |
| OGRE3D TOOLS (0) | 2009/11/15 |
| OGRE3D 매쉬 뷰어 (0) | 2009/11/15 |
| ogre3d GOOF및 여러가지 (0) | 2009/11/15 |
| ogre3d 씬 빌더~ (0) | 2009/11/15 |
|---|---|
| OGRE3D EXPORTER 모음 (0) | 2009/11/15 |
| OGRE3D TOOLS (0) | 2009/11/15 |
| OGRE3D 매쉬 뷰어 (0) | 2009/11/15 |
| ogre3d GOOF및 여러가지 (0) | 2009/11/15 |
| 어드벤쳐 게임 개발 툴 (0) | 2009/11/14 |
| OGRE3D EXPORTER 모음 (0) | 2009/11/15 |
|---|---|
| OGRE3D TOOLS (0) | 2009/11/15 |
| OGRE3D 매쉬 뷰어 (0) | 2009/11/15 |
| ogre3d GOOF및 여러가지 (0) | 2009/11/15 |
| 어드벤쳐 게임 개발 툴 (0) | 2009/11/14 |
| ogre3d에서 fade효과 주기 (0) | 2009/11/14 |
| OGRE3D TOOLS (0) | 2009/11/15 |
|---|---|
| OGRE3D 매쉬 뷰어 (0) | 2009/11/15 |
| ogre3d GOOF및 여러가지 (0) | 2009/11/15 |
| 어드벤쳐 게임 개발 툴 (0) | 2009/11/14 |
| ogre3d에서 fade효과 주기 (0) | 2009/11/14 |
| ogre3d를 브라우저에서 ~~굿 (0) | 2009/11/14 |


| OGRE3D 매쉬 뷰어 (0) | 2009/11/15 |
|---|---|
| ogre3d GOOF및 여러가지 (0) | 2009/11/15 |
| 어드벤쳐 게임 개발 툴 (0) | 2009/11/14 |
| ogre3d에서 fade효과 주기 (0) | 2009/11/14 |
| ogre3d를 브라우저에서 ~~굿 (0) | 2009/11/14 |
| mesh maya3d에서 익스포트 (0) | 2009/11/13 |
| ogre3d GOOF및 여러가지 (0) | 2009/11/15 |
|---|---|
| 어드벤쳐 게임 개발 툴 (0) | 2009/11/14 |
| ogre3d에서 fade효과 주기 (0) | 2009/11/14 |
| ogre3d를 브라우저에서 ~~굿 (0) | 2009/11/14 |
| mesh maya3d에서 익스포트 (0) | 2009/11/13 |
| ogre3d 무료 강좌~굿~ (0) | 2009/11/13 |
| 어드벤쳐 게임 개발 툴 (0) | 2009/11/14 |
|---|---|
| ogre3d에서 fade효과 주기 (0) | 2009/11/14 |
| ogre3d를 브라우저에서 ~~굿 (0) | 2009/11/14 |
| mesh maya3d에서 익스포트 (0) | 2009/11/13 |
| ogre3d 무료 강좌~굿~ (0) | 2009/11/13 |
| OGRE3D 추천 카페 (0) | 2009/11/13 |
| ogre3d에서 fade효과 주기 (0) | 2009/11/14 |
|---|---|
| ogre3d를 브라우저에서 ~~굿 (0) | 2009/11/14 |
| mesh maya3d에서 익스포트 (0) | 2009/11/13 |
| ogre3d 무료 강좌~굿~ (0) | 2009/11/13 |
| OGRE3D 추천 카페 (0) | 2009/11/13 |
| Ogre3D로 만든 메시뷰어 입니다. LittleMeshViewer 0.1 (0) | 2009/11/13 |
| ogre3d를 브라우저에서 ~~굿 (0) | 2009/11/14 |
|---|---|
| mesh maya3d에서 익스포트 (0) | 2009/11/13 |
| ogre3d 무료 강좌~굿~ (0) | 2009/11/13 |
| OGRE3D 추천 카페 (0) | 2009/11/13 |
| Ogre3D로 만든 메시뷰어 입니다. LittleMeshViewer 0.1 (0) | 2009/11/13 |
| 오우거 AppWizard 없이 빈프로젝트 생성하여 튜토리얼 진행하기 [출처] 오우거 AppWizard 없이 빈프로젝트 생성하여 튜토리얼 진행하기.|작성자 Ghost (0) | 2009/11/13 |