Home | Webstore
Latest News: OOTP Update 20.6 - OOTP 20 Available - FHM 6 Available

FHM 6 Available Now!

  

Go Back   OOTP Developments Forums > Out of the Park Baseball 20 > OOTP Mods > OOTP Mods - 3D Models

Reply
 
Thread Tools
Old 07-13-2016, 07:00 PM   #1
Jorin Guderian
Global Moderator
 
Jorin Guderian's Avatar
 
Join Date: Apr 2014
Posts: 90
Thanks: 4
Thanked 89x in 42 posts
How to use and build sky boxes for 3d stadiums

Skyboxes howto:

As a new feature, support for skyboxes has been added to OOTP17.
A skybox or cube map is basically a panorama made up from 6 images
where each image represents one side of a box. The viewer is in
the center of the box and gets the illusion that he is in the space
from where the pictures were taken. See

https://en.wikipedia.org/wiki/Cube_mapping

The stadium is located inside
such a box so that you can see the panorama from inside the stadium
behind the stadium limits. So far we only have added a skybox to to the
Citi Field stadium, but soon we will have panoramas for all MLB stadiums.
Feel free to create skyboxes for your own stadiums.
If you have skybox images, making the skybox show up around a stadium is very simple:
For a day skybox just add a folder named

"sky_box_day"

inside your stadium model folder and put the 6 images inside that folder named

xn, zp, xp, zn, yp, yn (see attached image).

In case of a night skybox do the same but name the folder

"sky_box_night"

and that is it! Supported formats for the images are webp, jpg and png.

The sides of the skybox are parallel to the infield diamond, see top view image in the attachement.


To have the skybox pointing in the right direction, the side of it that is behind the right side of the outfield is always xn
and the ordering of the images around the viewer is: xn,zp,xp,zn. and yp and yn are on top and bottom of "zp".
For better understanding just load all images in separate windows and place them becide each
other so you'll see which side connects to what side.
You can have the same skybox loaded on other stadiums if you just copy over the sky_box folder.


I will now show how to create skyboxes using google earth:
The idea is the following:
You can create tours in google earth and save them as KML files so
when double clicking on an KML file you will jump from tour location to tour location inside
google earth. On the other hand these KML files can be loaded in a text editor and edited by hand.
What is needed is just a tour where the camera basically stays at the same location but fist look in
one direction, then turns araound by exactly 90 degrees, then do it again, again and again, then look up
and then look down. At each "location" it should wait for about 10 seconds.
When having such a tour KML, all we have to do is taking 6 screenshots one after the other, then
cut out what we don't want to see and name the resulting screenshots the right way.

Now step by step:
If you don't have 3D buildings right away, aktivate them first in the side pannel of google earth.
In the attachement is a zip file containing all KML files for the MLB stadiums.

Pick one KML file and open it in a text editor (notepad++ for example).
You will see 6 blocks like this one with the right indentation which has got lost here:

<gx:FlyTo>

<gx:duration>1.0</gx:duration>

<Camera>

<longitude>-117.882735</longitude>

<latitude>33.800306</latitude>

<altitude>80</altitude>

<heading>140</heading>

<tilt>90</tilt>

<range>0</range>

<altitudeMode>relativeToGround</altitudeMode>

<gx:horizFov>91</gx:horizFov>

</Camera>

</gx:FlyTo>

By the numbers in the longitude, latitude and altitude(in meters) blocks it discribes where the camera should be placed on earth.
The heading block controls the direction the camera is looking to in degrees. As orientation we use the right foul
line when looking from the homeplate to the field. When the right foul line points exactly to the north, then heading is
0 degrees. But lets say it points in north east direction, then we would have to turn the whole stadium around the y axes
of about 45 degrees to make the foul line point north. This 45 is the value for heading then.
To find the decimal longitude and latitude of a stadium, start google earth, go to Tools->options and in the first tab "3d View" choos under longitude/latitude
the frist point "decimal degrees" and hit ok. Then search your stadium or location with the search bar. In the tool
bar click on add placemark. A window will pop up where you can name the placemark etc in which you will see the decimal
longitude and latitude values. Just copy these values and replace the values in the <longitude> / <latitude> blocks with these
values. When you now look at the navigation bar, north should be on top of the circle. When the stadiums right foul line
is not pointing north, then just grap the "N" on the cycle to cycle the view till the stadiums foul faces
straight ahead from the viewer. When you now look at the "N" you can approximately read the degrees from it for the
heading value. When N is for example on the top left of the cycle at 45 degrees, then heading is 45 degrees. If it is
on the right side at same hight, then this would be 360 - 45 = 315 degrees.
So, that is how you get the heading value for the first image.
The next 3 <gx:FlyTo> blocks look the same they only have different values for heading. So the next image on the right
of the first image will have the value for heading + 90 degrees. The third image will have heading + 90 + 90 and
the 4th will add 90 + 90 + 90 to the first heading value. For the blocks to create the top and bottom views, we first
copy the second block. For the top we change the <tilt> value from 90 to 180 and for the button we change it to 0.
Now we are allmost ready to take the screen shots, but some words to this first:
First of all, the boxes sides have to be exactly square. That means whe have to scale the window till it is exactly square.
To do that, one can make a screenshot of the inner area of the google earth window and and then check the dimensions
of the resulting image, if for example the width has to be one pixel wider or smaller. In the end we need screenshots
that are power of two, meaning width and height dimensions have to be something like 128,256,512,1024,2048 etc.
A good choice is 1024x1024.
It is also possible to take the screen shots in other dimensions, but then, the images have to be resized using an image viewer
later on.
To take the screenshot, any screenshot tool or image viewer with that kind of functionality can be used.
I can recommand irfanview. When hitting "c" in irfanview, a
screenshot configuration panel comes up where you can say where you want the screenshots to be saved. You can also
choose from different screenshot modes. One mode takes shots of the inner area of a window which is in focus, it should
be the 4th option. So, when we now take a shot with irfanview of the canvas area of google earth, we first have
to deactivate all toolbars, and pannals. But the uppest toolbar we can't remove. Also about the first 4 pixels
on the left side of the canvas will be a bit darker to give the illusion that the window frame around the canvas casts
a shaddow. When we would now just put the images together, you would notice a seam and of cause the toolbar in the top
of the panorama. To get rid of it, I made the cameras field of view a bit wider than 90 degrees to be 91 so we can cut of
a bit and the resulting images will fit together perfectly. So when considering the window size, you have to keep in mind first
how much you will cut off. So, that we are ready now, click on the kml file, wait for it to start up and at the first view
wait long enough till the timeline dissapears to take the first shot. After each angle change wait long enough so google
earth will have enough time to download all the content to make everything look pretty.
Hint: Use the same settings as we do to get a good image quality, see image.

Have fun,
Jorin
Attached Images
Image Image Image Image 
Attached Files
File Type: zip KML.zip (18.3 KB, 73 views)
Jorin Guderian is offline   Reply With Quote
4 thanks for this post:
gbmoore121 (07-13-2016), silvam14 (07-13-2016), txranger (07-13-2016), zappa1 (07-14-2016)
Old 07-13-2016, 07:55 PM   #2
knight1376
Major Leagues
 
Join Date: Mar 2016
Posts: 340
Thanks: 0
Thanked 108x in 77 posts
very nice....

very nice....
knight1376 is offline   Reply With Quote
Old 07-13-2016, 09:53 PM   #3
silvam14
Hall Of Famer
 
silvam14's Avatar
 
Join Date: Apr 2004
Location: Dedham, MA
Posts: 7,240
Thanks: 1,334
Thanked 6,047x in 2,166 posts
This is great can't wait to see who emerges as the resident sky box guru


Sent from my iPhone using Tapatalk
__________________
Senior "Nancy Boy" of the OOTP Boards
_______________________________________________
silvam14 is offline   Reply With Quote
Old 07-14-2016, 03:33 PM   #4
adion
All Star Starter
 
adion's Avatar
 
Join Date: Apr 2006
Posts: 1,185
Thanks: 64
Thanked 715x in 366 posts
This looks like it will work great. However, when I look in the Citi Field folder of the latest version I see the sky_box_day folder and in it are the 6 images but when I select that park in the game and look at the 3D image in the edit mode there is no skybox background. What is in the background appears to be the reverse image of the game screen. What am I doing wrong?

I found and fixed the problem
Attached Images
Image 

