Inifinite Plane

BlitzMax Forums/OpenGL Module/Inifinite Plane

simonh(Posted 2006) [#1]
In OpenGL how would you go about creating an infinite plane like that created by B3D's CreatePlane command (with optional segments value)? Is there some trickery involved?


VIP3R(Posted 2006) [#2]
One way is to create a quad that's of the same dimensions as the camera range (or slightly larger). Then you position the quad at the same location (on X/Z axis) as the camera and offset it by the length of the texture scale.

If you take a look at the JV-ODE Car Demo, you can see the following code...

DrawPlane(PivotX-(PivotX Mod 20),0,PivotZ-(PivotZ Mod 20))

The PivotX and PivotZ are the camera coordinates and 20 is the length of the texture in relation to the size of the quad.

It's the same principle as tiled scrolling in 2D 360 shooters etc.


Morbius(Posted 2006) [#3]
I'm still trying to implement this for a minib3d game. Do you move the quad(s) in the updateworld loop and scroll the uv's on the texture?

Sorry, I'm having a tough time with this one.

Thanks

Mike


VIP3R(Posted 2006) [#4]
Is there no infinite plane in MiniB3D yet?

You don't need to scroll the UV's, only position the quad at the same location as the camera and offset it. The center of the quad should never be more than the length of the texture from the camera position.


Morbius(Posted 2006) [#5]
Thanks! I think I've got it now. Will give it a go.