Need help with camera/Clipping Cam range
Blitz3D Forums/Blitz3D Programming/Need help with camera/Clipping Cam range
| ||
Hi all Is there a code that I can use for loading my terrain and don't apply the cam clipping range on this one? How can I use the CameraRange cam,0.1,1500for clipping my objet from the visual object like trees or building BUT NOT my terrain. This code is working great for removing the clipping range of the camera on my skybox but doesn't work with my terrain mesh_skybox = MakeSkyBox"data\textures\SkyBox\Sunset\sky") EntityOrder mesh_skybox, 7 This is the way I'm loading my terrain: For b=1 To MapSize For a=1 To MapSize map(a,b) = LoadAnimMesh(dir+MapToLoad+"("+a+","+b+").b3d") PositionEntity map(a,b),((a-1)*blocksize)-(blocksize/2),0,((b-1)*blocksize)-(blocksize/2) For c=1 To CountChildren(map(a,b)) chi=GetChild(map(a,b),c) UpdateNormals chi Next chi=GetChild(map(a,b),1) EntityType chi,EntityType_Ground If CountChildren(map(a,b)) >= 2 ;MONTAGNE TOUJOURS EN 2e POSITION chi=GetChild(map(a,b),2) ;EntityType chi,EntityType_Montagne EntityType chi,EntityType_Ground EndIf If CountChildren(map(a,b)) >= 3 chi=GetChild(map(a,b),3) EntityType chi,EntityType_Ground EndIf If CountChildren(map(a,b)) >= 4 chi=GetChild(map(a,b),4) EntityType chi,EntityType_Ground EndIf If CountChildren(map(a,b)) >= 5 chi=GetChild(map(a,b),5) EntityType chi,EntityType_Ground EndIf If CountChildren(map(a,b)) >= 6 chi=GetChild(map(a,b),6) EntityType chi,EntityType_Ground EndIf Next Next Any Help is welcome! |
| ||
You need to have separate objects. This is, you need that the trees and the terrain are separate entities. If you have all loaded with loadanimmesh, just make entityparent child,0 for every non terrain object... |
| ||
yes all my objects are loaded individualy. Is there a kind of Filter or tag that I don't know about that remove a certain objet from the cam clipping range... Like DontCountMeInTheCamRange (map(a,b)) |
| ||
Not directly related to your problem, but this is worth a look for anyone messing with the camera range: http://www.sjbaker.org/steve/omniv/love_your_z_buffer.html You should also take a look at: EntityAutoFade CameraClsMode You will probably be able to do what you want with either of the above. CameraClsMode is useful for doing multiple renders, adjusting the CameraRange for each one. Multiple renders will also be useful for your skybox (which can be quite small if you render it first). |