Last edited by adion; 07-14-2016 at 04:13 PM.
adion is offline   Reply With Quote
Old 07-14-2016, 05:16 PM   #5
adion
All Star Starter
 
adion's Avatar
 
Join Date: Apr 2006
Posts: 1,185
Thanks: 64
Thanked 715x in 366 posts
What are the parameters for the individual jpeg/png that go into the folder. Do they have to be 1024X1007 pixels? Also, is there a way to put 3d type images in the 'boxes'. Looking at you Citi Field it looks like the ball park is sitting on a flat picture.
adion is offline   Reply With Quote
Old 07-14-2016, 05:55 PM   #6
silvam14
Hall Of Famer
 
silvam14's Avatar
 
Join Date: Apr 2004
Location: Dedham, MA
Posts: 7,240
Thanks: 1,334
Thanked 6,047x in 2,166 posts
Ah. The images need to be 1024x 1024


Sent from my iPhone using Tapatalk
__________________
Senior "Nancy Boy" of the OOTP Boards
_______________________________________________
silvam14 is offline   Reply With Quote
Old 07-14-2016, 09:20 PM   #7
Hockey13Playa
All Star Starter
 
Hockey13Playa's Avatar
 
Join Date: May 2012
Location: Michigan
Posts: 1,941
Thanks: 285
Thanked 1,851x in 819 posts
Been lurking in the shadows for a while as my OOTP addiction comes and goes several times a year :P

I am curious what is this all about? I don't really understand what's going on here but the ballpark post Adion posted looks frickin incredible...
Hockey13Playa is offline   Reply With Quote
Old 07-14-2016, 11:59 PM   #8
silvam14
Hall Of Famer
 
silvam14's Avatar
 
Join Date: Apr 2004
Location: Dedham, MA
Posts: 7,240
Thanks: 1,334
Thanked 6,047x in 2,166 posts
Quote:
Originally Posted by Hockey13Playa View Post
Been lurking in the shadows for a while as my OOTP addiction comes and goes several times a year :P

I am curious what is this all about? I don't really understand what's going on here but the ballpark post Adion posted looks frickin incredible...
That is the citi field park that comes with the game. now we add a skybox using google earth or any other group of images to create a 360 degree background for stadiums
__________________
Senior "Nancy Boy" of the OOTP Boards
_______________________________________________
silvam14 is offline   Reply With Quote
Old 07-15-2016, 09:26 AM   #9
adion
All Star Starter
 
adion's Avatar
 
Join Date: Apr 2006
Posts: 1,185
Thanks: 64
Thanked 715x in 366 posts
The files in the citi field are 1024 x 1007. I will try 1024 x 1024. Also, I tried using png's and they didn't work. I had to change them to jpg's.
adion is offline   Reply With Quote
Old 07-15-2016, 09:40 AM   #10
silvam14
Hall Of Famer
 
silvam14's Avatar
 
Join Date: Apr 2004
Location: Dedham, MA
Posts: 7,240
Thanks: 1,334
Thanked 6,047x in 2,166 posts
I just poked around a little yesterday editing the .KML file is very easy. Downloaded notepad++ all you have to do is replace the long and lat numbers with that of any location you want on each direction and you should be able to grab some decent images quickly. The only problem I've seen is that it takes google earth longer than 10s to load all of the 3D objects fully so I need to figure out how to make that wait time longer. Pretty cool though. Might try to make some generic skyboxes for my fictional stadiums and stuff


Sent from my iPhone using Tapatalk
__________________
Senior "Nancy Boy" of the OOTP Boards
_______________________________________________
silvam14 is offline   Reply With Quote
Old 07-15-2016, 11:59 AM   #11
Jorin Guderian
Global Moderator
 
Jorin Guderian's Avatar
 
Join Date: Apr 2014
Posts: 90
Thanks: 4
Thanked 89x in 42 posts
Hey silvam,
making the wait time longer is easy too:
Under every block with the longitudes etc is a block like this:

<gx:Wait>
<gx:duration>10.0</gx:duration>
</gx:Wait>

Just change the duration value and you have a longer wait time. An alternative is also to let google jump through all locations and then just grab the time slider so the going though all camera positions starts again. But this time a lot of the content google earth needs should be in the cache, so it loads up quicker.
Jorin Guderian is offline   Reply With Quote
Old 07-15-2016, 03:13 PM   #12
adion
All Star Starter
 
