Skip to content
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

How can I reload/update/change .obj model? #72

Closed
Jedi19871109 opened this issue Oct 8, 2018 · 2 comments
Closed

How can I reload/update/change .obj model? #72

Jedi19871109 opened this issue Oct 8, 2018 · 2 comments

Comments

@Jedi19871109
Copy link

Hi Awe.js masters!

I have a bit problem.
Because I can't fint a solution how can i made a 3D text in Awe.js, I made a numbers from 0 to 9 in Blender what i export it as an obj files.
It works properly and apper it in the browser. I set the obj and mtl path from a variables, wich is loaded perfectly :

awe.projections.add({ 
                        id: 'counter_id', 
                        geometry: {
                            path: 'obj/' + counter + '.obj'
                        },
                        material: {
                            path: 'obj/' + counter + '.mtl' 
                        },
                        position: { x: 0, y: 0, z: 0 },
                        rotation: { x: 0, y: 180, z: 0 },
                    }, { poi_id: 'counter_poi' });

But if I change a "counter" plus one bigger, the model wont change from 1 to 2.
So how can i Reload/Update/Change the object?

Thanks for your support, and sorry because of my bad english.
Best regards,
Jedi19871109

@robman
Copy link

robman commented Oct 8, 2018

Hi @Jedi19871109 you can definitely create 3D text with awe.js. Here's a link to the wiki page.

https://github.com/awe-media/awe.js/wiki/text-example

See the note at the top about typefaces and the comment in the code inline that says "REQUIRED - currently must be .js not .json".

If you wanted to create a counter the simplest way is to add all the objects at once and then change the visibility as the number changes. e.g.

// assumes projection id's are 1,2,3,4,5,6,7,8,9 and 10
for (var i = 10;i>0;I--) {
  awe.projections.update({ data:{ visible:false }, where:{ id:[1,2,3,4,5,6,7,8,9,10] }); // hide all the objects
  awe.projections.update({ data:{ visible:true }, where:{ id:i }); // then show just the one you want
}

Obviously this example will run through them all very quickly but should give you the idea. Just use this approach in your timer based code.

@Jedi19871109
Copy link
Author

Jedi19871109 commented Oct 9, 2018

Hi Robman!
Firstly thank you for your answer and you helped me lots ^^' i forget this method and yes in this way also can work perfectly.

I tried it again and now its working ^^, I made a syntax error because i forgot to add some parameters o-o foraxample rotation and position even if i add poi_id ^^'... i know its a basic level and a beginner error. So thank you again, you really helped me lots ^^

old post below:
(But about the 3d text, i tried it, on that way and yes i convert the fonts to js file as a site said and made everything on that way but it wont apper (maybe syntax error what i did somewhere? ^^')
But i will try it again :) )

Thank you for your supporting .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants