'할거리'에 해당되는 글 28건

  1. 2015.09.15 C++ Builder에서 GLScene 사용하기 #3 - Camera Focus & Position
  2. 2015.09.15 C++ Builder에서 GLScene 사용하기 #2 - 마우스 이용하기
  3. 2015.09.15 C++ Builder에서 GLScene 사용하기 #1
  4. 2015.09.10 MySQL Workbench EER Diagram Unicode 문제
  5. 2015.08.19 [ilink32 Error] Fatal: Unable to open file 'UNITGR32PAS.OBJ'
  6. 2015.08.11 CString to const char*
  7. 2015.07.20 C2665: 'AfxMessageBox' : none of the 2 overloads could convert all the argument types
  8. 2015.07.16 [ilink32 Error] Error: Unresolved external 'wWinMain' referenced from C0W32W.OBJ
  9. 2015.06.24 VC : Find Results not displaying Results
  10. 2015.06.24 OpenCV warning C4819 current code page (949)


각 콘트롤들의 설정

TrackBar : 

Name : tBarFocal

MinMax : 50~500

OnChange :

    GLCamera1->FocalLength = tBarFocal->Position;


SpinEdit :

Name : sEditCamPosX, sEditCamPosY, sEditCamPosZ

OnChange :

GLCamera1->Position->X = sEditCamPosX->Value;

GLCamera1->Position->Y = sEditCamPosY->Value;

GLCamera1->Position->Z = sEditCamPosZ->Value;


Get :

Name : btnCameraPosGet

OnClick :

sEditCamPosX->OnChange = NULL;

sEditCamPosY->OnChange = NULL;

sEditCamPosZ->OnChange = NULL;

sEditCamPosX->Value = GLCamera1->Position->X;

sEditCamPosY->Value = GLCamera1->Position->Y;

sEditCamPosZ->Value = GLCamera1->Position->Z;

sEditCamPosX->OnChange = sEditCamPosXChange;

sEditCamPosY->OnChange = sEditCamPosXChange;

sEditCamPosZ->OnChange = sEditCamPosXChange;

PLY 불러온 다음 실행하면 끝-



앞의 #1 - 설치 이후 계속


(1) Scene 설정

Scene에 아래와 같이 수정/추가 한다.

FreeForm과 Actor의 차이를 모르니까, 일단 둘 다 추가


FreeForm/Actor를 움직이게 되면, Camera가 따라 회전한다.

Camer의 시점을 고정하기 위해서, DummyCube를 추가한 다음에,

GLCamera의 Target Object = DummyCube로 해 둔다.

이러게 해 두면, FreeForm/Actor 를 움직여도 실제 움직이는 효과가 나타난다.


(2) PLY 파일 불러오기

const String fName = "c://DelpApp//Components//FreeComp//GLScene//Samples//media//Polyhedron.ply";

GLActor1->LoadFromFile( fName );

         또는

GLFreeForm1->LoadFromFile( fName );


그 다음에, GLScene Utils에 있는,

TGLSimpleNavigation 추가한다.

컴파일 -> 실행하면 이상없이 OK



#2 끝




(1) 설치

구글에서 GLSecne 찾는다.

홈페이지는 여기

Source File : here

다운 받아서 설치

c:/DelpApp/Components/FreeComp/GLScene

여기에 압축해제했고,

GLSCENE_INC = ..../Source/Include

GLSCENE_LIB = ..../Source/lib

환경변수까지 입력하면 설치 완료

아래 예제는 .../Help/GLSceneTraining.chm 참조해서 작성


(2) 첫 예제

1) VCL app 하나 만들고, 

TGLScene

TGLSceneViewer

하나씩 배치

크기는 대충 위와 같이 하면 된다.


GLScene을 눌러 Scene Editor 호출한다


Cube 를 추가


카메라도 하나 추가


Cube, Camera 추가한 직후의 Scene Editor


Camera 를 선택한 다음에,


Camera 의 Target Object를 GLCube로...

그래야 Cube가 보인다