adion's Avatar
 
Join Date: Apr 2006
Posts: 1,185
Thanks: 64
Thanked 715x in 366 posts
Quote:
Originally Posted by Jorin Guderian View Post
Skyboxes howto:

As a new feature, support for skyboxes has been added to OOTP17.
A skybox or cube map is basically a panorama made up from 6 images
where each image represents one side of a box. The viewer is in
the center of the box and gets the illusion that he is in the space
from where the pictures were taken. See

https://en.wikipedia.org/wiki/Cube_mapping

The stadium is located inside
such a box so that you can see the panorama from inside the stadium
behind the stadium limits. So far we only have added a skybox to to the
Citi Field stadium, but soon we will have panoramas for all MLB stadiums.
Feel free to create skyboxes for your own stadiums.
If you have skybox images, making the skybox show up around a stadium is very simple:
For a day skybox just add a folder named

"sky_box_day"

inside your stadium model folder and put the 6 images inside that folder named

xn, zp, xp, zn, yp, yn (see attached image).

In case of a night skybox do the same but name the folder

"sky_box_night"

and that is it! Supported formats for the images are webp, jpg and png.

The sides of the skybox are parallel to the infield diamond, see top view image in the attachement.


To have the skybox pointing in the right direction, the side of it that is behind the right side of the outfield is always xn
and the ordering of the images around the viewer is: xn,zp,xp,zn. and yp and yn are on top and bottom of "zp".
For better understanding just load all images in separate windows and place them becide each
other so you'll see which side connects to what side.
You can have the same skybox loaded on other stadiums if you just copy over the sky_box folder.


I will now show how to create skyboxes using google earth:
The idea is the following:
You can create tours in google earth and save them as KML files so
when double clicking on an KML file you will jump from tour location to tour location inside
google earth. On the other hand these KML files can be loaded in a text editor and edited by hand.
What is needed is just a tour where the camera basically stays at the same location but fist look in
one direction, then turns araound by exactly 90 degrees, then do it again, again and again, then look up
and then look down. At each "location" it should wait for about 10 seconds.
When having such a tour KML, all we have to do is taking 6 screenshots one after the other, then
cut out what we don't want to see and name the resulting screenshots the right way.

Now step by step:
If you don't have 3D buildings right away, aktivate them first in the side pannel of google earth.
In the attachement is a zip file containing all KML files for the MLB stadiums.

Pick one KML file and open it in a text editor (notepad++ for example).
You will see 6 blocks like this one with the right indentation which has got lost here:

<gx:FlyTo>

<gx:duration>1.0</gx:duration>

<Camera>

<longitude>-117.882735</longitude>

<latitude>33.800306</latitude>

<altitude>80</altitude>

<heading>140</heading>

<tilt>90</tilt>

<range>0</range>

<altitudeMode>relativeToGround</altitudeMode>

<gx:horizFov>91</gx:horizFov>

</Camera>

</gx:FlyTo>

