简体   繁体   English

能够使用所有opengl库为Webgl开发应用程序的最有效方法是什么?

[英]what is the most effective way to be able to use all opengl libraries developing application for webgl?

i need to use some physics library for example bulletphysics in C++ in a physics simulation application. 我需要在物理模拟应用程序中使用一些物理库,例如C ++中的Bulletphysics。 there is a restricton that i must use webgl and javascript. 有一个限制,我必须使用webgl和javascript。 i googled and saw using emscripten, some libs has been ported to javascript but some people say that code uses too much cpu and memory and is not effective. 我用谷歌搜索并看到使用emscripten,一些库已被移植到javascript,但是有人说代码使用了太多的cpu和内存,效果不佳。 also i searched for a way to develop code in c++ and port it to javascript, i found out emscripten but have given up because of inefficiency. 我也寻找一种方法来开发C ++代码并将其移植到javascript,我发现了emscripten,但是由于效率低下而放弃了。 also i found mandreel but it is not free and i need a free way at first plan. 我也找到了mandreel,但它不是免费的,我在第一个计划中需要一种免费的方式。 at this point i want to ask how can i use opengl libs that i need through webgl by the most effective way? 在这一点上,我想问一下如何以最有效的方式使用通过webgl所需的opengl库? thanks 谢谢

Most physics simulation libraries are tailored for compilation into native code, some may even use assembly at some time critical parts. 大多数物理仿真库都是为编译为本地代码而量身定制的,有些甚至可能在某些关键时刻使用汇编。 So porting that to JavaScript will be very hard. 因此,将其移植到JavaScript将非常困难。 I think the best thing to do, and in your case since it's home what what's probably expected is, that you write the stuff in JavaScript directly. 我认为最好的做法是,您应该直接用JavaScript编写内容,并且就您的情况而言,这可能是您的预期。

And just to get this clear: OpenGL just draws stuff. 为了清楚起见:OpenGL只是绘制东西。 It's not a game or simulation framework. 它不是游戏或模拟框架。 Bullet Physics is not OpenGL, ODE is not OpenGL. Bullet Physics不是OpenGL,ODE不是OpenGL。 Just because most programs that use Bullet or ODE render stuff, this does not imply that this has something to do with OpenGL in the first place. 仅仅因为大多数使用Bullet或ODE的程序都会渲染东西,但这并不意味着它首先与OpenGL有关。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 最有效的方式使用OpenGL进行2D游戏? - Most efficient way to use OpenGL for 2d games? 在WebGL中查找RGBA浮动纹理的最小值和最大值的最有效方法是什么? - What's the most efficient way in WebGL to find the min and max values of an RGBA float texture? 什么是 OpenGL 和 WebGL2 中的顶点数组? - What are Vertex Arrays in OpenGL & WebGL2? webgl和opengl es有什么区别? - What is the difference between webgl and opengl es? 一般来说,WebGL / OpenGL中属性的非平凡用例有哪些? - What are the non-trivial use-cases of attributes in WebGL/OpenGL in general? 对于opengl(webgl),png或jpeg是最合适的文件格式吗? - for opengl (webgl) is png or jpeg the most suitable file format? 在 WebGL 或 OpenGL 中,使用 output 片段变量作为临时存储是否不好? - In WebGL or OpenGL is it bad to use an output fragment variable as temp storage? webGL / openGL中多个2D点光源的性能最高的方法? [动态灯] - Most performant method for multiple 2D point-lights in webGL/openGL ? [Dynamic lights] 我们可以在Android的OpenGL ES 1.0上使用Freetype Text吗? 有什么方法可以只使用库而不是使用NDK吗? - Can we use Freetype Text on OpenGL ES 1.0 in Android? Is there any way to use it with just libraries instead of using NDK? WebGL / OpenGL:比较性能 - WebGL/OpenGL: comparing the performance
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM