Page 1 of 1

PB 4.30 : 3D - How to add a sight in a game -using Billboard

Posted: Thu Sep 25, 2008 9:55 am
by Comtois
as it is no longer possible to use the sprites or command ScreenOoutput () with the latest version of OGRE, here's a workaround.

i use this image
Image

et here how to use it

Code: Select all

;... Init code here

#Sight=0

;---------------------------------
;-Load texture and create material for the BillBoard
;---------------------------------

;-Texture
LoadTexture(#Sight,"viseur-jeux.png")

;-Material
CreateMaterial(#Sight,TextureID(#Sight))
MaterialBlendingMode(#Sight, #PB_Material_AlphaBlend)
DisableMaterialLighting(#Sight, 1)

;-Billboard
CreateBillboardGroup(#Sight, MaterialID(#Sight), 1, 1)
AddBillboard(0, #Sight, 0, 0, 0)

;Add camera etc 

Repeat

  ;-Some code here 

  ;-How to use    
  PointPick(0, Screen\Width/2, Screen\Height/2)
  BillboardGroupLocate(#Sight, CameraX(0)+ PickX()*15,CameraY(0)+ PickY()*15,CameraZ(0)+ PickZ()*15)	
  RenderWorld()
Until Condition