Gio.js Hello World
With Threejs and Giojs included in your webpage, you are ready to create your first Gio Globe. We will
start off by creating a globe in basic style.
1. Create a <div> where the globe will be rendered.
<div id="globeArea" style="width: 200px; height: 200px"></div>
2. Add the following code snippet to the body of you html page.
<script>
$(function () {
// Get
the container to hold the IO globe
var
container = document.getElementById( "globalArea" );
//
Create Gio.controller
var
controller = new GIO.Controller( container );
// Add
data
controller.addData(
data );
//
Initialize and render the globe
controller.init();
});
</script>
Tip: We can also use JQuery or onReady handler to load data.
3. Now you should be able to see the 3D globe on your webpage like this
4. Try it on codepen:
See the Pen Giojs Hello World by
syt123450 (@syt123450) on CodePen.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论