Entityvisible donīt work!!!!!!!!!!!!!
Blitz3D Forums/Blitz3D Programming/Entityvisible donīt work!!!!!!!!!!!!!
| ||
see the code below between the cube and the sphere have a obstacle (another "small" cube) the cube canīt "see" the sphere throung the another small cube, but donīT desappear!! Why????? ;Entityvisible Example ; -------------------- Graphics3D 640,480 SetBuffer BackBuffer() camera=CreateCamera() pessoa=CreateSphere() PositionEntity camera,0,2,-10 PositionEntity pessoa,0,2,-5 light=CreateLight() RotateEntity light,90,0,0 plane=CreatePlane() cube=CreateCube() cube2=CreateCube() PositionEntity cube,0,1,0 PositionEntity cube2,0,1,5 ScaleEntity cube2, 5,5,5 While Not KeyDown( 1 ) If KeyDown( 205 )=True Then TurnEntity camera,0,-1,0 If KeyDown( 205 )=True Then TurnEntity pessoa,0,-1,0 If KeyDown( 203 )=True Then TurnEntity camera,0,1,0 If KeyDown( 203 )=True Then TurnEntity pessoa,0,1,0 If KeyDown( 208 )=True Then MoveEntity camera,0,0,-0.05 If KeyDown( 208 )=True Then MoveEntity pessoa,0,0,-0.05 If KeyDown( 200 )=True Then MoveEntity camera,0,0,0.05 If KeyDown( 200 )=True Then MoveEntity pessoa,0,0,0.05 RenderWorld If EntityVisible(cube,pessoa)=False HideEntity cube Else ShowEntity cube EndIf Flip |
| ||
EntityPickMode entity,pick_geometry[,obscurer] Parameters entity - entity handle pick_geometry - type of geometry used for picking: 0: Unpickable (default) 1: Sphere (EntityRadius is used) 2: Polygon 3: Box (EntityBox is used) obscurer (optional) - True to determine that the entity 'obscures' other entities during an EntityVisible call. Defaults to True. Description Sets the pick mode for an entity. The optional obscurer parameter is used with EntityVisible to determine just what can get in the way of the line-of-sight between 2 entities. This allows some entities to be pickable using the other pick commands, but to be ignored (i.e. 'transparent') when using EntityVisible. So, its very much EntityVisible specific. Please note that only Sphere and Box picking will work with Blitz3D sprites. For polygon picking, you will need a valid mesh. See also: EntityPick, LinePick, CameraPick, EntityPickMode. |
| ||
As GfK pointed out: You need to set an entity pick mode for your entities, as well as whether they obscure other entities. |
| ||
But! someone have EntityPickMode, EntityPick and LinePick examples??? please!!! |
| ||
You don't need to use linepick, entitypick. Just give the entity's you want to be in the way, entity pickmode, using polygon detection. |
| ||
You have some example? someone have some example??? Iīm beginner Best Resgards!!! |
| ||
...o.O (its my day for this...) F1 is your friend.... EntityPickMode [F1][F1] (Edited.. I cocked it up) |
| ||
RTFM (!!!!!!!!!!!!!!) :P (Read The Fantastic Manual, especialy the command reference) Or type Entitypickmode in the editor, then position the cursor on the command and Press the F1 key twice... Example: cube=createcube() EntityPickMode Cube,2 ... while game ... You may be a beginner, but you need to learn how to read / use the manual / command reference. |
| ||
Agoeiro, I'm not being funny but I've posted the bit of the bloody manual you need to look at! All you've got to do is read it. |
| ||
I need a simple and functional Culling system!!! please! |
| ||
Would you also like us to code the rest of it? Programming isnt easy from the word go and no, everyone else wont do the coding for you. For us to help you you must help yourself too. |
| ||
I have modified your example. It demonstrates the limitations of entityvisible for culling purposes. Proper culling is not easy. Entityvisible basicly casts a ray from the origin of the source entity to the origin of the destination entity. If the ray is interupted by an obscurer then it is deemed that the source entity can not see the destination entity. ;Entityvisible Example ; -------------------- Graphics3D 640,480 SetBuffer BackBuffer() camera=CreateCamera() pessoa=CreateSphere() EntityColor pessoa,0,200,0 PositionEntity camera,0,2,-20 PositionEntity pessoa,0,2,-5 light=CreateLight() LightColor light,100,100,100 RotateEntity light,45,45,0 plane=CreatePlane() EntityColor plane,0,100,0 cube=CreateCube() EntityColor cube,0,0,200 cube2=CreateCube() EntityColor cube2,200,200,0 EntityPickMode cube2,2,True PositionEntity cube2,0,1,5 ScaleEntity cube2, 5,1,1 PositionEntity cube,0,1,0 EntityColor cube,200,100,0 While Not KeyDown( 1 ) If KeyDown( 205 )=True Then TurnEntity camera,0,-1,0 If KeyDown( 205 )=True Then TurnEntity pessoa,0,-1,0 If KeyDown( 203 )=True Then TurnEntity camera,0,1,0 If KeyDown( 203 )=True Then TurnEntity pessoa,0,1,0 If KeyDown( 208 )=True Then MoveEntity camera,0,0,-0.1 If KeyDown( 208 )=True Then MoveEntity pessoa,0,0,-0.1 If KeyDown( 200 )=True Then MoveEntity camera,0,0,0.1 If KeyDown( 200 )=True Then MoveEntity pessoa,0,0,0.1 If EntityVisible(cube,pessoa)=False HideEntity cube Else ShowEntity cube EndIf RenderWorld Flip Wend |
| ||
Maybe he best uses BSP, this will cull automaticly. THen again it's only for static stuff, of course. |
| ||
Yes, or there is this sort of method which may be useful in certain situations, for visibility testing anyway. Can't say I have used it though. http://www.blitzbasic.co.nz/codearcs/codearcs.php?code=923 |
| ||
I,m thinking about the BSP system but have a limitation,for use BSP need to pay license fees to ID Software |
| ||
No you don't - only if you use ID Software tools to create them. |
| ||
I've been told that there ain't no other tools than the one of ID, is that right? Well, I guess it was Bob3D who told me this and I guess he knows what he's talking about. Agoeiro - you only need to pay for the license if you sell your product commercially, as far as I know. You should know that it is a very difficult thing to make something like a good VIS Occlusion. You need to learn Blitz first, and maybe then you can write a nice system. But be warned, it's not easy. An other solution would be to create your levels in a way that allows to reduce the camerarange to a low range. But then your level still has to be made of a lot of seperate meshes because if you use one huge mesh with a low camerarange, it won't make it faster since DirectX needs seperate mesh objects to skip them from rendering when they are out of the camera range. |
| ||
I want to create a commercial game using BSP levels I need pay license fee to ID Software???? what the soluction? |