• Website
  • Search
  • Member List
  • Help
  • Old Forum
  • Social Media
    •   @Wings3dOfficial
    •   @Wings3dOfficial
    •   Wings3dOfficial
    •   Wings3dOfficial
  • Register
  • Login
  • Website
  • Search
  • Member List
  • Help
  • Old Forum
  • Register
  • Login
Wings 3D Development Forum Wings 3D Design & Development v
1 2 3 4 5 … 11 Next »
X3D / VRML import plugin

 
  • 0 Vote(s) - 0 Average
X3D / VRML import plugin

Pages (2): 1 2 Next »
edb
Offline

Member

Posts: 135
Threads: 16
Joined: Nov 2022
#1
12-01-2022, 02:30 PM (This post was last modified: 05-28-2023, 03:20 AM by edb.)
I'm making an import plugin to complement the VRML export plugin already in Wings3D. It can import from X3D, VRML 2.0, a bit of VRML 1.0 and possibly SGI Inventor files as they are very similar to VRML 1.0 files.

Example X3D file:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "http://www.web3d.org/specifications/x3d-3.0.dtd">
<X3D version="3.0" profile="Immersive" xmlns:xsd="http://www.w3.org/2001/XMLSchema-instance" xsd:noNamespaceSchemaLocation="http://www.web3d.org/specifications/x3d-3.0.xsd">
    <head>
        <meta name="filename" content="untitled.x3d" />
        <meta name="generator" content="Blender 2.77 (sub 0)" />
    </head>
    <Scene>
        <NavigationInfo headlight="false"
                        visibilityLimit="0.0"
                        type='"EXAMINE", "ANY"'
                        avatarSize="0.25, 1.75, 0.75"
                        />
        <Background DEF="WO_World"
                    groundColor="0.051 0.051 0.051"
                    skyColor="0.051 0.051 0.051"
                    />
        <Transform DEF="Cube_TRANSFORM"
                   translation="0.000000 0.000000 0.000000"
                   scale="1.000000 1.000000 1.000000"
                   rotation="0.000000 0.707107 0.707107 3.141593"
                   >
            <Transform DEF="Cube_ifs_TRANSFORM"
                       translation="0.000000 0.000000 0.000000"
                       scale="1.000000 1.000000 1.000000"
                       rotation="1.000000 0.000000 0.000000 0.000000"
                       >
                <Group DEF="group_ME_Cube">
                    <Shape>
                        <Appearance>
                            <Material DEF="MA_Material"
                                      diffuseColor="0.800 0.800 0.800"
                                      specularColor="0.401 0.401 0.401"
                                      emissiveColor="0.000 0.000 0.000"
                                      ambientIntensity="0.333"
                                      shininess="0.098"
                                      transparency="0.0"
                                      />
                        </Appearance>
                        <IndexedFaceSet solid="true"
                                        coordIndex="0 1 2 3 -1 4 7 6 5 -1 0 4 5 1 -1 1 5 6 2 -1 2 6 7 3 -1 4 0 3 7 -1 "
                                        >
                            <Coordinate DEF="coords_ME_Cube"
                                        point="1.000000 1.000000 -1.000000 1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 1.000000 -1.000000 1.000000 0.999999 1.000000 0.999999 -1.000001 1.000000 -1.000000 -1.000000 1.000000 -1.000000 1.000000 1.000000 "
                                        />
                        </IndexedFaceSet>
                    </Shape>
                </Group>
            </Transform>
        </Transform>
        <Transform DEF="Lamp_TRANSFORM"
                   translation="-4.076245 5.903862 1.005454"
                   scale="1.000000 1.000000 1.000000"
                   rotation="-0.498084 -0.762016 -0.413815 1.513875"
                   >
            <PointLight DEF="LA_Lamp"
                        ambientIntensity="0.0000"
                        color="1.0000 1.0000 1.0000"
                        intensity="0.5714"
                        radius="30.0000"
                        location="-0.0000 -0.0000 0.0000"
                        />
        </Transform>
        <Transform DEF="Camera_TRANSFORM"
                   translation="-7.481132 5.343665 -6.507640"
                   scale="1.000000 1.000000 1.000000"
                   rotation="-0.093039 -0.968741 -0.229967 2.347036"
                   >
            <Viewpoint DEF="CA_Camera"
                       centerOfRotation="0 0 0"
                       position="0.00 0.00 -0.00"
                       orientation="-0.92 0.35 0.17 0.00"
                       fieldOfView="0.858"
                       />
        </Transform>
    </Scene>
</X3D>

[Image: MbDJZ2T1_o.png]
micheus
Offline

Forum's Admin and Support | Bug fixer
Posts: 3,676
Threads: 183
Joined: Jun 2012
#2
12-01-2022, 07:09 PM
Quote:I'm making an import plugin to complement the VRML export plugin already in Wings3D.
In this case, I suggest you work over the current code and create a PR at Wings3D's GitHub repository in order to get it approved by dgud.
[Image: tw.png] @MicheusVieira [Image: yt.png] @MicheusVieira [Image: da.png] Micheuss [Image: ig.png] micheus4wings3d
* Wings3D Team stands for: Björn and Dan
edb
Offline

Member

Posts: 135
Threads: 16
Joined: Nov 2022
#3
12-02-2022, 02:28 PM
I can make a PR for this one pretty soon, I just have the textures part to do I think. Thank you.
edb
Offline

Member

Posts: 135
Threads: 16
Joined: Nov 2022
#4
03-08-2023, 01:26 PM
I've made a branch eb/x3d-import with my changes so far but there is still a little bit to complete. There are also changes to wpc_wrl.erl that adds X3D export support.
edb
Offline

Member

Posts: 135
Threads: 16
Joined: Nov 2022
#5
03-09-2023, 12:56 PM
It took a bit of time but I think this importer is now generally usable.

Apart from IndexedFaceSet, it also implements many of the other geometry nodes, making it useful not only to import meshes from other programs, but also to create geometries from VRML code to import directly into wings. Basic geometries like Box, Cylinder, Cone, Sphere are available, as well as the Extrusion and ElevationGrid node. Transforms (translate, rotation, scale) that the shapes are in, are also applied to the shapes.

beam file available:
wpc_wrl.tar

This installs over the stock wpc_wrl plugin to provide X3D export support.

Example ElevationGrid:

[Image: u5Qor2bE_o.png]
Code:
#VRML V2.0 utf8
DEF elevation2x2 Transform {
  children [
    Shape {
      appearance Appearance {
        material DEF default Material { }
      }
      geometry ElevationGrid {
        xDimension 3
        zDimension 3
        colorPerVertex FALSE
        height [ 0.0 0.2 0.4  0.2 0.4 0.6  0.4 0.6 0.8  ]
        color Color { color [ 1 0 0  0 1 0  0 0 1  1 1 0  1 0 1  0 1 1 ] }
      }
    }

  ]
}
edb
Offline

Member

Posts: 135
Threads: 16
Joined: Nov 2022
#6
04-10-2023, 12:39 PM
Updated with improvements for multi byte identifiers and texture file paths:
wpc_wrl.tar
tkbd
Offline

Senior Member

Posts: 451
Threads: 115
Joined: Nov 2012
#7
05-22-2023, 12:14 PM
Hello edb!

I installed your VRML/X3D importer and exporter,and done some tests.
And tried to readVRML data of DEM(Digital Elevation Model)
Wings3D could displayed two Materials and one Texture loaded,The material referenced the texture correctly
but UVdata missing.

The file can dowoload in a following site.
https://maps.gsi.go.jp/index_3d.html?z=1...3&b=0&dd=0
You can also download two file,dem.wrl and texture.png
Unfortunately English interface is not supported..and .the wrl file size is 13.8MB
(Therefore, I posted the image with English annotations.)

Note: This site is Geospatial Information Authority of Japan (GSI)
https://www.gsi.go.jp/ENGLISH/index.html

I examine the file by a text editor.
The wrl file has texCoord TextureCoordinate field, but texCoordIndex field missing.
MeshLab and Blender can see UVdata correctly and textured terrain.
Would it be possible Wings could as well the data display correctly in the cases texCoordIndex missing too?


[Image: hVMcAcE.jpg]
[Image: AzR1H8l.jpg]
[Image: SKdxeba.jpg]
[Image: 1PNCoI6.jpg]
[Image: 62g5m3V.png]

[Image: afvpMYk.png]


Best regard!
------------------
tkbd
edb
Offline

Member

Posts: 135
Threads: 16
Joined: Nov 2022
#8
05-23-2023, 12:44 PM
Hello tkbd,

I'll be looking at it soon to see what needs to be changed for the absent texCoordIndex.
Thanks for letting me know.
edb
Offline

Member

Posts: 135
Threads: 16
Joined: Nov 2022
#9
05-28-2023, 03:20 AM
I've made the fix for when texCoordIndex isn't specified. Thanks tbkd for finding the bug.

Newest build:
wpc_wrl.tar
tkbd
Offline

Senior Member

Posts: 451
Threads: 115
Joined: Nov 2012
#10
05-28-2023, 04:39 AM
Thank you for update!.
I checked it working good!!
I'm glad because this specification will possibly many people will benefit from it.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (2): 1 2 Next »


  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D - Powered by MyBB

Linear Mode
Threaded Mode