clean up quickstart project
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:thermion_flutter/thermion_flutter.dart';
|
||||||
|
|
||||||
|
import 'package:vector_math/vector_math_64.dart' as v;
|
||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:thermion_flutter/thermion/widgets/thermion_widget.dart';
|
|
||||||
import 'package:thermion_flutter/thermion_flutter.dart';
|
|
||||||
import 'package:vector_math/vector_math_64.dart' as v;
|
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
runApp(const MyApp());
|
runApp(const MyApp());
|
||||||
@@ -49,25 +49,26 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Stack(children: [
|
return Stack(children: [
|
||||||
Positioned.fill(child: ThermionWidget(plugin: _thermionFlutterPlugin)),
|
Positioned.fill(child: ThermionWidget(plugin: _thermionFlutterPlugin)),
|
||||||
if(_loaded)
|
if (!_loaded)
|
||||||
Center(
|
Center(
|
||||||
child: ElevatedButton(
|
child: ElevatedButton(
|
||||||
child: const Text("Load"),
|
child: const Text("Load"),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
var viewer = await _thermionViewer;
|
var viewer = await _thermionViewer;
|
||||||
await viewer.loadSkybox("assets/default_env_skybox.ktx");
|
await viewer.loadSkybox("assets/default_env_skybox.ktx");
|
||||||
await viewer.loadGlb("assets/cube.glb");
|
await viewer.loadGlb("assets/cube.glb");
|
||||||
|
|
||||||
await viewer.setCameraPosition(0, 1, 10);
|
await viewer.setCameraPosition(0, 1, 10);
|
||||||
await viewer.setCameraRotation(v.Quaternion.axisAngle(
|
await viewer.setCameraRotation(v.Quaternion.axisAngle(
|
||||||
v.Vector3(1, 0, 0), -30 / 180 * pi) *
|
v.Vector3(1, 0, 0), -30 / 180 * pi) *
|
||||||
v.Quaternion.axisAngle(v.Vector3(0, 1, 0), 15 / 180 * pi));
|
v.Quaternion.axisAngle(
|
||||||
await viewer.addLight(
|
v.Vector3(0, 1, 0), 15 / 180 * pi));
|
||||||
LightType.SUN, 7500, 50000, 0, 0, 0, 1, -1, -1);
|
await viewer.addLight(
|
||||||
await viewer.setRendering(true);
|
LightType.SUN, 7500, 50000, 0, 0, 0, 1, -1, -1);
|
||||||
_loaded = true;
|
await viewer.setRendering(true);
|
||||||
setState(() {});
|
_loaded = true;
|
||||||
}))
|
setState(() {});
|
||||||
|
}))
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user