I am hoping that someone here will have a suggestion for a problem I am having. I am working on a game in Unity and I want to load models with animations at runtime. The purpose being that we would like modders to easily be able to add their own models with animations to our game and it gives us the flexibility to add content later on without a huge update.
So far we have tried a couple gltf importers but they do not import model avatars so animations cannot be retargeted. We have looked into the other formats such as alembic and colada DAE but have had no luck with those either. Does anyone have any suggestions on approaching this problem?
Currently our thinking is to either improve the current gltf importers to import avatars or to use addressable/asset bundles to deliver the content.
Thanks in advance for any suggestions.
Related
following question:
I'm currently working on a Travel App and I thought of the idea of implementing an 3D Globe that can be rotated by the user. I thought of the Globe as a basic White Sphere with the borders of the countries visible as a stroke. All countries that have been visited should be filled with a color.
I thought of implementing it with the unity widget, but I'd like to maintain a lightweight feeling.
Is there a way to emulate js or WebGL?
What do you think is the best way to approach this?
Thank you for your time
Linus
You can use webview_flutter, I played with it a little bit to display planet models in javascript library three.js. Thanks to it you can use it like standard js instance of it with only one drawback that I didn't try to solve: I was unable to run it in browser mode as Flutter needs to emulate js itself by platform speciffic way. There is option to load js/html code from local assets but then you will not be able to load models in js directly as you will face cors policy restrictions, then the only way is to pass models as json from flutter code. It works pretty well, supports two way communication between js and flutter so you can also add events to model etc.
Nice to meet you all. Good day.
Please understand that I use a translator because I don't speak English.
What I'm currently trying to do is change the texture3D in the shader to the external texture during runtime using file input/output.
In the case of Texture2D, there is a separate Texture2D.LoadImage(byte[]), but there is no Texture3D.
If anyone knows please help me.
I'm currently developing an App in Flutter which i need to display 3D models. I know. Flutter is, at least at the moment, not the best choice (or shouldn't be even a choice) to build 3d apps but unfortunately i didn't know this when i started developing. I managed to render a simple '.obj' file with a simple engine I found on the internet:
https://levelup.gitconnected.com/a-simple-3d-engine-in-flutter-cc4a7edc943e
Now my problem:
My app needs to contain multiple hundred 3D models so I need to reduce the app's size. I experimented with openCTM to compress my '.obj' models and got a good result.
Now i want to display these '.ctm' files in my app. And thats the point where I got stuck.
I've researched for days if there's a sample or a tutorial to solve my problem but I haven't found one.
I've read the official openCTM documents and found openCtm reader ported to javascript (https://github.com/jcmellado/js-openctm) and dart (https://github.com/nelsonsilva/dart-openctm). And now I dont know where to begin.
I guess I need to, if my problem is solvable in flutter, modify the engine im currently using and add the openCTM reading part to it.
I hope that anyone of you can help me with my problem. Maybe even solved it already. Furthermore I hope I explained my problem clear enough.
If you can provide a native solution it would helpful, too.
Thank you in advance!
I've written a couple apps that are currently published in the app store. However, I'd like to start writing games that use OpenGL ES. I know how to model objects in 3D Studio Max but what I don't know is how to get my models into an OpenGL ES application on the iPhone/iPad and then manipulate those objects to create gameplay.
Can anyone point me in the right direction to get started on this?
Just to clarify...I don't mind writing code; I'm not looking for a point and click solution.
I would imagine that I'd need to export my models into some sort of format. What is that format and how do I incorporate it into a game on the iPhone/iPad?
While more involved than you're looking for, Stephen Jayna has a great writeup on how he exported textured models from LightWave in COLLADA format for use in OpenGL ES on the iPhone.
Bill Dudney had put a little effort into making a Wave Front OBJ loader for the iPhone a while back, but I think that Jeff LaMarche's project to do the same might be the farthest along.
UPDATE (8/10/2011): Jonathan Wight recently posted his TouchOpenGL code, which includes an OBJ parser.
I've used this before with some luck. However, I would say there are no easy answers to this in my experience. They all required some coding/wiring up for me.
This is a nightmare process. My past approach to this was probably not the best. I worked on PC using 3DS Max to create an exporter using MaxScript. I dumped what I needed to a text file - in a format that I just invented for my own needs as an intermediate.
I then switched to Mac and wrote a command line tool that used NSFoundation to read this text file and convert it to a binary format that was optimized for my opengl renderer. This is okay for basic and static meshes. But I had hell exporting animated figures that used keyframed skelaton animations (the maths for that stuff is intense).
This did work, but I really think that I took the hardest approach.
I didn't really know how to phrase the title of my questions, so my apologies in advance. I read through parts of the MEF documentation to try to find the answer to my question, but couldn't find it.
I'm using ImportMany to allow MEF to create multiple instances of a specific plugin. That plugin Imports several parts, and within calls to a specific instance, it wants these Imports to be singletons. However, what I don't want is for all instances of this plugin to use the same singleton.
For example, let's say my application ImportManys Blender appliances. Every time I ask for one, I want a different Blender. However, each Blender Imports a ControlPanel. I want each Blender to have its own ControlPanel. To make things a little more interesting, each Blender can load BlendPrograms, which are also contained within their own assemblies, and MEF takes care of this loading. A BlendProgram might need to access the ControlPanel to get the speed, but I want to ensure that it is accessing the correct ControlPanel (i.e. the one that is associated with the Blender that is associated with the program!)
This diagram might clear things up a little bit:
As the note shows, I believe that the confusion could come from an inherently-poor design. The BlendProgram shouldn't touch the ControlPanel directly, and instead perhaps the BlendProgram should get the speed via the Blender, which will then delegate the request to its ControlPanel.
If this is the case, then I assume the BlendProgram needs to have a reference to a specific Blender. In order to do this, is the right way to leverage MEF and use an ImportingConstructor for BlendProgram, i.e.
[ImportingConstructor]
public class BlendProgram : IBlendProgram
{
public BlendProgram( Blender blender) {}
}
And if this is the case, how do I know that MEF will use the intended Blender plugin?
You should break it as mentioned. Expose your control panel through your blender as you say. If you really want to keep your current design, you'll have to decorate the import with metadata and make a custom export provider that will use this metadata to determine what export it should use. If you can get rid of this extra step, do it.