2013-10-03 3 views
0

three.dart 프레임 워크를 사용하여 간단한 프로젝트를 개발했습니다. 웹 페이지를 시작하고 확인합니다. 그러나 3-5 초 후에 알 수없는 오류로 인해 충돌합니다.Three.dart "Hello World"프로젝트에서 크래시

import 'dart:html'; 
import 'dart:math' as Math; 
import 'package:three/three.dart'; 

class MyClass { 
    Element container; 
    PerspectiveCamera camera; 
    Scene scene; 
    CanvasRenderer renderer; 
    Mesh plane; 
    num targetRotation; 
    num targetRotationOnMouseDown; 
    num windowHalfX; 
    num windowHalfY; 
    var evtSubscriptions = []; 

    void run() { 
    init(); 
    animate(0); 
    } 

    void init() { 
    targetRotation = 0; 
    targetRotationOnMouseDown = 0; 
    windowHalfX = window.innerWidth/2; 
    windowHalfY = window.innerHeight/2; 
    container = new Element.tag('div'); 
    document.body.nodes.add(container); 
    Element info = new Element.tag('div'); 
    info.style.position = 'absolute'; 
    info.style.top = '10px'; 
    info.style.width = '100%'; 
    info.style.textAlign = 'center'; 
    info.innerHtml = 'Drag to spin the cube'; 
    container.nodes.add(info); 

    scene = new Scene(); 
    camera = new PerspectiveCamera(70.0, window.innerWidth/window.innerHeight, 1.0, 1000.0); 
    camera.position.y = 150.0; 
    camera.position.z = 500.0; 
    scene.add(camera); 

    // Plane 
    plane = new Mesh(new PlaneGeometry(200.0, 200.0), null); 
    scene.add(plane); 

    renderer = new CanvasRenderer(); 
    renderer.setSize(window.innerWidth, window.innerHeight); 
    container.nodes.add(renderer.domElement); 
} 

void render() { 
    renderer.render(scene, camera); 
    } 

animate(num time) { 
    window.requestAnimationFrame(animate); 
    render(); 
    } 
} 

void main() { 
    new Canvas_Geometry_Cube().run(); 
} 

어떻게 충돌을 해결하기 위해 : 그것은

여기

추락 이유를 표시하지 않습니다 다트 편집기와 브라우저는 코드?

+1

코드가있는 버그를 https://github.com/threeDart/three.dart/issues에 보내주십시오. –

답변

1

이 문제점을 발견했습니다. 웹 GL과 제대로 작동합니다 (캔버스가 아님).

0

Sergio three.dart는 최신 버전이 출판 된 이후 잠시 동안 업데이트해야 할 작업이 필요할 수 있습니다. 죄송합니다. https://github.com/threeDart/three.dart 사이트의 최신 지점 또는 코드 리뷰를 확인하십시오.

+0

"최신"지점을 사용합니다. – Sergio