it-source

OpenGL에서 4D 객체 시각화

criticalcode 2023. 10. 3. 09:53
반응형

OpenGL에서 4D 객체 시각화

문 닫았습니다.이 질문은 책, 도구, 소프트웨어 라이브러리 등에 대한 권장 사항을 찾고 있습니다.충족되지 않습니다.스택 오버플로 지침.현재 답변을 받지 않고 있습니다.

책, 도구, 소프트웨어 라이브러리 등에 대한 추천을 구하는 질문은 허용하지 않습니다.질문을 편집하여 사실과 인용으로 답변할 수 있습니다.

preprocessors: {
    'directives/loading/templates/loading.html': 'ng-html2js'
},

files: [
    ...
    'directives/loading/templates/loading.html',
]

ngHtml2JsPreprocessor: {
    prependPrefix: '/app/'
},

7년전에 문을 닫았습니다.

...
templateUrl: '/app/directives/loading/templates/loading.html'
...

이 질문을 개선합니다.

describe('Loading directive', function() {
    ...
    beforeEach(module('/app/directives/loading/templates/loading.html'));
    ...
});

적극적으로 개발된 C/C++ 라이브러리 중에 임의의 "4D 카메라" 프로젝션 행렬에 대해 3D 공간에 다시 투영하고 하드웨어 가속 시각화를 위해 OpenGL에 입력할 수 있는 정규 3D 정점을 출력할 수 있는 것이 있습니까?또한 4D 공간에서 표준 변환을 수행할 수 있는 능력이 필요합니다(번역, 4축 모두 회전 및 균일한 스케일링).

(저는 그 주제에 대해 전문가가 결코 아니기 때문에) 다음은 서투른 대답이지만, 저는 잠깐 둘러보기로 결정하고 이 논문을 생각해냈습니다: http://steve.hollasch.net/thesis/ # chapter4

3-공간으로의 4D 객체 투영은 예상대로 2-공간으로의 3D 투영에 대한 단순한 확장이며, 위 논문은 4D에서 2-공간으로의 다른 종류의 투영을 보여줍니다.코드 샘플은 C에 있으므로 쉽게 따라 할 수 있을 것입니다.

angular.module('/app/directives/loading/templates/loading.html', []).run(function($templateCache) {
    $templateCache.put('/app/directives/loading/templates/loading.html',
        '<div ng-hide="hideLoading" class="loading_panel">\n' +
        '   <div class="center">\n' +
        '       <div class="content">\n' +
        '           <span ng-transclude></span>\n' +
        '           <canvas width="32" height="32"></canvas>\n' +
        '       </div>\n' +
        '   </div>\n' +
    '</div>');
});

Andrew Hanson 교수 (인디애나 대학)는 4D 기하학을 시각화하기 위한 그래픽 라이브러리를 개발했습니다.GL4D라고 합니다.이것은 OpenGL의 느낌을 모방하도록 설계되었습니다(실제로 OpenGL 위에 만들어졌는지는 잘 모르겠습니다).이것은 GPU 가속화 되어있습니다.투영, 슬라이싱, 숨겨진 표면 제거, 상자당 조명 및 반투명 쉐이딩을 지원합니다.

GL4D를 설명하는 출판물은 다음과 같습니다. GL4D paper

여기 소스 코드에 대한 링크가 있습니다: GL4D 소스 코드

여기 GL4D의 비디오 데모가 있습니다. GL4D 비디오 데모가 있습니다.

      /correct/path/to/the/app/directives/loading/templates/loading.html.js

언급URL : https://stackoverflow.com/questions/6988686/visualising-4d-objects-in-opengl

Thanks,

문제는 다음에 지정된 상대 경로일 수 있습니다.file섹션을 전체 섹션으로 확장합니다.

뭐 이런 거.directives/loading/templates/loading.html=>/home/joe/project/angular-app/directives/loading/templates/loading.html

... and then, templates get registered with theirs full paths.

The solution is to configure the ng-html2js preprocessor to remove the absolute part of the template paths. For instance, in the karma.conf.js file add the stripPrefix directive like this :

ngHtml2JsPreprocessor: {
    // strip this from the file path
    stripPrefix: '.*/project/angular-app/'
    prependPrefix: '/app/'
}

Note that stripPrefix is a regexp.

You can have the pre-processor cache your templates to a module, which can then be included prior to your tests:

karma.conf.js

files: [
  ...
  'app/**/*.html'
],

preprocessors: {
  'app/**/*.html': ['ng-html2js']
},

ngHtml2JsPreprocessor: {
   moduleName: 'templates'
},

directive file

...
templateUrl: 'app/path-to-your/template.html',
...

spec file

describe('My directive', function() {

  beforeEach(module('templates'));
  ...
});

This may not be your exact issue, but in our application we needed to add the following to karma.conf.js:

ngHtml2JsPreprocessor: {
    cacheIdFromPath: function(filepath) {
        return '/vision/assets/' + filepath;
    }
}

The corresponding preprocessors setting looks like:

preprocessors: {
    'views/**/*.html': 'html2js'
},

My understanding was that this was due to using absolute URLs in AngularJS when specifying templates - which karma was rewriting when running tests?

Anyway hope this helps.

I'm in the process of learning AngularJS and ran into the same problem. I have no idea why but changing the port in karma.conf.js fixed it for me.

module.exports = function(config){
  config.set({

    ...

    port: 9877,

    ...

  });
};

Edit:

After a bit more testing I found that the problem was only happening on Chrome, and was resolved by explicitly clearing all of the browser history (Ctrl + F5 didn't work).

언급URL : https://stackoverflow.com/questions/19360083/angularjs-karma-ng-html2js-failed-to-instantiate-module-html

반응형