Extensibility Model Part 2

By
Dave
Project
Published
20 Jan 2013 10:20
Last Modified
20 Jan 2013 21:31

I previously mentioned that I had implemented an extensibility model, and thought it useful to discuss an example of adding a simple model to earth orbit, as shown below in Figure 1 (further images of which are in the gallery).

Model

Figure 1. Model added to earth orbit. Colonial Raptor model (based on new TV series) by Coxxon.

The "extra" is defined as a folder containing the following items:

<?xml version="1.0" encoding="utf-8"?>
<system name="solar">
  <planet name="earth">
     <!-- satellite
       name = object name
       box = box for pick tests, normalized relative xyz size (currently not used)
       size = maximum length, km
       description = label text
       specintensity = specular intensity, default 0.50 in app.config
       specpower = specular power, default 10 in app.config
       scale = scale factor to unit length, default 1
       model = path to model .xnb file
       texture = path to texture file
       emissive = path to emmissive texture file
       rotation = rotation = sidereal rotation period, days
    -->
    <satellite name="raptor" box="1,1,1" size="0.0086" description="raptor" specintensity="0.1" specpower="10" scale="1" model="colrap1cox.xnb" texture="texture/colrap1cox.jpg" emissive="emissive/colrap1cox.jpg" rotation="1000" >
      <!-- orbit
         a = semi-major axis, km
         e = eccentricity
         w = argument of perifocus, degrees (aka longitude of perihelion, argument of perigee)
         i = inclination to xy plane, degrees
         node = longitude of ascending node, degrees
         M = mean anomaly, degrees (J2000.0)
         P = period, days
         plane = orbital plane (Ecliptic, Equatorial, Laplace), default Ecliptic 
      -->
      <orbit a="6871" e="0" i="0" node="0" w="0" M="0" P="1000" plane="Equatorial" />
    </satellite>
  </planet>
</system>

Listing 1. XML configuration file for satellite model "extra"

This configuration file specifies that the model should be added to the planetoid "earth" in the "solar" system, both of which are defined in system.xml configuration file.

In order to scale the model correctly, a scale factor is applied to normalize the model to unit length. This can either be applied in the XML scale attribute, or specified in the XNA content processor scale attribute, in which case the XML attribute can be set to 1. A size attribute then defines the maximum length of the model in km. The Colonial Raptor shown in Figure 1 was defined with a size of 8.6m.

The textures are defined in sub-folders "texture" and "emissive". If an emissive texture is not available, an all-black image (e.g. JPEG file) can be used.

The rotation period defines how long it takes for the model to rotate while orbiting the planetoid. If this is the same as the P orbital element, then the same face of the model is presented to the planetoid throughout the orbit. The remaining standard orbital elements specify that the model is in a circular equatorial orbit at an altitude of 500km (the earth has a radius of 6,371km).

The extra is included automatically when added to the /data/extras folder.

Comments

By
Frederik Jacobs
13 Sep 2013 10:06
Hey Dr Dave,

first of all I want to thank you for all you commitment considering the NUIverse program. Its a really amazing way to experience our huge solar system and I love playing around with it.
I am a 18-year old Student, doing a voluntary scientific year at the German Centre for Aerospace and I am trying to add data to your NUIverse program.
I already installed it on my Win8 Touch Notebook, but we also have the program running on the Samsung Pixelsense.
The actual Problem is, that I can see the extra data´s orbit (I took the same as you for the colonial raptor) with the description, but not the object itself... Firstly I tried to convert a lws-file including the ISS (I downloaded it from the Nasa website) to xnb using the XNA-formatter, but it said it failed. Nevertheless I got an output xnb-file (besides two more xml-files), that I tried to add. It also failed and NUIverse not even started.
So I repeated it using a pretty simple object this time (I created a simple ball made up of a material and a simple texture with blender and exported it as an fbx-file). Now the XNA-formatter was converting it correctly into xnb, so I put the xnb-, the xml- and the texture-file into a new folder named "test", which is located in the data/extras-folder (like so said in your discription). I replaced the model- and the texture-names in the xml-file with the names of my created xnb- and texture-files, but the problem was still the same: I couldn´t see any object, that I tried to add.
Do you know the reason for this? My aim is to add a few sattelites, the German Centre for Aerospace worked with, but firstly I would be very lucky to see my simple object in NUIverse. Maybe I used a wrong xnb-converter?
I would really appreciate if you could help me and I am looking forward to an answer from you. :-)

Greetings from Germany!
Frederik Jacobs

P.S.: I am sorry, if my English is not that correct, but I hope you can understand it!
By
Dave
13 Sep 2013 16:49
Guten tag, Frederik! I'm glad you've been enjoying using NUIverse :) I wonder if the problem might be the scale. Ideally, the original model will have a scale of 1, which will mean that a size specified in km should work correctly. I'd try making the orbit larger, and increasing the size to be the same as the earth. That way you'll be able to see if the model appears, and whether it needs a scale factor other than one (it should be the same size as the planet). I know it's a real pain having to use XNB files, I just didn't have time to work on an importer for other model formats. If it doesn't work, I'll send you an XNB to try. Let me know how it goes...
By
Frederik Jacobs
7 Oct 2013 12:47
I see, you already have some experience with German ;D
First of all, thanks for your reply! And excuse me for answering so lately, I thought I would get your answer directly to my email account, so I didnt take a look on this Website a long time.
I solved the problem by now: the issue was, that I didnt export the Blender-Model that way how XNA wants it. With the help of another Website I found out, that you have to set a cross on "XNA Strict options" when you try to export to FBX.
When I saw my ball in NUIverse I was so happy, so I immediately tried to do it the same way with some sattelite-models, and one of those (the sattelite "Voyager") even worked!!!

