Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. WPF 3D rendering

WPF 3D rendering

Scheduled Pinned Locked Moved WPF
helpquestioncsharpdatabasewpf
5 Posts 3 Posters 7 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kenneth Haugland
    wrote on last edited by
    #1

    I have started on a project that involves using loading resources on the new glTF format. Namely it from NASAs 3D models of the Solar system: Sun 3D Model | NASA Solar System Exploration[^] The glTF format seems to be easy to load using the glTFLoader that can be downloaded from github. The file itself is just a mix of some header info, a JSON part, and a Binary data part that is pretty well described in the documentation. glTF-Tutorials/gltfTutorial_002_BasicGltfStructure.md at master · KhronosGroup/glTF-Tutorials · GitHub[^] But it is not working exactly. First issue is that the images are loaded, but the texture coordinates seems to be wrong. I have asked this question over at the site that monitors the standard. Load glTF into WPF 3D with a simple viewer - glTF - Khronos Forums[^]. The second issue, which I hope some of you might help me with, is that the diffuse material does not seem to register correctly. So I have to set this via a name property on the diffuse material itself. Then it loads. Any ideas on why that is?

    using glTFLoader.Schema;
    using glTFLoader;
    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Text;
    using System.Windows.Media.Imaging;
    using System.Windows.Media;
    using System.Windows.Media.Media3D;
    using System.Windows;

    namespace Wpf_glTF_testing
    {
    public class Earth
    {
    public UInt32 Magic { get; private set; }

        public UInt32 Version { get; private set; }
    
        public UInt32 TotalFileLength { get; private set; }
    
        public UInt32 JsonChuckLength { get; private set; }
        public UInt32 BinChuckLength { get; private set; }
    
        public byte\[\]  JSON\_data { get; private set; }
        public byte\[\] BIN\_data { get; private set; }
    
        UInt32 JSON\_hex = 0
    
    L R 2 Replies Last reply
    0
    • K Kenneth Haugland

      I have started on a project that involves using loading resources on the new glTF format. Namely it from NASAs 3D models of the Solar system: Sun 3D Model | NASA Solar System Exploration[^] The glTF format seems to be easy to load using the glTFLoader that can be downloaded from github. The file itself is just a mix of some header info, a JSON part, and a Binary data part that is pretty well described in the documentation. glTF-Tutorials/gltfTutorial_002_BasicGltfStructure.md at master · KhronosGroup/glTF-Tutorials · GitHub[^] But it is not working exactly. First issue is that the images are loaded, but the texture coordinates seems to be wrong. I have asked this question over at the site that monitors the standard. Load glTF into WPF 3D with a simple viewer - glTF - Khronos Forums[^]. The second issue, which I hope some of you might help me with, is that the diffuse material does not seem to register correctly. So I have to set this via a name property on the diffuse material itself. Then it loads. Any ideas on why that is?

      using glTFLoader.Schema;
      using glTFLoader;
      using System;
      using System.Collections.Generic;
      using System.IO;
      using System.Text;
      using System.Windows.Media.Imaging;
      using System.Windows.Media;
      using System.Windows.Media.Media3D;
      using System.Windows;

      namespace Wpf_glTF_testing
      {
      public class Earth
      {
      public UInt32 Magic { get; private set; }

          public UInt32 Version { get; private set; }
      
          public UInt32 TotalFileLength { get; private set; }
      
          public UInt32 JsonChuckLength { get; private set; }
          public UInt32 BinChuckLength { get; private set; }
      
          public byte\[\]  JSON\_data { get; private set; }
          public byte\[\] BIN\_data { get; private set; }
      
          UInt32 JSON\_hex = 0
      
      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      You abstract "... new DiffuseMaterial(), etc." to a separate WPF project; get it working there; then import it back. (Someone was dealing with "DiffuseMaterial" and 3rd party software in Q&A and not getting anywhere either).

      "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

      K 1 Reply Last reply
      0
      • K Kenneth Haugland

        I have started on a project that involves using loading resources on the new glTF format. Namely it from NASAs 3D models of the Solar system: Sun 3D Model | NASA Solar System Exploration[^] The glTF format seems to be easy to load using the glTFLoader that can be downloaded from github. The file itself is just a mix of some header info, a JSON part, and a Binary data part that is pretty well described in the documentation. glTF-Tutorials/gltfTutorial_002_BasicGltfStructure.md at master · KhronosGroup/glTF-Tutorials · GitHub[^] But it is not working exactly. First issue is that the images are loaded, but the texture coordinates seems to be wrong. I have asked this question over at the site that monitors the standard. Load glTF into WPF 3D with a simple viewer - glTF - Khronos Forums[^]. The second issue, which I hope some of you might help me with, is that the diffuse material does not seem to register correctly. So I have to set this via a name property on the diffuse material itself. Then it loads. Any ideas on why that is?

        using glTFLoader.Schema;
        using glTFLoader;
        using System;
        using System.Collections.Generic;
        using System.IO;
        using System.Text;
        using System.Windows.Media.Imaging;
        using System.Windows.Media;
        using System.Windows.Media.Media3D;
        using System.Windows;

        namespace Wpf_glTF_testing
        {
        public class Earth
        {
        public UInt32 Magic { get; private set; }

            public UInt32 Version { get; private set; }
        
            public UInt32 TotalFileLength { get; private set; }
        
            public UInt32 JsonChuckLength { get; private set; }
            public UInt32 BinChuckLength { get; private set; }
        
            public byte\[\]  JSON\_data { get; private set; }
            public byte\[\] BIN\_data { get; private set; }
        
            UInt32 JSON\_hex = 0
        
        R Offline
        R Offline
        RedDk
        wrote on last edited by
        #3

        (... stumble stumble ...) Ran across this idea this morning: https://stackoverflow.com/questions/tagged/wpf+3d[^]. Nothing to see here. Move along then.

        K 1 Reply Last reply
        0
        • L Lost User

          You abstract "... new DiffuseMaterial(), etc." to a separate WPF project; get it working there; then import it back. (Someone was dealing with "DiffuseMaterial" and 3rd party software in Q&A and not getting anywhere either).

          "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

          K Offline
          K Offline
          Kenneth Haugland
          wrote on last edited by
          #4

          I figured it out anyways. :)

          1 Reply Last reply
          0
          • R RedDk

            (... stumble stumble ...) Ran across this idea this morning: https://stackoverflow.com/questions/tagged/wpf+3d[^]. Nothing to see here. Move along then.

            K Offline
            K Offline
            Kenneth Haugland
            wrote on last edited by
            #5

            Nah, I came across an article that solved everything for me: Introduction to glTF for WPF 3D[^]

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups