[英]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.