Comments (5)
Hey Nick!
I had an issue as well before rendering wireframes, and if I recall correctly, it was because the "lineWidth" function was not implemented. Despite the width always being 1, THREE.js still tries to call it from the JavaScript each time it renders a frame. So because of that, you're seeing the "Failure in file ... windowelement.cpp". It's possible to get more descriptive error messages by modifying the JsCallFunction and JsRunScript calls (here's a sample with exception handling).
Below is what I done to implement the lineWidth function. It's basically a copy and paste of the other functions just changing the name to lineWidth and calling the glLineWidth function in the actual implementation.
WebGL.js
this.lineWidth = function (width) {
return nativeInterface.webgl.lineWidth(this.glContext, width);
};
WebGLProjections.cpp
RETURN_IF_FALSE(ScriptHostUtilities::ProjectFunction(L"lineWidth", L"webgl", lineWidth));
JsValueRef
CHAKRA_CALLBACK
WebGLProjections::lineWidth(
JsValueRef callee,
bool isConstructCall,
JsValueRef* arguments,
unsigned short argumentCount,
PVOID callbackData
)
{
RETURN_INVALID_REF_IF_FALSE(argumentCount == 3);
WebGLRenderingContext* context = ScriptResourceTracker::ExternalToObject<WebGLRenderingContext>(arguments[1]);
RETURN_INVALID_REF_IF_NULL(context);
GLfloat width = ScriptHostUtilities::GLfloatFromJsRef(arguments[2]);
context->lineWidth(width);
return JS_INVALID_REFERENCE;
}
WebGLProjections.h
static JsValueRef CHAKRA_CALLBACK lineWidth(
JsValueRef callee,
bool isConstructCall,
JsValueRef* arguments,
unsigned short argumentCount,
PVOID callbackData
);
WebGLRenderingContext.cpp
void WebGLRenderingContext::lineWidth(GLfloat width) {
glLineWidth(width);
}
WebGLRenderingContext.h
void lineWidth(GLfloat width);
Hope this helps!
from holojs.
@PepsRyuu Thank you for the fix! It would be great to merge this into the master branch. Do you want to submit a pull request for it? Alternatively I could merge the fix myself.
from holojs.
@Almost-Done I don't mind writing a few pull requests, just wasn't sure if the project was still alive! There was a few things I wanted to contribute (proper error logging, mapping surface data to JS, and other various bug fixes). Some of these were based on issue #24. There's huge potential for this project as a platform, so if I get a chance I'll see what I can do. :)
from holojs.
@Almost-Done @PepsRyuu Great to see life in this thread! Personally, error logging would be a great step forward, I'm sure along with @PepsRyuu other intended contributions. Would love to come back around to building with HoloJS. Agree that there's potential for this project as a platform.
from holojs.
I created a PR with Paul's code from above to resolve this issue.
from holojs.
Related Issues (20)
- Spatial Understanding HOT 4
- OpenGL and EGL includes are not found when trying to build the solution. HOT 3
- Release mode HOT 2
- Access violation when accessing HoloLens camera HOT 3
- Windows Universal Runtime version 10.0.16299.0 HOT 1
- Spatial anchor read access violation HOT 2
- XmlHttpRequest exception when remote HTTP server is not online HOT 1
- Repetitive Object load causing memory leak HOT 1
- HTTP Requests within HoloJS?!?! HOT 3
- Different Origin when Space was lost for a moment
- Windows 10 build 17720 breaks HoloJs Spatial Input HOT 2
- FPS drops when calling dispose() in requestAnimationFrame()
- Is there a possibility to use Three GLTFLoader? HOT 2
- It There a way to check voice without specifying commands? HOT 4
- How to use video texture in HoloJS ?
- Access to RGB camera using Spin app HOT 5
- Immersive Mode
- Sample projects unresponsive to gestures. HOT 2
- HoloJS with HoloLens 2 HOT 7
- This repo is missing important files HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from holojs.