Trying to add a cubemap using the PC Engine/API.
Found this…
… and copied the HMTL/CSS/JS to my own Dreamweaver project.
It works.
The problem is when I try to load the assets locally or otherwise. I downloaded the assets used in this example and I downloaded a fresh skybox w/ assets directly from PlayCanvas. In both cases the skybox won’t appear. I also tried putting the assets on my server and loading from there…still didn’t work. The only assets that work are coming from the server referenced in the CodePen code.
The error that pops up in the console is:
RangeError: attempting to construct out-of-bounds TypedArray on ArrayBuffer
So in summary this code works:
var data = {
name: ‘forest’,
cubemap: ‘http://7ktuvf.com1.z0.glb.clouddn.com/test/1.dds’,
textures: [
‘http://7ktuvf.com1.z0.glb.clouddn.com/test/2.png’,
‘http://7ktuvf.com1.z0.glb.clouddn.com/test/3.png’,
‘http://7ktuvf.com1.z0.glb.clouddn.com/test/4.png’,
‘http://7ktuvf.com1.z0.glb.clouddn.com/test/5.png’,
‘http://7ktuvf.com1.z0.glb.clouddn.com/test/6.png’,
‘http://7ktuvf.com1.z0.glb.clouddn.com/test/7.png’
]
};
This code doesn’t work:
var data = {
name: ‘forest’,
cubemap: ‘…/cubemaps/forest/1.dds’,
textures: [
‘…/cubemaps/forest/2.png’,
‘…/cubemaps/forest/3.png’,
‘…/cubemaps/forest/4.png’,
‘…/cubemaps/forest/5.png’,
‘…/cubemaps/forest/6.png’,
‘…/cubemaps/forest/7.png’
]
};
Full code is in the next post. Been banging my head on this for hours…anybody have an idea what is going on?
Thanks,
Joe H.
P.S. Thought it might be the crossOrigin deal causing the problem but if I remove that line of code it still doesn’t work