Elvas Tower: Questions on terrain mesh - Elvas Tower

Jump to content

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

Questions on terrain mesh Rate Topic: -----

#11 User is offline   Lindsayts 

  • Superintendant
  • Group: Status: Elite Member
  • Posts: 1,849
  • Joined: 25-November 11
  • Gender:Male
  • Country:

Posted 10 April 2014 - 11:18 PM

View PostHack, on 10 April 2014 - 08:51 PM, said:

TML Studios did this with their Line 51 add-on several years ago - no terrain tiles whatsoever - everything was a modeled as city blocks and carefully stitched together in the sim. The add-on was probably not as extensive as the Cal-P or other routes, but was interesting on how TML approached the issue with terrain (or lack thereof). FWIW, you were forced to view everything from street level without any free roam cameras. I never sat down to figure out how it was all done, however.



Openbve works in a nearly identical way, I myself do not believe this is suitable for a sim that can cover as much area is some of the MSTS routes cover, the Adelaide hills route has 600 miles of main line to name just one.

LIndsay

#12 User is online   James Ross 

  • Open Rails Developer
  • Group: Status: Elite Member
  • Posts: 5,491
  • Joined: 30-June 10
  • Gender:Not Telling
  • Simulator:Open Rails
  • Country:

Posted 11 April 2014 - 12:19 AM

View PostGenma Saotome, on 10 April 2014 - 01:49 PM, said:

I'm fed up with the inability to represent ditches along the ROW; fed up with the inability to match terrtex art in shapes and so I've been thinking about replacing some or all of the terrain mesh with either a terrain model or a MSTS terrain mesh file that has more vertices than normal. I'm curious if there is anything about OR that would barf if I removed all of the mesh and/or inserted new verticies into the MSTS terrain file.


I've not looked at the code in a while so this might not all be right but...

  • You should be able to skip entire terrain tiles by simply omitting the appropriate .t files without affecting the scenery, and replace it all with models.
  • You could remove individual vertices from the terrain (like tunnel entrances) along the ROW and replace that part with models (some routes do a similar thing by simply lowering the terrain along the ROW and placing models over the 'hole').
  • In may not work without a little fixing up of the OR code, but in theory the .t files contain the number of patches and vertices and so on, so you could make individual tiles "high res".


I do not believe the data files could cope with each patch being a different resolution, simply because the data is stored in a single block (in the .raw files) for each entire tile. (Something we might want to fix when we design our own terrain formats.)

#13 User is offline   Genma Saotome 

  • Owner Emeritus and Admin
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 15,359
  • Joined: 11-January 04
  • Gender:Male
  • Location:United States
  • Simulator:Open Rails
  • Country:

Posted 19 April 2014 - 11:58 AM

I'd like to try an experiment...

Here's a terrain mesh I whipped up in Sketchup, something I think replicates one patch:
Attached Image: Collada Tile.jpg

and the colada data for that:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
    <asset>
        <contributor>
            <authoring_tool>SketchUp 8.0.16846</authoring_tool>
        </contributor>
        <created>2014-04-19T19:25:37Z</created>
        <modified>2014-04-19T19:25:37Z</modified>
        <unit meter="0.02539999969303608" name="inch" />
        <up_axis>Z_UP</up_axis>
    </asset>
    <library_visual_scenes>
        <visual_scene id="ID1">
            <node name="SketchUp">
                <instance_geometry url="#ID2">
                    <bind_material>
                        <technique_common>
                            <instance_material symbol="Material2" target="#ID4">
                                <bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0" />
                            </instance_material>
                        </technique_common>
                    </bind_material>
                </instance_geometry>
            </node>
        </visual_scene>
    </library_visual_scenes>
    <library_geometries>
        <geometry id="ID2">
            <mesh>
                <source id="ID5">
                    <float_array id="ID8" count="2214">314.9606299212599 0 3937.007874015748 0 0 3937.007874015748 157.48031496063 -314.9606299212599 3937.007874015748 0 -629.9212598425197 3-314.9606299212599 </float_array>
                    <technique_common>
                        <accessor count="738" source="#ID8" stride="3">
                            <param name="X" type="float" />
                            <param name="Y" type="float" />
                            <param name="Z" type="float" />
                        </accessor>
                    </technique_common>
                </source>
                <source id="ID6">
                    <float_array id="ID9" count="2214">-0 -0 1 -0 -0 1 -0 -0 1 -0 -0 1 -0 -0 1 -0 -0 1 -0 -0 1 -0 -0 1 -0 -0 1 -0.5123155195785599 0.25615775978928 0.8197048313256962 0.8479983040050882 -0  -0  </float_array>
                    <technique_common>
                        <accessor count="738" source="#ID9" stride="3">
                            <param name="X" type="float" />
                            <param name="Y" type="float" />
                            <param name="Z" type="float" />
                        </accessor>
                    </technique_common>
                </source>
                <vertices id="ID7">
                    <input semantic="POSITION" source="#ID5" />
                    <input semantic="NORMAL" source="#ID6" />
                </vertices>
                <triangles count="512" material="Material2">
                    <input offset="0" semantic="VERTEX" source="#ID7" />
                    <p>0 1 2 2 1 3 4 0 2 5 2 3 6 0 4 4 2 5 5 3 7 8 6 4 9 10 11 7 3 12 13 14 15 16 6 8 17 18 19 20 21 22 23 7 12 24 25 26 27 28 29 30 31 32 33 34 35 23 12 36 37 38 39 40 41 42 27 29 43 44 34 33 33 35 </p>
                </triangles>
            </mesh>
        </geometry>
    </library_geometries>
    <library_materials>
        <material id="ID4" name="material">
            <instance_effect url="#ID3" />
        </material>
    </library_materials>
    <library_effects>
        <effect id="ID3">
            <profile_COMMON>
                <technique sid="COMMON">
                    <lambert>
                        <diffuse>
                            <color>1 1 1 1</color>
                        </diffuse>
                    </lambert>
                </technique>
            </profile_COMMON>
        </effect>
    </library_effects>
    <scene>
        <instance_visual_scene url="#ID1" />
    </scene>
</COLLADA>



The three lines that run out towards the right margin -- I deleted most of the data so I could show this example on a single page.


I'm pretty sure that everything outside to <mesh> to </mesh> can be literals. The first float array is obviously the X Y Z data and the third is labled for vertexes. I don't know what the second array is for. Unit of measure in this example is inches but I guess it could be meters if the "<unit meter="0.02539999969303608" name="inch" />" line said meter instead of inch.

How difficult would it be to create such a file from a route's terrain data? I'm guessing Open Rails creates the identical point and vertex data.

What I'd like to do is experiment w/ such an output file... import it into Sketchup and manipulate the points as if it were an ordinary shape, apply texture(s), and put a reference for it into the .w file. I know other CAD programs can import Colada too.

Any chance of getting this file produced for such an experiment?

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users