Closed MilanRadon closed 4 years ago
You need to put whatever client-side JS application you want to run (BIMvie.ws, BIMsurfer etc...) on an actual webserver. Running from disk almost never works, which is a generic problem, not specific to BIMserver.
In demo data not working BIMSurfer.
-How to run BIMSurfer repository or BIMvie alone (no on jar) and connect to java BIMServer? I have problem with CORS with file dev.js -error: dev.html:1 Access to script at 'file:///Users/aa/BIMsurfer-master/output/bimviews-%25VERSION%25/apps/dev.js' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https. dev.html:41 GET file:///Users/ff/BIMsurfer-master/output/bimviews-%25VERSION%25/apps/dev.js net::ERR_FAILED
-error after load demo data on bim surfer. on bim vie worked: `Missing uniform location objectColor
precision mediump int; precision mediump float;
ifdef WITH_QUANTIZEVERTICES
uniform mat4 vertexQuantizationMatrix; in ivec3 vertexPosition;
else
in vec3 vertexPosition;
endif
ifdef WITH_LINEPRIMITIVES
ifdef WITH_QUANTIZEVERTICES
in ivec3 nextVertexPosition;
else
in vec3 nextVertexPosition;
endif
in float direction;
endif
ifndef WITH_PICKING
ifndef WITH_LINES
ifdef WITH_QUANTIZENORMALS
ifdef WITH_OCT_ENCODE_NORMALS
in ivec2 vertexNormal;
else
in ivec3 vertexNormal;
endif
else
in vec3 vertexNormal;
endif
endif
endif
ifndef WITH_USEOBJECTCOLORS
ifndef WITH_PICKING
ifndef WITH_LINES
ifdef WITH_QUANTIZECOLORS
in uvec4 vertexColor;
else
in vec4 vertexColor;
endif
endif
endif
endif
ifdef WITH_INSTANCING
in mat4 instanceMatrices; uniform uint numContainedInstances; uniform uint containedInstances[256]; uniform uint containedMeansHidden;
ifndef WITH_PICKING
ifndef WITH_LINES
in mat3 instanceNormalMatrices;
endif
endif
endif
ifdef WITH_PICKING
ifdef WITH_INSTANCING
in uvec4 instancePickColors;
else
in uvec4 vertexPickColor;
endif
flat out uvec4 color;
else
uniform LightData { vec3 dir; vec3 color; vec3 ambientColor; float intensity; } lightData;
out vec4 color;
endif
ifdef WITH_USEOBJECTCOLORS
uniform vec4 objectColor;
endif
ifdef WITH_LINEPRIMITIVES
uniform vec4 inputColor; uniform mat4 matrix; uniform float aspect; uniform float thickness;
else
ifndef WITH_LINES
uniform mat3 viewNormalMatrix;
endif
endif
uniform mat4 projectionMatrix; uniform mat4 viewMatrix; uniform vec3 postProcessingTranslation;
out vec3 worldCoords;
vec3 octDecode(vec2 oct) { vec3 v = vec3(oct.xy, 1.0 - abs(oct.x) - abs(oct.y)); if (v.z < 0.0) { v.xy = (1.0 - abs(v.yx)) * vec2(v.x >= 0.0 ? 1.0 : -1.0, v.y >= 0.0 ? 1.0 : -1.0); } return normalize(v); }
void main(void) {
ifndef WITH_INSTANCING
endif
ifndef WITH_PICKING
ifndef WITH_LINES
ifdef WITH_QUANTIZENORMALS
ifdef WITH_OCT_ENCODE_NORMALS
else
// floatNormal = vec3(0.0, 0.0, 1.0);
endif
else
endif
endif
endif
ifdef WITH_USEOBJECTCOLORS
else
ifndef WITH_PICKING
ifndef WITH_LINES
ifdef WITH_QUANTIZECOLORS
else
endif
endif
endif
endif
ifdef WITH_INSTANCING
ifndef WITH_PICKING
ifndef WITH_LINES
endif
endif
endif
ifdef WITH_LINEPRIMITIVES
ifdef WITH_QUANTIZEVERTICES
else
endif
else
ifdef WITH_INSTANCING
endif
ifdef WITH_PICKING
ifdef WITH_INSTANCING
else
endif
else
ifdef WITH_LINES
else
// float lambert1 = abs(dot(floatNormal, normalize(lightData.dir))); float lambert2 = max(dot(-viewNormal, normalize(lightData.dir)), 0.0); // color = vec4((lambert1 0.85 + lambert2 0.2 + 0.3) floatColor.rgb, floatColor.a); color = vec4((lambert2 0.7 + 0.3) * floatColor.rgb, floatColor.a); // color = floatColor;
endif
endif
endif
} Object (anonymous) @ programmanager.js:254 programmanager.js:254 Missing uniform location objectColor
precision mediump int; precision mediump float;
ifdef WITH_QUANTIZEVERTICES
uniform mat4 vertexQuantizationMatrix; in ivec3 vertexPosition;
else
in vec3 vertexPosition;
endif
ifdef WITH_LINEPRIMITIVES
ifdef WITH_QUANTIZEVERTICES
in ivec3 nextVertexPosition;
else
in vec3 nextVertexPosition;
endif
in float direction;
endif
ifndef WITH_PICKING
ifndef WITH_LINES
ifdef WITH_QUANTIZENORMALS
ifdef WITH_OCT_ENCODE_NORMALS
in ivec2 vertexNormal;
else
in ivec3 vertexNormal;
endif
else
in vec3 vertexNormal;
endif
endif
endif
ifndef WITH_USEOBJECTCOLORS
ifndef WITH_PICKING
ifndef WITH_LINES
ifdef WITH_QUANTIZECOLORS
in uvec4 vertexColor;
else
in vec4 vertexColor;
endif
endif
endif
endif
ifdef WITH_INSTANCING
in mat4 instanceMatrices; uniform uint numContainedInstances; uniform uint containedInstances[256]; uniform uint containedMeansHidden;
ifndef WITH_PICKING
ifndef WITH_LINES
in mat3 instanceNormalMatrices;
endif
endif
endif
ifdef WITH_PICKING
ifdef WITH_INSTANCING
in uvec4 instancePickColors;
else
in uvec4 vertexPickColor;
endif
flat out uvec4 color;
else
uniform LightData { vec3 dir; vec3 color; vec3 ambientColor; float intensity; } lightData;
out vec4 color;
endif
ifdef WITH_USEOBJECTCOLORS
uniform vec4 objectColor;
endif
ifdef WITH_LINEPRIMITIVES
uniform vec4 inputColor; uniform mat4 matrix; uniform float aspect; uniform float thickness;
else
ifndef WITH_LINES
uniform mat3 viewNormalMatrix;
endif
endif
uniform mat4 projectionMatrix; uniform mat4 viewMatrix; uniform vec3 postProcessingTranslation;
out vec3 worldCoords;
vec3 octDecode(vec2 oct) { vec3 v = vec3(oct.xy, 1.0 - abs(oct.x) - abs(oct.y)); if (v.z < 0.0) { v.xy = (1.0 - abs(v.yx)) * vec2(v.x >= 0.0 ? 1.0 : -1.0, v.y >= 0.0 ? 1.0 : -1.0); } return normalize(v); }
void main(void) {
ifndef WITH_INSTANCING
endif
ifndef WITH_PICKING
ifndef WITH_LINES
ifdef WITH_QUANTIZENORMALS
ifdef WITH_OCT_ENCODE_NORMALS
else
// floatNormal = vec3(0.0, 0.0, 1.0);
endif
else
endif
endif
endif
ifdef WITH_USEOBJECTCOLORS
else
ifndef WITH_PICKING
ifndef WITH_LINES
ifdef WITH_QUANTIZECOLORS
else
endif
endif
endif
endif
ifdef WITH_INSTANCING
ifndef WITH_PICKING
ifndef WITH_LINES
endif
endif
endif
ifdef WITH_LINEPRIMITIVES
ifdef WITH_QUANTIZEVERTICES
else
endif
else
ifdef WITH_INSTANCING
endif
ifdef WITH_PICKING
ifdef WITH_INSTANCING
else
endif
else
ifdef WITH_LINES
else
// float lambert1 = abs(dot(floatNormal, normalize(lightData.dir))); float lambert2 = max(dot(-viewNormal, normalize(lightData.dir)), 0.0); // color = vec4((lambert1 0.85 + lambert2 0.2 + 0.3) floatColor.rgb, floatColor.a); color = vec4((lambert2 0.7 + 0.3) * floatColor.rgb, floatColor.a); // color = floatColor;
endif
endif
endif
} Object (anonymous) @ programmanager.js:254 datainputstream.js:66 Uncaught RangeError: Offset is outside the bounds of the DataView at DataView.getInt32 ()
at DataInputStream.readInt (datainputstream.js:66)
at BimserverGeometryLoader.readObject (geometryloader.js:531)
at BimserverGeometryLoader.processMessage (geometryloader.js:383)
at BimserverGeometryLoader.binaryDataListener (geometryloader.js:406)
at bimservergeometryloader.js:41
at BimServerClient.processNotification (bimserverclient.js:212)
at BimServerApiWebSocket._onmessage (bimserverapiwebsocket.js:108)
geometryloader.js:709 Data does not start with BGS ()
readStart @ geometryloader.js:709
geometryloader.js:107 Uncaught TypeError: Cannot read property 'nrIndices' of undefined
at BimserverGeometryLoader.processPreparedBuffer (geometryloader.js:107)
at BimserverGeometryLoader.readObject (geometryloader.js:557)
at BimserverGeometryLoader.processMessage (geometryloader.js:383)
at BimserverGeometryLoader.binaryDataListener (geometryloader.js:406)
at bimservergeometryloader.js:41
at BimServerClient.processNotification (bimserverclient.js:212)
at BimServerApiWebSocket._onmessage (bimserverapiwebsocket.js:108)
renderlayer.js:298 Uncaught TypeError: Cannot read property '0' of undefined
at DefaultRenderLayer.storeMissingGeometry (renderlayer.js:298)
at BimserverGeometryLoader.endOfStream (geometryloader.js:392)
at BimserverGeometryLoader.endOfStream (bimservergeometryloader.js:49)
at BimserverGeometryLoader.binaryDataListener (geometryloader.js:410)
at bimservergeometryloader.js:41
at BimServerClient.processNotification (bimserverclient.js:212)
at BimServerApiWebSocket._onmessage (bimserverapiwebsocket.js:108)`
How to run BIMSurfer repository or BIMvie alone (no on jar) and connect to BIMServer? I have problem with CORS with file dev.js