Light and camera with B3D pipeline

Blitz3D Forums/Blitz3D Programming/Light and camera with B3D pipeline

gotelin(Posted 2004) [#1]
I use B3D pipeline for b3d export from 3DStudioMax, but i can't see lights and cameras of 3D StudioMax.

Can you help me, please?
Where is a example with Lights only?
Where is a example with cameras only?

Tnaks for all


Gabriel(Posted 2004) [#2]
The b3d format doesn't support lights and cameras as far as I know. I believe you have to use the Pipeline extensions in order to load cameras and lights. Are you using those?


Jeremy Alessi(Posted 2004) [#3]
You need something like this:

extModel.EXT_Entity = New EXT_Entity
			
extModel.EXT_Entity = EXT_LoadEntity("Media/ModelsTextures/Background+Nodes.b3d",0)
					
camera = extModel.Ext_Entity\camera.EXT_Camera\camera
EXT_SetRenderCam(camera)
extCamX = EntityX(camera,True)
extCamY = EntityY(camera,True)
extCamZ = EntityZ(camera,True)
CameraRange(camera,500,1000)
CameraProjMode(camera,1)
campicked = 0
			
bg_pointer = Handle(extModel.EXT_Entity)
EXT_ActivateEnvironment(extModel.EXT_Entity)
EXT_UpdateEnvironment()
EXT_InitEntity.EXT_Entity(extModel\root)
EXT_UpdateEntity(extModel.EXT_Entity)
Animate(extModel\root,1)


Then you also need to call EXT_UpdateEntity(extModel.EXT_Entity) for all entities using animated lights etc...


3do(Posted 2008) [#4]
Hi everyone,

I know this is a very old post, but i'm getting mad now to export my camera animation from max to b3d using b3d pipeline, seems i can't make the code works.

could anyone please post some very basic code to load an exported camera from max and make it works in b3d?

thanks


IPete2(Posted 2008) [#5]
3Do,

Have you scoured www.onigirl.com for information re: Pipeline extensions?

It would seem that is one way to go, otherwise you could look into using Gile[s] as a parser of sorts, I think Gile[s] has the ability to see lights etc using a particular exporter from 3DSMax.

Check out www.Frecle.net - it may be an easier way to go, although I haven't actyually done this myself.

IPete2.


3do(Posted 2008) [#6]
thanks IPete2,


yes i checked the pipeline forum and help, but still the code doesn't work.

i thought it was very easy to do something like that, but my code skill is very limited.

I tried even to export an animated object from max, and load it in blitz, and everything works fine, i can see my beautiful teapot walk around
the scene

then i wanted just to make my camera follow the teapot, as parented, and hide the teapot, but the camera is freezed, i tried everything

i beg for some help, thanks


Dreamora(Posted 2008) [#7]
if you hide the parent of the camera, the camera is hidden as well -> hide = disable object

you need to use alpha 0 to hide it visually but still have it active.


IPete2(Posted 2008) [#8]
3Do,

No worries mate, pop into the code archives and oh bother that - here:

Function SuperCam(cam,ent,cspeed#,dist#,hite#,xrot#,tilt#)
TFormPoint 0,hite#,-dist#,ent,0
cx#=(TFormedX()-EntityX(cam))*cspeed#
cy#=(TFormedY()-EntityY(cam))*cspeed#
cz#=(TFormedZ()-EntityZ(cam))*cspeed#
TranslateEntity cam,cx,cy ,cz
PointEntity cam,ent
RotateEntity cam,xrot#,EntityYaw(cam),tilt#
End Function


Function takes the following...

Camera handle
Entity you want to follow handle
Speed at which camera will follow the entity
The distance it will try to stay at (based on the entity named)
The height it will try to stay at (based on the entity named)
Xrotation of camera
Tilt of camera

Try these settings

SuperCam(Camera_Handle, Teapot_Handle, 0.01,0,0,0,0)


and alpha out the teapot first.

IPete2.


3do(Posted 2008) [#9]
hey IPete2,

i'm trying the supercamera, it's a very good code, but still not working on my project. I mean that the camera doesn't follow the animated teapot (it's animated with keyframe in 3dmax and exported with b3dpipeline in .b3d)

i don't know that exactly, but i assume that when you load in the scene an animated object, its handle is static even if the object move around the scene, and that's why the camera cant follow my animated teapot and just point the static entity position

thanks anyway :-(


Gabriel(Posted 2008) [#10]
don't know that exactly, but i assume that when you load in the scene an animated object, its handle is static even if the object move around the scene, and that's why the camera cant follow my animated teapot and just point the static entity position

That's correct, I think probably because everything is parented to a dummy object with animated objects. That's how most exporters seem to work. Try FindChild() to get the handle of the object itself, and see if that gives you a changing position.


3do(Posted 2008) [#11]
Yes it works!!!!

thanks a lot guys, I used getchild() to get the teapot handle, then i parented the camera and everything works now!


IPete2(Posted 2008) [#12]
Cool stuff - well worked out chaps!

IPete2.