Couple of Terrain Questions

Blitz3D Forums/Blitz3D Programming/Couple of Terrain Questions

SMoore(Posted 2004) [#1]
A couple of questions which will help my new project.

1). I know there's no direct command, but I hear its possible to texture each segment differently, how is this done?

2). The game uses a mouse as well as standard movement controls. Is there a way to get the program to recognise which segment of terrain the mouse is hovering over? (terrain is from a 3rd person view of your character on the map)

Thanks for any help


jfk EO-11110(Posted 2004) [#2]
1) Maybe you are refering to multitexturing solutions? I don' tknow much about it, but maybe you better use something like FLE that utilizes Mesh layers instead of Terrains. Terrains tend to wobble due to LOD ind therefore can be used almost only for water.

2) use CameraPick, PickedX and PickedY, then calculate the grid position using the terrain position, scale etc. Pretty simple formula if you once got it working.


TomToad(Posted 2004) [#3]
1) there are three ways that I know of. One would be to create a single texture that is the same size as the terrain and make each pixel of the texture a different color. Another way would be to use an alternate terrain routine other than the built in one. Also, if the game is simple enough that speed won't be an issue, you can create several terrains, each with its own texture, overlaid on top of each other.

2)CameraPick(camera,x#,y#) might be the command you're looking for.


SMoore(Posted 2004) [#4]
Thanks for the help.

CameraPick would be a use, but it goes on single pixel doesn't it? Is there a way to get pixel perfect detection from a 3d object? This would be useful for hovering mouse over other objects as well.

The texturing ideas are good. Overlaid terrains are the most viable so far. What I'm looking for more than anything is texturing sand towards water and grass inwards. Changing Pixel colours would workfor areas of different colours (hill tops etc.)


wizzlefish(Posted 2004) [#5]
1) Can't you make a whole bunch of vertices and surfaces on a mesh and texture each individual one?

2) No clue.


Rob Farley(Posted 2004) [#6]
There's a great program called Terrain Shader written by a really talented guy that creates said textures for terrains. It also light maps it, shadow maps it, and wipes your arse. It's brilliant.

Note: It doesn't actually wipe your arse.

Anyway, if you got to my site check out the applcations and link to Idigicon... I don't get a penny for any copies sold so I've no reason to pimp it but it sounds like what you're after.


jfk EO-11110(Posted 2004) [#7]
You won't get a penny? what kind of deal is that anyway :/ ok, </rant off> yeah, Rob is a Vet in Terrain stuff.

If you want the terrain to be pickable, simply don't set any pickmode for other meshes. And Camerapick plus PickedX etc. will return the world coordinates of the recent pick. Of course when you know the position and scale of a terrain it will be easy to calculate the GRID location of the pick - as I said before.


sswift(Posted 2004) [#8]
1. No. A blitz terrain can only have one brush applied to it. That means one or two textures blended together and stretched or tiled over it.

2. Use camerapick. The X and Z value tell you the 2D location over which the picked terrain lies. You can divide this by some number defining the size of each tile and discard the remainder if you want to know which specific "tile" you're in.


Skitchy(Posted 2004) [#9]
http://www.dyvision.co.uk/ale.htm


Rob Farley(Posted 2004) [#10]
Or use a free version of vertex blending thingy (like ALE)

CLE.Zip


SMoore(Posted 2004) [#11]
Thanks for all the input.

So it looks like I'm gonna need to model the terrain externally and load into Blitz then? Which means I'll lose the LOD and an in game level editor, but I guess its better than nothing. Gonna have to have a fiddle around.

I'd heard you could do something to get to the vertices/polys in a terrain and change the texture to that bit. Never mind.


SMoore(Posted 2004) [#12]
One more thing...

I want to create some sort of distortion effect when a battle starts. If you've seen how Final Fantsy X distorts the screen when the enemies are already there, you'll know roughly what I mean.

I planned to use more cameraviews and give them some alpha (zoomed in a bit and layed on top of normal camera), but there doesn't seem to be a way to make camera view see-through. Anything I can do?


BlackD(Posted 2004) [#13]
after UpdateWorld/Renderworld just before you want to start doing such a distortion effect, create an imagebuffer and copy the backbuffer to it (before the flip). Create a bunch of sprites that you want to use for the twisty effect, and set the sprite texture to that of the image you've just snapped. Scale the sprites up to a decent size so they fill the screen. Now you have a bunch of sprites that you can manipulate to emulate the twisting effect of FFX.

With sprites though, alpha isn't necessarily as controllable as you might want - so another way to do it is not use sprite commands - create two-poly meshes (ie, a square) with a surface texture of that "screenshot" image, and just use entityalpha as you manipulate it to fade them out as they're turning.

+BlackD


SMoore(Posted 2004) [#14]
I tried that BlackD, putting some entitys up to the camera.

It worked, but had a couple of problems. Firstly, I couldn't for some reason put the whole screen onto a texture (probably a bad size or something) so I had to take 4 seperate shots for each quadrant. It caused a '+' on the screen where thew joints were.

Second, it wasn't very compatible with other computers. Only worked on some, others just got a shaded screen where texturing failed.

I could use it if I don't find a better way because the giant + problem isn't that bad, the compatibility issue is though.