wesh
New Member
Posts: 6
|
Post by wesh on Jan 17, 2004 13:29:01 GMT
Hi!
Is that possible to have more exemple with the B3D extension, it seems very powerfull but I have some difficulties to use it.
For example, how can we switch beetween each camera of a model?
thank you
|
|
|
Post by pudding on Jan 18, 2004 23:08:01 GMT
The B3d Extensions library still requires you to activate cameras using normal Blitz3d commands. A quick example:
;-------------------------------------------------------------------- ; Demonstrates how to access camera extensions in b3d files ;--------------------------------------------------------------------
Include "B3dExtensions.bb"
file$ = Input("B3d File: ")
Graphics3D(640,480,32,2)
; Load file model = LoadAnimMesh(file$) If (Not model) RuntimeError("Invalid File")
; Initialize all B3d Extensions in hierarchy extModel.EXT_Entity = EXT_InitEntity(model)
; This test app needs a camera If (EXT_NumCameras(extModel)=0) Then RuntimeError("No Cameras in B3d File!")
; Activate first camera in hierarchy extCamera.EXT_Camera = extModel\camera EXT_UpdateCamera(extCamera) camera = extCamera\camera CameraProjMode(camera,1)
; Input Loop While Not KeyHit(1) ; Hit C to cycle through cameras If KeyHit(46) ; Deactivate current camera CameraProjMode(camera,0)
; Next Camera extCamera = extCamera\nextCamera ; No more cameras? If (extCamera = Null) ; Loop back to first camera extCamera = extModel\camera EndIf ; Activate new camera EXT_UpdateCamera(extCamera) camera = extCamera\camera CameraProjMode(camera,1) EndIf ; Blitz Update UpdateWorld() RenderWorld() Flip
Wend
Hope this helps...
-Pudding
|
|
wesh
New Member
Posts: 6
|
Post by wesh on Jan 22, 2004 12:14:04 GMT
Hi!
Thank you for your reply pudding. I'd like to have another exemple (again!!) with the occluder.
My mesh is composed by 2 groups, one which is the outdoor and the other is the interior. So I'd like to set the exterior to an occluder. So when the camera in outside, I could hide the interior. I'd like to know if it's possible? if yes, how could I do that?
thank you
|
|
|
Post by pudding on Jan 24, 2004 19:40:34 GMT
The occluder code if very simple. If you look at the function EXT_UpdateOcclude() in Occlude.bb you'll see that it hides/shows an entity based on EntityVisible. You just have to call EXT_UpdateEntity() in your game loop.
For objects you want occluded by other objects add a B3d Render modifier and check "Occluded by Obscurer"
For objects you want to obscure other objects add a B3d Collisions modifier and set its "Pick Mode" and check "Obscurer"; depending on the pick mode, you will also need to edit the Collision Sphere/Box.
I'm hoping to include some sample Max scenes in the next release to better demostrate how the extensions can be used.
-Pudding
|
|