By the numbers in the longitude, latitude and altitude(in meters) blocks it discribes where the camera should be placed on earth.
The heading block controls the direction the camera is looking to in degrees. As orientation we use the right foul
line when looking from the homeplate to the field. When the right foul line points exactly to the north, then heading is
0 degrees. But lets say it points in north east direction, then we would have to turn the whole stadium around the y axes
of about 45 degrees to make the foul line point north. This 45 is the value for heading then.
To find the decimal longitude and latitude of a stadium, start google earth, go to Tools->options and in the first tab "3d View" choos under longitude/latitude
the frist point "decimal degrees" and hit ok. Then search your stadium or location with the search bar. In the tool
bar click on add placemark. A window will pop up where you can name the placemark etc in which you will see the decimal
longitude and latitude values. Just copy these values and replace the values in the <longitude> / <latitude> blocks with these
values. When you now look at the navigation bar, north should be on top of the circle. When the stadiums right foul line
is not pointing north, then just grap the "N" on the cycle to cycle the view till the stadiums foul faces
straight ahead from the viewer. When you now look at the "N" you can approximately read the degrees from it for the
heading value. When N is for example on the top left of the cycle at 45 degrees, then heading is 45 degrees. If it is
on the right side at same hight, then this would be 360 - 45 = 315 degrees.
So, that is how you get the heading value for the first image.
The next 3 <gx:FlyTo> blocks look the same they only have different values for heading. So the next image on the right
of the first image will have the value for heading + 90 degrees. The third image will have heading + 90 + 90 and
the 4th will add 90 + 90 + 90 to the first heading value. For the blocks to create the top and bottom views, we first
copy the second block. For the top we change the <tilt> value from 90 to 180 and for the button we change it to 0.
Now we are allmost ready to take the screen shots, but some words to this first:
First of all, the boxes sides have to be exactly square. That means whe have to scale the window till it is exactly square.
To do that, one can make a screenshot of the inner area of the google earth window and and then check the dimensions
of the resulting image, if for example the width has to be one pixel wider or smaller. In the end we need screenshots
that are power of two, meaning width and height dimensions have to be something like 128,256,512,1024,2048 etc.
A good choice is 1024x1024.
It is also possible to take the screen shots in other dimensions, but then, the images have to be resized using an image viewer
later on.
To take the screenshot, any screenshot tool or image viewer with that kind of functionality can be used.
I can recommand irfanview. When hitting "c" in irfanview, a
screenshot configuration panel comes up where you can say where you want the screenshots to be saved. You can also
choose from different screenshot modes. One mode takes shots of the inner area of a window which is in focus, it should
be the 4th option. So, when we now take a shot with irfanview of the canvas area of google earth, we first have
to deactivate all toolbars, and pannals. But the uppest toolbar we can't remove. Also about the first 4 pixels
on the left side of the canvas will be a bit darker to give the illusion that the window frame around the canvas casts
a shaddow. When we would now just put the images together, you would notice a seam and of cause the toolbar in the top
of the panorama. To get rid of it, I made the cameras field of view a bit wider than 90 degrees to be 91 so we can cut of
a bit and the resulting images will fit together perfectly. So when considering the window size, you have to keep in mind first
how much you will cut off. So, that we are ready now, click on the kml file, wait for it to start up and at the first view
wait long enough till the timeline dissapears to take the first shot. After each angle change wait long enough so google
earth will have enough time to download all the content to make everything look pretty.
Hint: Use the same settings as we do to get a good image quality, see image.

Have fun,
Jorin
Here is my shot with this using Silvam's League Field. It works fairly well, with a little pixelization in the background. I made 3 folders, sky_box_day, sky_box_ night and sky_box_evening, all with different jpg's appropriate to that time of day. When I look at it in game with the 3D editor, the only thing that shows up is the day time sky box no matter what a select, i.e. day, evening or night. How do I get the others to show up?

Thanks,
Alan

I just used the exact same process on another Silvam park, Cleveland stadium and it didn't work. The skybox did not show up in the editor. As a test, I transferred the skybox files that worked on League field to the Cleveland Stadium folder and they don't show up either. I guess there is something I don't understand.
Attached Images
Image 

Last edited by adion; 07-15-2016 at 05:14 PM.
adion is offline   Reply With Quote
Thank you for this post:
silvam14 (07-15-2016)
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:50 PM.

 

Major League Baseball trademarks and copyrights are used with permission of MLB Advanced Media, L.P. Minor League Baseball trademarks and copyrights are used with the permission of Minor League Baseball. All rights reserved.

The Major League Baseball Players Association (www.MLBPLAYERS.com ) is the collective bargaining representative for all professional baseball players of the thirty Major League Baseball teams and serves as the exclusive group licensing agent for commercial and licensing activities involving active Major League baseball players. On behalf of its members, it operates the Players Choice licensing program and the Players Choice Awards, which benefit the needy through the Major League Baseball Players Trust, a charitable foundation established and run entirely by Major League baseball players. Follow: @MLB_Players; @MLBPAClubhouse; @MLBPlayersTrust

Out of the Park Baseball is a registered trademark of Out of the Park Developments GmbH & Co. KG

Google Play is a trademark of Google Inc.

Apple, iPhone, iPod touch and iPad are trademarks of Apple Inc., registered in the U.S. and other countries.

COPYRIGHT © 2017 OUT OF THE PARK DEVELOPMENTS. ALL RIGHTS RESERVED.

 

Powered by vBulletin® Version 3.8.10
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Copyright © 2018 Out of the Park Developments