three.js - 把场景放在div中

时间:2018-03-05 19:49:08

标签: css three.js cdn

我一直在寻找答案,但似乎无法让它适用于这个特定的场景。

https://codepen.io/rkimo/pen/vdwxJj

基本上我只想在div中使用这个blob,这样我就可以在前后放置内容并且可以滚动它。

如果它更容易,我不需要具有滚动放大和缩小blob的功能。

提前致谢

#blobcontainer {
  background:pink;
height:300px;
}




html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {
    display: block;
}
body {
    line-height: 1;
}
ol, ul {
    list-style: none;
}
blockquote, q {
    quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
    content: '';
    content: none;
}
table {
    border-collapse: collapse;
    border-spacing: 0;
}.container {
  height: 100vh;
  width: 100vw;
}
canvas {
  position: absolute;
  background: #1f1d26;
  width: 100%; height: 100%;
}

1 个答案:

答案 0 :(得分:0)

不要实现函数def main(args: Array[String]): Unit = { val countries: Seq[Country] = ??? sort(countries)(Country.byNameOrdering) } ,因此滚动你的three.js场景对three.js没有任何影响,它应该继续滚动页面:

handleMouseWheel