Jump to content

Joh

Members
  • Posts

    474
  • Joined

  • Last visited

Everything posted by Joh

  1. Could this help you? SetMaterialShader Could you should us the code? I am not sure, but myabe i know why..
  2. Well your model will be rendered on RenderFramework so in this case it will behind. Anyway i think it will be always behind as DrawImage probably work in callback..
  3. Joh

    ..rework..

    I remeber your guns in bmax
  4. What i am tryng to explain is that you use framewerk wich have 3 worlds in total.. With your cam you don't renderize those worlds, so the cam won't be able to see them. RenderWorld() With this command you renderize only the current world, so you will probably fix the problem when you'll renderize every world in the correct order.. So it should be BG, World and transparency.
  5. Well you could be able to do it, just changing the world goes on BG paint the buffer, so change the world again paint the buffer and find a way to merge the 2 image. Wich color you get where should be the skyboxes?
  6. Do you use Framework? If yes skyboxes is in another world. Backgorund if i don't remeber wrong.
  7. Joh

    Our entity system

    I used quite a lot amount of engines in last year and just a few have complicated math. The main difference is the amount of code to do something, as for example in torque i was obly to write 10 line of code to get the controller and 3 to update it, wich is almost 2 line in leadwerks. Unity isn't much harder then Leadwerks so just avoid to speak about it. Another good difference is that in leadwerks we could create a game by scratch but still be able to use framew(e/o)rk, that's help really much. I haven't really never used the tool wich are in leadwerks too, i prefer to code everything by myself. 3DVIA Virtools is also easy, just a little confusing, but also buggy. So porbably i prefer leadwerks because leave me the possibility to write code easly, without a bad own scrript lagnuages, with a big amount of own command (so i don't need to lose my time to check in any class of the engine to understand..).
  8. Can't try it now (i am working) but i'll do when i'll be in my home. Anyway i looked at it, and don't know why is working. ballControlPivot = CreatePivot() move = KeyDown(KEY_W)-KeyDown(KEY_S) strafe = KeyDown(KEY_D)-KeyDown(KEY_A) force = Vec3(strafe*Speed,0,move*Speed) force = TFormVector(force,ballControlPivot,nil) ballBody:AddForce(force,1) ballControlPivot.SetPosition(ballBody.GetPosition()) This should work probably better.. Also in this case you could rotate your ball in any rotation without worryng about camera. EDITED: Noticed that ballPivot was already used..
  9. I don't like this answer So look this image The black lines are global space (the 3d coord.) the black square is your cam, and the red line are the local space of your cam. What are you doing is asking to calculate the force based on the cam pos and rot (wich is wrong if you wanna have a free cam) so probaly it will be better to create a pivot and place it in the same position of the ball and use that pivot to calculate the force, also if you wanna rotate the ball you should instead rotate the pivot. ballBody:AddForce(force,1) ARE YOU SURE THIS WORK??? It's really strange if it is.. Look here: AddBodyForce( body:TBody, force:TVec3 [, global:Int=1 ] ) This mean that as for default is 1.
  10. Of course it do! force = TFormVector(force,fw.main.camera,nil) In this part of code you are telling : Find the position of force (strafe and move so lateral and frontal) starting as camera current position and rotation (local space of camera). Tform TransFORM the space from global to local and so on. So using the camera as referred point it will find that point BASED on camera. You should use another entities if you don't want have weird movement.
  11. So this is the whole code? Seem strange.. Do you place the cam on the ball then? Do you rotate the cam in some way?
  12. Just sorry me.. It's monday.. Just a fast question.. Did you place the whole scene into a mesh? Anyway i didn't refered to that command but to this one (entity.collisiontype finally in lua ) If the mesh are separated (each one) you surely used a collisiontype to let it collidable, so you could set a different collision type to check if you can pick them or not. In this case you simply could do the pick testing and check if that mesh is of that specific type.
  13. Could you show us the whole code so we can try to help you?
  14. Ok i'll try, so many time i don't use bmax.. Anyway you can always set a different type to a mesh (EntityType) And check if that picked object is that type. (GetEntityType) If you don't need this just explain exactly what you need. Almost everything it can be done using filters, wich is a sort of callback function that return 0 to skip or 1 to check the raycast.
  15. Could you show the "defeinition" of ballbody? You need to set the damping correctly.
  16. Just pick that object then! Use a different type value and use filter.
  17. WHAT??? This doesn't exist.. Your screen is 2d Well i think you mean how to transform from 2d to 3d pos right? Check CameraProject , CameraUnproject . Also wich language you need? We could help you better if we know the language.
  18. It show you how to create a simply cube, apply a material and rotate a mesh. Never heard about "hello world"? Those are the "basic" of the engine, if you don't know how to manage it you won't be able to do anything!
  19. What? Wich tutorial you followed? Those are little tutorial to let you program simply things. There isn't a tutorial wich allow you to create an entire game..
  20. There are a lot of tutorial on the web on c++, some are really easy to use. If your main objective is to become a programmer so i really suggest to start from there, if you only wanna design and create your own game on Leadwerks, you don't need to study a lot as Leadwerks use is own command. Anyway in both cases you always need the base of programming.
  21. Joh

    More thingoids!

    Should be done for me too.
  22. I played a lot with UDK and i also saw Unity and other Professional engine, Unity a part, the main difference from professional engine to Leadwerks is the easy way to use it. Leadwerks (and i must Unity too) is really easy and you could create a game even alone. This isn't the same as for other engine i saw. P.s. UDK use his own script, unity use c#,UnityScript/Javascript.
  23. Nice demo. A little suggestion maybe you can try to let your ai predict where player is going, as for now it seem more following the last position where player is.
  24. Joh

    Drag'N'Drop

    Yeah something like this.. I haven't tested it. 'Use the Leadwerks Engine module as our base Framework leadwerks.engine 'Create an OpenGL graphics window Graphics 800, 600 'Allows the engine to find files and load files from zip packages RegisterAbstractPath AppDir 'Create a world If Not CreateWorld() RuntimeError "Failed to create world." 'Create a camera cam:TCamera = CreateCamera() CameraClearColor(cam, Vec4(0, 0, 1, 1)) MoveEntity cam, Vec3(0, 30, -10) 'create a ligt light:TLight = CreateDirectionalLight() RotateEntity(light, Vec3(65, 45, 0)) 'Create a render Buffer buffer:TBuffer = CreateBuffer(800, 600, BUFFER_COLOR | BUFFER_DEPTH | BUFFER_NORMAL) 'create a mesh cube:TMesh = CreateCube() sphere:TMesh = Createsphere() positionentity sphere,vec3(0,10,0) Local pick:TPick 'create materials selectionmaterial:TMaterial = CreateMaterial() SetMaterialColor(selectionmaterial, Vec4(1, 0, 0, 1)) pointentity cam , cube debugphysics(1) depth:Float = 0.0 near:Float = 1.0 far:Float = 10.0 'MODIFY local pick:TPick = null 'Main loop While Not KeyHit(KEY_ESCAPE) 'MODIFY local check:int = false 'pick objects with the mouse If MouseDown(1) 'MODIFY check = true PaintEntity(cube, 0) PaintEntity(sphere, 0) 'MODIFY if pick = null pick = CameraPick(cam, Vec3(MouseX(), MouseY(), 1000)) endif If pick Then PaintEntity(pick.entity, selectionmaterial) glReadPixels(MouseX(), GraphicsHeight() - MouseY(), 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, Varptr(depth)) z:Float = near / (far - depth * (far - near)) * far; pos:TVec3 = CameraProject(cam, Vec3(MouseX(), MouseY(), z)) positionentity (pick.entity, Vec3(pos.x,pos.y,pos.z)) End If End If 'Update timing, physics, and other miscellaneous updates UpdateWorld 'Draw the world SetBuffer(buffer) RenderWorld 'MODIFY if check = flase then pick=null DrawText "Depth: " + depth, 0, 0 DrawText "Projected: " + pos.x + ", " + pos.y + ", " + pos.z,0,12 'render lighting SetBuffer(BackBuffer()) RenderLights(buffer) 'Swap the graphics buffers so we can see what we drew Flip Wend
×
×
  • Create New...