Camera의 위치 변경을 위해서, Position 선택해서,


XYZ (1,1,1) 의 값을 입력한다


자, 이제 Cube가 보인다....


조명을 추가한 다음에,


조명의 위치를 XYZ(1,3,2)로 설정하면,



이제 Cube가 제대로 보인다.


#1 끝



Table의 Attribute 의 한글표기가 제대로 되지 않는다


Unicode 사용가능하게끔 설정을 바꾸어 주어야 한다.

Edit -> Preferences.. 들어가게 되면...

Modeling -> Appearance 항목 선택한 다음,

Western 을 Korean으로 변경한 다음, 파일을 다시 open하면 끝.

결과는 다음과 같다.


- end -



'할거리 > PC' 카테고리의 다른 글

Excel 편집하는데 속도가 너무 느릴 경우  (0) 2015.10.02

UsingOpenCV30 컴파일 시키면 나오는 에러 "

[ilink32 Error] Fatal: Unable to open file 'UNITGR32PAS.OBJ'

NextColor64 컴에서는 안나오느데, HP에서는 나온다.


- Project -> Option -> Library Path 추가해도 안된다.


2015-08-19일 현재 

아직 원인 불명.

원인 찾게되면, 잊어버리지 않게끔 여기에 기록해 둘 예정.


2017-01-16

원인 찾았다.

GLBaseClasses.obj 계속 찾는데,

path 추가로 해결될 문제가 아니었네.


Delphi 컴포넌트를 C++에서는 Lib 파일로 가져다 사용

프로젝트 파일 cbproj 직접 수정해야.

<AllPackageLibs>

<LinkPackageStatics>

GLScene_RunTime.lib 추가하니까 깔끔하게 해결.


error C2664: cannot convert argument 1 from 'CString' to 'const char *'


CString str = ---

int nLen = str.GetLength();

char *ch = new char[nLen];

  WideCharToMultiByte(CP_ACP, 0, str, -1, ch, nLen + 1, NULL, NULL);

  --- << ch 사용 >> ---

delete[] ch;

C2665: 'AfxMessageBox' : none of the 2 overloads could convert all the argument types

solution :

http://stackoverflow.com/questions/6167609/some-problem-with-afxmessagebox-mfc-function


(1)

You may, although I doubt this, have to scope it globally. To do that, try

::AfxMessageBox("Camera have no connection",MB_OK|MB_ICONSTOP);


(2)

The other is that use are building for unicode and it thinks the string is multi-byte. To do that, try

AfxMessageBox( L"Camera have no connection",MB_OK|MB_ICONSTOP);

I'm out of town, on my Mac, so I can't test this. But I have been stuck in the office on weekends so I figured I'd offer up two things to try.


예전 프로젝트 파일 불러와서 새로 컴파일하면 생기는 에러.

(1) WinMain 을 _tWinMain 으로 바꾼다.

WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)

WINAPI _tWinMain(HINSTANCE, HINSTANCE, LPTSTR, int)

이걸로 바꾼다.


(2) tchar.h 추가

#include <vcl.h>

#pragma hdrstop

#include <tchar.h>

이렇게 한 줄 추가해주면 끝.



VC에서 Find 했는데, 결과 표시가 되지 않는다면?


해결 : 

http://stackoverflow.com/questions/13386856/find-results-not-displaying-results


[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{73B7DC00-F498-4ABD-AB79-D07AFD52F395}\InProcServer32]

여기 가면, 아마 빈칸이 있을것.

@="C:\\Program Files (x86)\\Common Files\\Microsoft Shared\\MSEnv\\TextMgrP.dll"

이 항목 추가하면 된다.



opencv2/core/mat.hpp(1965): 

warning C4819: 

The file contains a character that cannot be represented in the current code page (949).

Save the file in Unicode format to prevent data loss



Solution: 

File Save As...

Unicode UTF-8 with signature Codepage 65001


1 2 3 

글 보관함

카운터

Total : / Today : / Yesterday :
get rsstistory!