Programming/openGL2025. 4. 28. 19:06

Open Asset Import Library(assimp) 를 이용해서 blender를 읽어오고 openGL로 그릴수 있는 것으로 보인다.

 

Features

  • Reads more than 30 3D file formats, including Collada, X, 3DS, Blend, Obj
  • Converts them to a hierarchical in-memory data structure
  • Provides 'post-processing steps' to improve the input data, i.e. generate normals and tangents or fix import issues.
  • Provides APIs for both C and C++
  • Imports skeleton animations and skinning weights
  • Supports complex multi-layer materials
  • www.open3mod.com/ is an Open-Source viewer that is based off assimp to view models (Windows only)

[링크 : https://sourceforge.net/projects/assimp/]

 

Assimp::Importer importer;
const aiScene *scene = importer.ReadFile(filename,aiProcessPreset_TargetRealtime_Fast);
aiMesh *mesh = scene->mMeshes[0]; //assuming you only want the first mesh

float *vertexArray;
float *normalArray;
float *uvArray;

int numVerts;
next extract the data

numVerts = mesh->mNumFaces*3;

vertexArray = new float[mesh->mNumFaces*3*3];
normalArray = new float[mesh->mNumFaces*3*3];
uvArray = new float[mesh->mNumFaces*3*2];

for(unsigned int i=0;i<mesh->mNumFaces;i++)
{
    const aiFace& face = mesh->mFaces[i];

    for(int j=0;j<3;j++)
    {
        aiVector3D uv = mesh->mTextureCoords[0][face.mIndices[j]];
        memcpy(uvArray,&uv,sizeof(float)*2);
        uvArray+=2;

        aiVector3D normal = mesh->mNormals[face.mIndices[j]];
        memcpy(normalArray,&normal,sizeof(float)*3);
        normalArray+=3;

        aiVector3D pos = mesh->mVertices[face.mIndices[j]];
        memcpy(vertexArray,&pos,sizeof(float)*3);
        vertexArray+=3;
    }
}

uvArray-=mesh->mNumFaces*3*2;
normalArray-=mesh->mNumFaces*3*3;
vertexArray-=mesh->mNumFaces*3*3;

[링크 : https://nickthecoder.wordpress.com/2013/01/20/mesh-loading-with-assimp/]

    [링크 : https://stackoverflow.com/questions/35111681/make-a-model-in-blender-and-load-in-opengl]

 

'Programming > openGL' 카테고리의 다른 글

opengl glortho gluperspective  (0) 2023.08.28
glReadPixels() 와 glUseProgram()  (0) 2022.11.17
openCV + openGL  (0) 2022.02.08
glMatrixMode()  (0) 2020.04.14
opengl superbible 3rd 리눅스 빌드 패키지  (0) 2020.04.08
Posted by 구차니
Programming/C++ STL2025. 4. 22. 14:51

SDL 이라던가 여러가지가 있지만 chatGPT 에서 추천해주는 좀 쉬워보이는 녀석들 목록

 

[링크 : https://libcinder.org/]

[링크 : https://openframeworks.cc/]

'Programming > C++ STL' 카테고리의 다른 글

cpp 기본 인자 prototype  (0) 2025.03.28
cpp std::to_string(int)  (0) 2025.02.20
cpp string 끝에 한글자 지우기  (0) 2025.02.06
cpp stoi (atoi)  (0) 2025.02.06
std::string:npos  (0) 2025.02.05
Posted by 구차니
Programming/C++ STL2025. 3. 28. 12:04

디폴트 매개변수 라고 하는데

프로토타입에다가 해당 변수에 기본 값을 넣어주면 된다.

함수 선언이 아님!

 

[링크 : https://code-studies.tistory.com/32]

'Programming > C++ STL' 카테고리의 다른 글

cpp 그래픽 라이브러리  (0) 2025.04.22
cpp std::to_string(int)  (0) 2025.02.20
cpp string 끝에 한글자 지우기  (0) 2025.02.06
cpp stoi (atoi)  (0) 2025.02.06
std::string:npos  (0) 2025.02.05
Posted by 구차니
Programming/web 관련2025. 3. 5. 14:58

구버전의 javascript 라던가 python에 필요한 기능이 있을 경우 새로운 기능을 확장해주는 것을 polyfill 이라고 하는 듯.

 

In software development, a polyfill is code that implements a new standard feature of a deployment environment within an old version of that environment that does not natively support the feature. Most often, it refers to JavaScript code that implements an HTML5 or CSS web standard, either an established standard (supported by some browsers) on older browsers, or a proposed standard (not supported by any browsers) on existing browsers. Polyfills are also used in PHP and Python.

[링크 : https://en.wikipedia.org/wiki/Polyfill_(programming)]

[링크 : https://toss.tech/article/smart-polyfills]

[링크 : https://babeljs.io/docs/babel-polyfill]

'Programming > web 관련' 카테고리의 다른 글

css 캐로젤  (0) 2024.11.12
webgl + three.js를 이용한 GL 공부하기 (feat 클로드)  (0) 2024.10.18
웹 브라우저에서 웹 캠 띄우기  (0) 2024.09.24
three.js  (0) 2024.09.19
XMLHttpRequest 가로채기  (0) 2024.07.19
Posted by 구차니

좀 뜬금 없는 에러가 발생해서 멘붕(!!)

windows server 2016 / edge 86 버전이었는데 vue.js로 만든 애가 이런 에러가 나서 찾아보니

edge 92..?

Array.prototype.at()
Baseline Widely available
Array 인스턴스의 at() 메서드는 정숫값을 받아 해당 인덱스에 있는 항목을 반환하며, 양수와 음수를 사용할 수 있습니다. 음의 정수는 배열의 마지막 항목부터 거슬러 셉니다.

[링크 : https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/Array/at#browser_compatibility]

  [링크 : https://stackoverflow.com/questions/68464114/why-am-i-getting-at-is-not-a-function]

 

2025.03.04 기준 최신이 133 인것 같은데 86이면 거~~~~업나 오래 되었네 -_-

 

 

[링크 : https://en.m.wikipedia.org/wiki/Microsoft_Edge]

'Programming > javascript & HTML' 카테고리의 다른 글

js DataView()  (0) 2024.08.21
javascript ... (rest parameter)  (0) 2024.08.12
qr decoder  (0) 2024.04.19
QR decoder로 로또 추첨하기  (0) 2024.04.16
javascript 집합(set) 내용 출력하기  (0) 2024.04.16
Posted by 구차니
Programming/C++ STL2025. 2. 20. 12:32

자동 형변환(?)은 지원안하는지

문자열 끝에 "blah blah : " + value 하니 에러가 발생해서 찾아보니

std::to_string() 이라는 착한 녀석이 존재함을 발견!

 

[링크 : https://en.cppreference.com/w/cpp/string/basic_string/to_string]

[링크 : https://developer-cat.tistory.com/19]

'Programming > C++ STL' 카테고리의 다른 글

cpp 그래픽 라이브러리  (0) 2025.04.22
cpp 기본 인자 prototype  (0) 2025.03.28
cpp string 끝에 한글자 지우기  (0) 2025.02.06
cpp stoi (atoi)  (0) 2025.02.06
std::string:npos  (0) 2025.02.05
Posted by 구차니
Programming/golang2025. 2. 18. 14:27

리눅스에서 일반실행파일을 systemctl에 등록해서 실행하는것과 다르게

윈도우에서는 윈도우 서비스 api를 통해서 구동을 해야 정상적으로 구동된다.

 

일반적인 네트워크 echo 프로그램을 빌드해서 실행해보니

서비스 등록 문제 없음

서비스 실행 -> 실행중 -> 중지됨 으로 어느정도 시간이 지난후 멈춰버린다.

[링크 : https://pkg.go.dev/golang.org/x/sys/windows/svc]

 

[링크 : http://golang.site/go/article/116-윈도우즈-서비스-프로그램]

[링크 : http://www.toughman.pe.kr/2020/09/gogolang-언어로-윈도우즈-서비스-프로그램-만들기/]

'Programming > golang' 카테고리의 다른 글

golang tcp socket timeout 주기(listen, read)  (0) 2024.04.08
golang reflect  (0) 2024.02.20
golang echo i18n  (0) 2024.02.19
golang package  (0) 2024.02.19
golang html/template ParseFiles()  (0) 2024.02.16
Posted by 구차니
Programming/C++ STL2025. 2. 6. 12:36

'Programming > C++ STL' 카테고리의 다른 글

cpp 기본 인자 prototype  (0) 2025.03.28
cpp std::to_string(int)  (0) 2025.02.20
cpp stoi (atoi)  (0) 2025.02.06
std::string:npos  (0) 2025.02.05
std::istringstream  (0) 2025.01.31
Posted by 구차니
Programming/C++ STL2025. 2. 6. 12:11

std::string() 객체를 숫자로 바꾸어 주는 함수

c의 atoi 처럼 stoi stof 등이 존재한다.

 

[링크 : https://blockdmask.tistory.com/333]

[링크 : https://en.cppreference.com/w/cpp/string/basic_string/stol]

'Programming > C++ STL' 카테고리의 다른 글

cpp std::to_string(int)  (0) 2025.02.20
cpp string 끝에 한글자 지우기  (0) 2025.02.06
std::string:npos  (0) 2025.02.05
std::istringstream  (0) 2025.01.31
cpp destructor = default  (0) 2025.01.16
Posted by 구차니
Programming/C++ STL2025. 2. 5. 18:03

문자열의 끝까지를 의미하는 unsigned -1 값

std::string::find() 시에도 찾지 못하면 npos 값으로 -1을 리턴한다.

 

[링크 : https://cplusplus.com/reference/string/string/npos/]

'Programming > C++ STL' 카테고리의 다른 글

cpp string 끝에 한글자 지우기  (0) 2025.02.06
cpp stoi (atoi)  (0) 2025.02.06
std::istringstream  (0) 2025.01.31
cpp destructor = default  (0) 2025.01.16
RAII (Resource Acquisition Is Initialization)  (0) 2024.11.28
Posted by 구차니