OpenB3D Infinite Plane

Started by Scaremonger, August 07, 2022, 10:26:33

Previous topic - Next topic

Scaremonger

Hi,

Is there something I need to do to convert a plane into an infinite plane in OpenB3D?

The code below gives me a plane (blue or textured if available), but it only extends from the camera. If I move the camera it doesn't extend anywhere except in a positive/positive direction from the camera location. I have converted a couple of Blitz3D samples and it does it with them too!

Si...

BlitzMaxNG + openb3d.B3dglgraphics:

SuperStrict

Framework Openb3d.B3dglgraphics
Graphics3D 800,600

Global ocean:TMesh = CreatePlane()
Local ocean_tex:TTexture = LoadTexture( "water.jpg" )
If ocean_tex
ScaleTexture( ocean_tex, 20,20 )
EntityTexture( ocean, ocean_tex )
Else
EntityColor( ocean, $00, $00, $7f )
End If

Local camera:TCamera=CreateCamera()
PositionEntity( camera,1,5,1 )

Repeat

If KeyDown( KEY_DOWN ) MoveEntity( camera, 0, 0, -1.0 )
If KeyDown( KEY_UP) MoveEntity( camera, 0, 0, 1.0 )

If KeyDown( KEY_LEFT )  TurnEntity( camera, 0,  0.5, 0 )
If KeyDown( KEY_RIGHT ) TurnEntity( camera, 0, -0.5, 0 )

UpdateWorld()
RenderWorld()
Flip

Until KeyHit( KEY_ESCAPE )

Scaremonger

Hi,

It appears that you need the optional argument "divisions" to be greater than 1 (default):


Global ocean:TMesh = CreatePlane(16)

markcwm

Hi Scaremonger,

If I remember, I didn't have a problem with CreatePlane(1) but good that you fixed it.

The infinite plane is based on Minib3d code by Slotman, but has subdivisions and uses FreeSurface instead of FreeEntity.