Cylinder terrain, "Rendezvous with Rama"

a while ago i started making a fps game using jme, and so far so good… a lot has been made so far and i

How is your terrain organized? Are you using a tiled approach or a single mesh?



Easiest way I can think of is with a tiled approach. I don't know the math off the top of my head, but I would make a class to manage the math of placing the tiles in a cylindrical grid. That way you can simply add your terrain pieces to your cylinder terrain manager at grid(x, y) and it would handle the transformations.



Do you have any screen shots you want to share?

the tiled approach is also what i had i mind a while ago… but currently i'm not sure if it's better to use a single terrain mesh or multiple ones… i'd preffer a single mesh and figure the math for it to map it on a cylinder :expressionless: but multiple meshes organized to form a cylinder will do just as fine :lol:



be right back with the screenies :slight_smile:


I agree with the tiled approach.

I haven't read the book, but going off the video the cylinder is supposed to be vast.

Even if it was flat, you would probably do a terrain that big in many smaller blocks. Arranging them in a cylinder would be only a little extra work.



Also, it being so big, the hull would be very close to flat at ground level anyway (in fact it probably would be as the infrastructure is covered in concrete and earth which would presumably be levelled off).



Interesting stuff!

ok, so i’m going with the tiled approach as initially planned…



screenies on request:









ps: the blurry sky and depth of view i made using a trick with the bloom pass… :smiley:

blue_veek said:

http://www.youtube.com/watch?v=UiO8CgGiWPM

that video looks cool.
i guess its not rendered in real time, there is so much landscape / city / trees/ clouds visible that it would kill the fps if rendered realtime.

To achieve something similar with jme you need very good level of detail and culling techniques.

Your Screenshots with the modified bloom pass looks awesome  :), the gui looks good also, i like the edges.

Not too sure there should be a star visible though  :?


Your Screenshots with the modified bloom pass looks awesome  :), the gui looks good also, i like the edges.


thanks  :D

Alric said:

Not too sure there should be a star visible though  :?


the edges of the cylinder will be transparent, and there will be many, many, many  :D stars visible over there

i reckon getting the gravity fluctations right between the centre of the cylinder and the "ground" would make for an interesting physics challenge…plus it would be cool to do things in .5g like dead space…

ncomp said:

i reckon getting the gravity fluctations right between the centre of the cylinder and the "ground" would make for an interesting physics challenge...plus it would be cool to do things in .5g like dead space....


that's a whole different challenge than the cylinder terrain, but we're getting it sorted out :)
anyway, the cylinder terrain is now complete, and this is how i did it, fair and simple
maybe others might need this:

   
public CylinderMap(TerrainBlock[] ter, Vector3f pos, float size) {
        float total = ter.length;
        float distance = (float) (size / (2f * Math.tan(Math.PI / total)));

        float x0 = pos.x;
        float y0 = pos.y;
        pos.z -= size / 2f;

        for (int k = 0; k < total; k++) {
            float alpha = (float) (((2f * Math.PI / total) * k) - (Math.PI / 2f) + (Math.PI / total));

            float x1 = (float) (x0 - distance * Math.cos(alpha));
            float y1 = (float) (y0 + distance * Math.sin(alpha));

            SceneModifier.Object.Transform.translate(x1, y1, pos.z, ter[k]);
            SceneModifier.Object.Transform.rotate(0, 0, -(360f / total) * (float) k, ter[k]);
        }
    }



and this is kinda' how it looks:


edit: now i notice, don't be scared about the


SceneModifier.Object.Transform.translate(x1, y1, pos.z, ter[k]);
SceneModifier.Object.Transform.rotate(0, 0, -(360f / total) * (float) k, ter[k]);


they work just like normal jme functions, those above are just some utility classes i made for myself..
you cand use something like this instead:


ter[k].setLocalTranslation(new Vector3f(x1, y1, pos.z); //to set translation
ter[k].getLocalRotation.fromAngles(0, 0, - (2f * Math.PI / total) * (float) k); //to set rotation



Hey nice job! What are you using for your interface/hud?

NICE!  Thanx for sharing :slight_smile:



This has a perfect spot in an upcoming project o' mine :smiley:

nymon said:

Hey nice job! What are you using for your interface/hud?


i made my hud from scratch.. i'll share my code if anyone wishes..

basixs said:

NICE!  Thanx for sharing :)

This has a perfect spot in an upcoming project o' mine :D


glad to be of help..  :D