aalavandhaann / blueprint-js

The Javascript es6 version of the original furnishup/blueprint3d. Need some royalty free low poly models for the inventory. Can someone help me with this?
MIT License
493 stars 156 forks source link

Use design.blueprint3d in A-frame? #50

Closed AWAIS97 closed 4 years ago

AWAIS97 commented 4 years ago

Hi, Is it possible to use/load Design.blueprinted file as model in A-frame to view as VR ? like wise you used .glft model.. Need Help

aalavandhaann commented 4 years ago

Download your floorplan as a GLTF (The button with an arrow "save scene as GLTF"). This can be then embedded inside AFRAME

AWAIS97 commented 4 years ago

Okay But why can't load default extension (design.blueprint3d).

I also change the file extension ( .blueprint3d to .gltf )but this not work. why this not work? I know both have JSON format in it.

Need to know.. Thanks.

aalavandhaann commented 4 years ago

It is not about loading any random JSON but a recognizable JSON. So design.blueprint3d is a json file that contains information about the floorplan and only blueprintjs can understand this. If you change it to GLTF it would do nothing. I believe you should familiarize yourself with JSON and GLTF. Check if a valid GLTF file is same as design.blueprint3d. TO do this open them in a text editor and see how the information is structured and presented.

Regards,

0K

On Tue, Jun 9, 2020 at 11:34 AM Awais Hassan notifications@github.com wrote:

Okay But why can't load default extension (design.blueprint3d).

I also change the file extension ( .blueprint3d to .gltf )but this not work. why this not work? I know both have JSON format in it.

Need to know.. Thanks.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/aalavandhaann/blueprint-js/issues/50#issuecomment-641384437, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6JJV6WTCSOU33UEW7OB23RVZJAXANCNFSM4NYE35TA .

AWAIS97 commented 4 years ago

Okay i got it. But how can I change the .blueprint3d (JSON) to .gltf That When i download file it download only in .gltf format not with .blueprint3d format. Need to know.. Guide me

Thanks

aalavandhaann commented 4 years ago

If you are in the 3D view then one of the buttons on the top is to download the GLTF of your floorplanner scene.

On Tue, Jun 9, 2020 at 12:31 PM Awais Hassan notifications@github.com wrote:

Okay i got it. But how can I change the .blueprint3d (JSON) to .gltf That When i download file it download only in .gltf format not with .blueprint3d format. Need to know..

Thanks

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/aalavandhaann/blueprint-js/issues/50#issuecomment-641417456, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6JJV2WV4SLV7GO5TQSDD3RVZPVNANCNFSM4NYE35TA .

AWAIS97 commented 4 years ago

I know that but i want to change the .blueprint3d (JSON) to .gltf in code

That whenever i download i only download .gtlf model from save button

Thanks

aalavandhaann commented 4 years ago

Please look into app.js and in line number 133 it mentions 'blueprint3d.three.exportForBlender();'. I believe this is the function you are looking for.

On Wed, Jun 10, 2020 at 12:38 PM Awais Hassan notifications@github.com wrote:

I know that but i want to change the .blueprint3d (JSON) to .gltf in code

That whenever i download i only download .gtlf model from save button

Thanks

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/aalavandhaann/blueprint-js/issues/50#issuecomment-642126162, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6JJV456PYHTMXRTKULLPDRV6ZG7ANCNFSM4NYE35TA .

AWAIS97 commented 4 years ago

okay Can you please tell me about " function saveGLTFCallback(o) " . What its work and in which line it call??

aalavandhaann commented 4 years ago

If you see line 170 in app.js it will be blueprint3d.three.addEventListener(BP3DJS.EVENT_GLTF_READY, saveGLTFCallback);

when you call the function blueprint3d.three.exportForBlender(); the blueprint-js framework goes through the floorplan scene and prepares the GLTF file. Once this is complete it will trigger the event BP3DJS.EVENT_GLTF_READY that is being listened to by line 170, which inturn points to saveGLTFCallback function at line 136.the argument O is an object that contains the GLTF to be saved in the key O.gltf. Its upto to you on how you process this information based on your application usage.

BTW I will close this issue now.

Regards,

0K