[x3d-public] [x3dom-users] Scale and relative size
Andreas Plesch
andreasplesch at gmail.com
Fri Jan 10 08:52:17 PST 2020
Another idea is to use the new gltf support in x3dom. I tried to find a
nice gltf soda can but could only find other formats. Since blender is
often the original format, I got
https://free3d.com/3d-model/high-poly-soda-can-186004.html
as blend. Since collada is similar to gltf, I then converted to collada
here:
https://www.ofoct.com/3d-model-file-for-3d-printer-converter/3d-model-file-converter.html
which uses assimp. There are many other similar services.
Then I could use https://blackthread.io/gltf-converter/ to convert to gltf.
It uses Three.js internally.
At first without textures but it turned out to be easy to include a diffuse
texture by renaming one of the included texture files to the name the
collada file references.
This then resulted in a binary gltf (.glb) with an embedded texture which I
provide here:
https://raw.githubusercontent.com/andreasplesch/glTF-Sample-Models/extra/2.0/extra/soda/glb/Soda_Can.glb
Here is the x3dom test gltf viewer:
https://x3dom.netlify.com/examples/functional/inline-gltf.html
Click on the chain symbol at the upper right and copy and paste the URL
above for soda can. It should then display, using an x3d Inline node with
that url.
It should work as it did for me. The size of the can is whatever the
original source file had used. Measuring the height using the debug log
view, I get about 9 units.
There are many ways to convert to gltf, this was just one cobbled together
quickly using free resources, to test feasibility.
---on the phone---
On Thu, Jan 9, 2020 at 11:19 AM Jesse Campbell <emsjessec at gmail.com> wrote:
>
> Thanks, I decided to use:
https://grabcad.com/library/330ml-and-500ml-beverage-cans-1
>
> I have another question. Is it possible to place text onto the screen of
the X3D file so it doesn't move? Sort of like the heads-up display (HUD)
on games where it shows the score.
>
> On Thu, Jan 9, 2020 at 10:04 AM Andreas Plesch <andreasplesch at gmail.com>
wrote:
>>
>>
https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter17Textures/Figure17_05dTexturedSodaCanX3dom.xhtml
>> has a nice soda can.
>>
>> The default unit is meter and it looks like the soda can uses meter.
>> It does not mean that scene authors adhere to that in general. There
>> is a UNIT statement in X3D but it is rarely used and x3dom does not
>> support it. Otherwise X3D is unit agnostic, eg, the length unit in
>> your scene is whatever you designate and will be the same for all
>> coordinates. Meter or millimeter is a common choice.
>>
>> Cheers, -Andreas
>>
>> On Thu, Jan 9, 2020 at 8:57 AM Jesse Campbell <emsjessec at gmail.com>
wrote:
>> >
>> > I'd like to be able to show the relative size of the object. A soda
shown next to the object should be good for that purpose.
>> >
>> > Does anyone have an .X3D file of a soda can that's the right
dimensions? I see some in .STL format on Thingiverse which can be
converted using FreeCAD. It would be nice to texture the 3d model.
>> >
>> > Do the parts in X3D files have a scale? Inches, millimeters, etc. ?
>> >
>> > --
>> > Jesse Campbell
>> >
>> > _______________________________________________
>> > X3dom-users mailing list
>> > X3dom-users at lists.sourceforge.net
>> > https://lists.sourceforge.net/lists/listinfo/x3dom-users
>>
>>
>>
>> --
>> Andreas Plesch
>> Waltham, MA 02453
>
>
>
> --
> Jesse Campbell
> Web Developer
> eMachineShop & Pad2Pad
>
--
Andreas Plesch
Waltham, MA 02453
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20200110/fcf5f530/attachment.html>
More information about the x3d-public
mailing list