Jump to content

cocopino

Members
  • Posts

    201
  • Joined

  • Last visited

Posts posted by cocopino

  1. Hi Michael,

     

    I changed the name of the node mesh so there can be no confusion going on name-wise.

     

    Here's how it works:

     

    When dragging a node onto your scene, the editor will give it a name like cablenode_3. If there is another cablenode present in the scene, having an index number of 1 digit lower (in this case cablenode_2), the lua script will load a mesh (cables_mesh.gmf) between those two nodes and then scale it.

     

    You can use any mesh you like for this, but it has to be exactly 1 Leadwerks unit long in z-direction. The nodes can be made visible/invisible by changing the material to cablenode_diffuse.mat/cablenode_invisible.mat.

     

    The thickness of the cables can be changed by changing the property "Thickness". The material of the cables can be changed by changing the property "Material File". Note however that scaling the material may make the texture look bad. I'm hoping for a positive answer on my question about this in another thread to change that.

     

    Is this more or less what you're looking for?

    Cable.zip

  2. Just to frustrate you a little bit further Aggror: :)

    To have a really nice dropdown, it also needs a container with a background image and a slider (another image) so you can scroll through items.

    post-79-039534400 1280130248_thumb.jpg

  3. Hi,

     

    I have a model that I need to scale by code in one single direction (Y axis). This will scale the texture as well, making it look badly.

    Is there a command that allows me to change material/UV scaling programmatically?

     

    Thanks!

  4. Since it's a light, you'll probably need update() instead of draw() because draw() will only rotate the light when the light itself is being rendered. This will mean that it's not casting shadows and such when off screen.

    (I haven't tested this though)

  5. Isn't that kind of the norm these days for MMO's? Every MMO I've played in the last 5 years has been real-time and non point-n-click. They are pretty much all 3rd personm WASD.

    Really? (Ok, to be honest I never play MMO's)

    How does the interaction work? Is there realtime collision based fighting between 100+ players? This used to be impossible due to networking problems.

  6. It's interesting that it's being developed for PS3. Interesting because that will mean a real-time, non point-n-click MMO.

    Which probably means no more than 8-16 players in the same "room".

  7. I'm not completely skipping updating, but only one update per frame, which is how games are written also, so these should be relevant speed tests. Many games have thousands of objects, which need to be moved, rotated, etc...

     

    Your code in #8:

     

    Local start:Int = 0
    Local stop:Int = 9999
    
    Local t1:Long
    Local t2:Long
    Local tt:Long
    Local ttt:Double
    Local tti:Long=0
    Local ttx:Double
    While Not KeyHit(KEY_ESCAPE)
           t1 = MilliSecs()
           For Local i:Int = start To stop
                   PositionEntity(cam, Vec3(1, 1, 1))
           Next
           t2 = MilliSecs()
           Local tt:Float = t2 - t1
           tti:+1
           ttt:+tt
           ttx=ttt/tti
           Print "tt=" + tt + ", ttx=" + ttx
           UpdateWorld();
           RenderWorld();
           Flip(0);
    Wend
    

     

    You're calling MoveEntity(cube,vec3(1,1,1)) 9999 times and then updating once. This will make the cube move, not 9999 times (vec3(9999,9999,9999)) but only one time (vec3(1,1,1))

    Don't get me wrong, the idea of doing a test like this can be very useful, but comparing commands like in your test isn't. These are not relevant speed tests: In a game, using MoveEntity more than once before an update is simply a design flaw.

    • Upvote 1
  8. But it doesn't make any sense to run moveEntity twice (or a 1000 times) without updating.

    It's faster without updating because the command doesn't do anything. Run your code, then show your scene with a camera: your cube is still in the same spot (moved only once, not 10000 times)

  9. Strict
    
    Framework leadwerks.engine 
    
    Graphics 800,600
    
    RegisterAbstractPath AppDir
    
    If Not CreateWorld() RuntimeError "Failed to create world." 
    
    Local cam:TCamera=CreateCamera() 
    
    Local start:Int = 1
    Local stop:Int = 50000
    
    Local starttime:Long = MilliSecs()
    Local totaltime:Long
    
    For Local i:Int = start To stop
    
    MoveEntity(cam, Vec3(1, 1, 1))
    UpdateWorld
    RenderWorld
    
    Next
    
    Local movetime:Float = (MilliSecs() - starttime) 
    
    starttime = MilliSecs()
    
    For Local i:Int = start To stop
    
    PositionEntity(cam, Vec3(1, 1, 1))
    UpdateWorld
    RenderWorld
    
    Next
    
    Local positiontime:Float = (MilliSecs() - starttime) 
    
    Notify("move: " + movetime + ", position: " + positiontime)
    

     

    Running above Bmax code, PositionEntity is just a tiny little bit faster than MoveEntity (as I would expect) on my machine.

  10. Here's what I've got so far:

    http://cocopino.eu/download/Cable.zip

     

    (unpack in your LESDK/models folder)

     

    Obvious problems are that the cables are gone when saving & loading the scene and that the texture shouldn't scale.

     

    Does anybody know if there's a LUA function that is triggered when loading/dragging an instance of an object into the scene? I would guess "Spawn" but this doesn't do anything for me.

  11. Ok, Michael. I'll give it a go.

    Have to start doing things with LUA anyway sooner or later.

     

    It will cost you... a couple of 3d trees. But since you already gave some of those to the community earlier I'll let you off the hook this time.

  12. Hi,

     

    A projectile with mass=1 is traveling from origin vec3(0,0,0) with velocity vec3(a,b,c)

    Does anybody know the formula to calculate where (point in 3D space) it will hit the ground (meaning y equals 0)?

     

    Assuming there's no air resistance and we're on earth (g=9.8)

     

    Thanks!

  13. One very last Q:

     

    Should I stick to MS Visual for compiling or can I use code blocks? I don't really know how to thank you all. I couldn't possibly have asked for more help than this ;)

    It depends on your coding background. If you're proficient with C++ or .NET, stick with that and visual studio. If not, try BlitzMax: I had never touched it until I used Leadwerks but it will make you code like the wind.

     

    @mumbles (we're slightly derailing the thread here - my fault):

    Next time your grandpa/aunt/anyone else who uses their computer as a luxurious typewriter with email/internet asks for help, just install Ubuntu. Linux will never emerge from the shadows if only embraced by the "spotty nerds".

  14. How to tell when you're getting older

    When you go to a games page on steam and it asks you for your birthday because it has an adult rating on it and you have to scroll way up to get your year.

    You're lucky you found out this way. I'm sometimes repeating the exact same sentences to my kid as my mother did to me.

    The worst part is: this was my biggest nightmare as a teen and now I don't even care anymore! Senility here I come!

×
×
  • Create New...