BUT now there is another Problem: I can see my self-created models and the Voyager, but with no texture. They are just black, white or grey (depending on witch color I set for the emissive texture), so the emissive texture works. When I replace the emissive texture with the normal texture, I can see the contours, but no colors. Nevertheless I made everything how you said in this blog. So either the XNB-File or NUIverse seems to have some Problems with the PNG-File I want to use as the texture, because when I try to launch NUIverse it crashes.
It only works, when I use the "texture.xnb"-File the XNA-Formatter gave out (I dont know why the Tool converts the model AND the texture in two different Files), but then the object still doesnt have any color.
Do you know the reason for this?

I would be very happy, if you could send me an XNB by email to try, so maybe I can figure out some differences between the working XNB and my XNB-tries. :-)

Many Greetings from Germany again!
Frederik Jacobs
By
Frederik Jacobs
9 Oct 2013 15:21
Hey Dr Dave,

I finally made it! Now I have two simple objects in NUIverse (a cube and a ball, which looks very poisonous and is a second moon of the earth :-D, with textures).
But I only know how to do it using one texture and not many (like on satellites, where are many textures needed).
In the XML-File there is just one texture declared ("texture="texture/blablabla.png""), but what if I need to declare more than one texture? When I convert any satellites to XNB, there always come a lot of texture-XNB-files out, which are definitely needed from the XNB-modell, because if I take them out from the "extra" folder, Nuiverse doesnt launch.
What a texture do you use for the Colonial Raptor? Did you put the different textures together to have one texture, which fits perfectly on the model? And if yes, how did you do that?
I think it would help me a lot, if you could send me the "extra"-folder, containing the Colonial Raptor-files, so that I can differentiate them with me files. :-)

Many Greetings!
Frederik
By
Dave
27 Nov 2013 22:57
Hi Frederik,

Great to hear you've made progress! Unfortunately the app currently supports only a single diffuse and emissive texture per model. Most modelling tools allow you to create a single texture which is mapped to your model using UV coordinates.

Regards,
Dave
By
Frederik Jacobs
9 Jan 2014 15:48
Hi Dr. Dave,

I really made progress by now! I have integrated many objects (both satellites with their textures [I divided the models with their textures and gave them the same orbit to get more detail on the texture] and dwarf planets). For example: Churyumov–Gerasimenko (but only the orbit, because it is a comet), Ceres, Eris, Haumea, Makemake, Pluto, Sedna, Cassini Huygens, Hubble, ISS, Magellan, Mars Express, Rosetta, MIR, Voyager and HOMER SIMPSON ;-)
A Month ago I also sended you some pictures per email (the leader from the DLR_School_Lab in Berlin has your email adress and gave it to me), but I guess the email did not arrived. If you are interested in how the models look in your program, I can send you some screenshots. But I am not sure if I have the right email adress and I do not want to publish it in this post, so maybe you can answer on my following questions per email (I leave my email adress behind), so that I can send you some Screenshots back. (Only if it is ok for you, I definitly do not want to disturb you!)

My problem is: a lot of the named models are flickering like fury when there are at least two polygons closed to each other. My first idea was to delete unnecessary edges and double vertices from the afflicted parts from the model, but most of them are still flickering with a specific distanz to the object. I think it has something to do with the grafics software from windows. Do you have a solution for this?
On top of that I noticed that Phobos and Deimos disappear by zooming in. Why is that so?
Furthermore I really like the menue for the planets. Is there a way to program a same one for satellites or dwarf planets?
And my last question: Is it possible to displace the spheric form from any moons or asteroids with self created xnb models?

I would be glad about any help.

Regards,

Frederik Jacobs
By
Frederik Jacobs
9 Jan 2014 16:14
Oh, and I have one more problem (and maybe the most important!):

When I Enter the Surface Mode on the Samsung SUR40 and try to start NUIverse, it does not work anymore. Using the Surface Shell it still works.
I think a reason could be, that I interlaced the model parts in different file folders.
For example:
Data/Extras/Satelliten/Hubble/Hubble_Teleskop_1
Data/Extras/Satelliten/Hubble/Hubble_Teleskop_2
Data/Extras/Satelliten/Hubble/Hubble_Teleskop_3
Data/Extras/Satelliten/Hubble/Hubble_Teleskop_4
...
Data/Extras/Satelliten/Cassini/Cassini_1
Data/Extras/Satelliten/Cassini/Cassini_2
...

When I activate troubleshooter entering the Surface Mode, I got the following error report:
Problemereignisname: CLR20r3
Problemsignatur 01: nuiverse.exe
Problemsignatur 02: 0.9.4626.16953
Problemsignatur 03: 504082f3
Problemsignatur 04: mscorlib
Problemsignatur 05: 4.0.30319.18052
Problemsignatur 06: 5173c144
Problemsignatur 07: 43cf
Problemsignatur 08: 13c
Problemsignatur 09: System.UnauthorizedAccess
Betriebsystemversion: 6.1.7601.2.1.0.256.48
...

Do you have a solution for this?

Regards (again),

Frederik Jacobs

Add Comment

*
*
*
Captcha
*
*Required