TrueVision3D 6.5 Open Prerelease

Miscellaneous Forums/General Discussion/TrueVision3D 6.5 Open Prerelease

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

hey cool, does that mean people will be able to show off what they have done with your wrapper soon?

The new registration system is in there, so I guess people will be able to release anything they like. I won't personally be releasing anything myself for some time yet, as I don't want to release sporadically here and there.

Gabe..how hard is to use TV3D wrapper with Bmax??

Not much harder than Blitz3d in my opinion. There are lots more functions, and lots of subjects you have to know about if you're going to use it all, but syntactically, I don't find it vastly different from Blitz3D.

One of the samples I used to bundle with the wrapper ( or probably still do, I have to rebuild the zip ) which does parallax mapping ( aka offset bump mapping ) on a sphere goes something like this :

SuperStrict

Import glimmer.tv3d65

Global pEngine:CTVEngine=CTVEngine.Create()
Global pWindow:CTVWindow=CTVWindow.Create(640,480,"Bump Test")
Global pScene:CTVScene
Global pInput:CTVInputEngine
Global pTextureFactory:CTVTextureFactory
Global pLightEngine:CTVLightEngine

Global BumpLight:Int
Global BumpTexture1:Int
Global DiffuseTexture1:Int
Global SpecularTexture1:Int
Global Sphere:CTVMesh




' Set Beta Key

' Initialize Windowed
pEngine.Init3DWindowed(pWindow.hWnd,True)

' SET WINDOW TO AUTORESIZE
pEngine.GetViewport().SetAutoResize(True)

'Tell it To display the FPS
pEngine.DisplayFPS(True)



' SCENE AND SPHERE MESH
pScene=CTVScene.Create()
pScene.SetBackgroundColor(0.2,0.0,0.0)

' LIGHTING

pLightEngine=CTVLightEngine.Create()
BumpLight=pLightEngine.CreatePointLight(_cTV_3DVECTOR(10,10,0),1,1,1,100,"Bump Light")

pTextureFactory=CTVTextureFactory.Create()
BumpTexture1=pTextureFactory.LoadBumpTexture("rockwall_height.bmp","Bump1",,,,30)
DiffuseTexture1=pTextureFactory.LoadTexture("rockwall.bmp","Diffuse1")

Sphere=pScene.CreateMeshBuilder("Sphere1")
Sphere.CreateSphere(20,24,24)
Sphere.SetPosition(0,0,40)

Sphere.SetMaterial(0)

Sphere.SetTextureEx cTV_LAYER_BASETEXTURE,DiffuseTexture1
Sphere.SetTextureEx cTV_LAYER_BUMPMAP,BumpTexture1
Sphere.SetTextureEx cTV_LAYER_HEIGHTMAP,BumpTexture1

Sphere.SetLightingMode cTV_LIGHTING_OFFSETBUMPMAPPING_TANGENTSPACE



'Init Input after main init
pInput=CTVInputEngine.Create()
pInput.Initialize()

'Main loop	
While(pWindow.AppQuit=False)
	
	If pWindow.Update()=True
				
		Update()
		Render()
		DoInput()
		
	End If

Wend

'pWindow.Close()

pLightEngine.DeleteLight(BumpLight)
pLightEngine=Null
Sphere.Destroy()
Sphere=Null
pTextureFactory.DeleteTexture(DiffuseTexture1)
pTextureFactory.DeleteTexture(BumpTexture1)
pTextureFactory=Null
pScene=Null
pInput=Null
pEngine.ReleaseAll()
pEngine=Null

GCCollect

End 	


Function Update()
	Sphere.RotateY(0.0001)
End Function


Function Render()
	
	pEngine.Clear(False)
	Sphere.Render()
	pEngine.RenderToScreen()
	
End Function


Function DoInput()
	If(pInput.IsKeyPressed(cTV_KEY_ESCAPE))
		pWindow.Quit()
	End If 	
End Function