Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / [DBC] Auto Skybox Generation

Author
Message
Omen
18
Years of Service
User Offline
Joined: 7th Nov 2006
Location: Maple Grove, MN US
Posted: 17th May 2007 19:41 Edited at: 17th May 2007 19:48
Here's a little skybox code that will auto-generate a set of skybox textures using whatever you have for your current terrain (and/or objects in your zone) and some simple camera work. Pretty simple bit of code, really - getting the right FOV was the only tricksy part.

Just build your terrain, and call this function before or after placing building/trees or whatever else you have in your zone.

terrainCenterX, terrainCenterHeight, and terrainCenterZ are the DBPro coordinates from which you want the camera to snap the pictures for the skyboxes (this will probably be different for every terrain you use).

terrainSize is the length or width of the terrain (used to calculate a reasonable skybox size).

This works with any terrain type.

This could be improved using a cube sky.x object (to get rid of the very faint seams) instead of a set of PLAIN objects.

Enjoy!

Edit: Added the system function calls that this function uses


Here's the systemMakePlain and systemGetImage code this calls:



Login to post a reply

Server time is: 2024-11-22 19:12:24
Your offset time is: 2024-11-22 19:12:24