Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Water Moon Howto #29

Merged
merged 13 commits into from
Jul 4, 2024
17 changes: 17 additions & 0 deletions using-openspace/builders/add-fulldome-image.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Use a fulldome image in OpenSpace
Here, we walk through the steps needed to display a [fulldome](https://en.wikipedia.org/wiki/Fulldome) frame in OpenSpace.

1. Convert the fulldome frame to a 360 image with [equirectangular projection](https://en.wikipedia.org/wiki/Equirectangular_projection)
2. Use the 360 image as the texture for a [RenderableSphereImageLocal](/generated/asset-components/RenderableSphereImageLocal)
3. Move the camera inside the rendered sphere, to the center of the sphere, and look towards the hemisphere which has the desired view.

## 1. Convert the fulldome frame to a 360 image
This can be done with [Blender](https://www.blender.org/) with the use of this [blend file](https://informal.jpl.nasa.gov/museum/sites/default/files/ResourceLibrary/fulldome-to-equirectangular-converter_version3.zip)
or using other tools like [OCVWarp](https://github.com/hn-88/OCVWarp/wiki/Transform-types)

## 2. Create a renderable sphere
An example of a renderable sphere created in this manner using a local texture is described in another howto article.

## 3. Move the camera
If the renderable sphere is scaled to be very large, the camera would already be inside the sphere with the default view, and only [yaw/pitch adjustments](/getting-started/getting-started/navigation) may
need to be made.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
64 changes: 64 additions & 0 deletions using-openspace/builders/create-water-moon.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Create and display a "Water Moon"
The objective is to show all the volume of the water on Earth as a little "moon" right next to Earth.
For this, we're going to create an asset.
We could create a [renderable globe](/content/globebrowsing/creation/creating-a-renderableglobe) to do this,
but we have a simpler way, using the [RenderableSphereImageLocal](/generated/asset-components/RenderableSphereImageLocal) asset component
introduced in version 0.20.

In order to locate the newly created sphere at a chosen location near Earth, we can use the [GlobeTranslation](/generated/asset-components/GlobeTranslation)
asset component. To load the texture, if we save the texture image (many such water textures are available for free online) as "watertexture.jpg" in the same directory as the asset file created below,
we can use the [resource method](/creating-data-assets/asset-creation/resources) to render the texture on the sphere.

The whole thing can be put together as an asset file called for example **sphereonglobe.asset**, and saved under the user/data/assets directory of our OpenSpace installation, since all assets in that folder show up
automatically in the asset selection part of profile editor, as seen below.
:::{figure} create-water-moon-asset-editor-screen.jpg
The user asset shows up like this in the Profile Editor under Assets -- Edit
:::

The complete asset file can be as below. Please note the comments which are preceded by two dashes, like `--`.
```
local earth_asset = asset.require('scene/solarsystem/planets/earth/earth')

local Sphere1 = {
Identifier = "Sphere1",
Parent = earth_asset.Earth.Identifier,
Transform = {
-- A GlobeTranslation puts the sphere on the location on Earth you want it to be located.
-- I have set the altitude to be the same as the size
Translation = {
Type = "GlobeTranslation",
Globe = earth_asset.Earth.Identifier,
Longitude = 16.188313,
Latitude = 58.588455,
Altitude = 100000 -- Put this to the same as the size to offset it from the surface
}
},
Renderable = {
Type = "RenderableSphereImageLocal",
Size = 100000, -- The size you want the sphere to be (radius) in meter
Segments = 80,
Texture = asset.resource("watertexture.jpg"), -- asset.localResource is deprecated, we use asset.resource instead from 0.20 onwards
Orientation = "Both"
},
GUI = {
Name = "Sphere 1",
Path = "/Earth Water/Spheres"
}
}

asset.onInitialize(function()
openspace.addSceneGraphNode(Sphere1)
end)

asset.onDeinitialize(function()
openspace.removeSceneGraphNode(Sphere1)
end)

asset.export(Sphere1)

```
Next, we can create a new profile by editing an existing profile, and add this asset to that profile as described in a separate tutorial.
Or, we can also just drag and drop the asset file into OpenSpace once it is up and running, and make this asset show up as seen in the image below.
:::{figure} create-water-moon-openspace-screen.jpg
After dragging and dropping the **sphereonglobe.asset** file into OpenSpace, the sphere is seen rendered
:::
8 changes: 8 additions & 0 deletions using-openspace/builders/index.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
# Builders
Tutorials about adding new things into OpenSpace. For anyone who wants to add their own data or make special customizations to OpenSpace should use these.
:::{toctree}
:maxdepth: 1
:caption: Howto

create-water-moon
add-fulldome-image
:::

19 changes: 19 additions & 0 deletions using-openspace/installers/dual-monitor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Dual monitors with fullscreen display
Here is a way of displaying the gui on a primary screen and the OpenSpace render on a secondary screen, for example a dome projector, in full screen.
It's very important to have the render running in full screen to get rid of the title bar on the dome projector.

First check the virtual monitor layout of your screen in Windows to see how the monitors are aligned relative to each other. Windows has a virtual coordinate system whose origin (0,0)
is at the top left corner of the "main display". You'll need those to position the windows correctly. For the rest of this I'm assuming you have the monitor that should get the GUI as the main monitor,
that both screens are `1920x1080`, and that the projector "monitor" is to the right of the main monitor.

In the **single_fisheye_gui.json**
a. Add `"border": false`, somewhere between line 10 and 17. That will cause the title bar to disappear
b. In line 15 change `"pos": { "x": 50, "y": 50 },` to `"pos": { "x": 0, "y": 0 },` to have the window start in the top left corner of the main screen
c. In line 16 change `"size": { "x": 1024, "y": 1024 },` to `"size": { "x": 1920, "y": 1080 },` to make the GUI window full screen
d. Add `"border": false,` somewhere between line 34 and 36 to make the rendering window also not have a title screen
e. Add `"pos": { "x": 1920, "y": 0 },` somewhere between line 34 and 36 to make the rendering window start at the top left corner of the second monitor
f. Change line 37 from `"size": { "x": 1024, "y": 1024 },` to `"size": { "x": 1920, "y": 1080 },` to make it go full screen

## Notes
1. The `border=false` solution is preferable to `fullscreen=true` as it represents a "non-exclusive" fullscreen, which means you won't get any flickering when you click between applications.
2. In case the two monitors have different resolutions, please put the larger monitor on the "left" (as the main display) and the smaller one on the "right" - doing otherwise would cause some rendering issues.
7 changes: 7 additions & 0 deletions using-openspace/installers/index.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
# Installers
Information about configuring OpenSpace. For dome/theater technicians or users who want to customize the output of OpenSpace.

:::{toctree}
:maxdepth: 1
:caption: Set up

dual-monitor
:::