-
-
Notifications
You must be signed in to change notification settings - Fork 391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
obj and mtl importing #363
Comments
Hey, @jyy1082 , sorry for delayed answer. Importing objconst object = new WHS.Importer({
loader: new THREE.OBJLoader(), // you need to provide obj loader there
// ...
}); Importing mtlYou may write your own module, which can be reusable then, but the simplest way is to use three-mtl-loader and then: mtlLoader.load('model.mtl', function(matl) {
const object = new WHS.Importer({
material: matl
// ...
});
// ...
}); And the final stage, add this to app: object.addTo(app); |
Hi, |
multiple obj files, right?
…On Wed, Dec 27, 2017 at 8:20 PM jyy1082 ***@***.***> wrote:
Hi,
Thanks for your replay!
My obj and mtl files are for one model. Can I import them together as a
object using one WHS.Importer?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#363 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHTX1XTFSSHPdFDxae5vR1d0Husnf1BGks5tEoppgaJpZM4RL3GU>
.
|
I mean one obj and one mtl files together for one model. https://www.learnthreejs.com/load-3d-model-using-three-js-obj-loader/ This is the way to use THREEJS to implement. How should I use WHS to do that? Thanks. |
@jyy1082 See the code above, it's pretty similar with what you need |
I will try it. Thanks again! |
does it work @jyy1082 ? |
I'm also struggling a bit with this.
However, when doing the 'same' thing with WHS Importer:
I got an error in a three.module.js codebase Currently I'm using the vanilla approach but would like how to integrate better with WhiteStorm. |
@antoniocapelo, since you’ve moved to OBJLoader, your parser() accept other arguments. In three.js you have: parser arguments: Should look like this: parser(object) {
return parser;
} |
parser(object) {
return object;
} Correct one. (made a typo in my prev msg) |
Sorry for the delay @sasha240100 ! I tried what you described and it does work (not when loading the Thanks! |
@sasha240100 I am once again volunteering myself to create a more permanent module for loading these models in (unless someone's already done it?). |
I could share MTLModule source with you and maybe we could easily combine
it with obj
…On Fri, Mar 2, 2018 at 4:41 PM Noah ***@***.***> wrote:
@sasha240100 <https://github.com/sasha240100> I am once again
volunteering myself to create a more permanent module for loading these
models in (unless someone's already done it?).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#363 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHTX1X4mT_vSZplmzAPawJyC-TiQtmXDks5taVolgaJpZM4RL3GU>
.
|
Yeah, that sounds great! Where's the source? |
@thecodecrafter Sorry for late response. I wasn't able to find the source code (probably lost it because of not using git for that project). I could help you in development, just point me |
Ok, I will try to remember to do this in the near future. My programming world is a hellish nightmare of projects (abandoned and current) everywhere right now. Will return when ready, sir! ;) |
This issue should be closed as it looks solved |
Agreed @zardilior but it would be nice to add an example to illustrate how to do it, anyone volunteers to add a simple example? |
I'm unable to at the moment, as I'm super busy with school. I'll get back to you during late December! |
Does whs.js support to import obj and mtl files with image resource? If yes, is there anyone can guide me how to use WHS.Importer to add those into WHS.App?
Thank you!
Version:
Issue type:
Desktop
The text was updated successfully, but these errors were encountered: