Jump to content

Shard

Members
  • Posts

    293
  • Joined

  • Last visited

Everything posted by Shard

  1. Shard

    3D Pixels

    What if I wanted the objects to have physics and collision?
  2. I did that and got the results above.
  3. Shard

    3D Pixels

    Is it possible to draw 3D pixels in Leadwerks or using OpenGL? Below is a screenshot from Universe Sandbox; an example of something that I want to do, but trying to draw that many spheres would be murder on the GPU.
  4. So I am now officially moving to coding in C# and I tried to get Leadwerks to import into it but it didn't work Below is my code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using Leadwerks; namespace N_Body.Source { static class Program { static void Main() { Framework.Initialize(true); Leadwerks.Framework.Update(); Leadwerks.Framework.Render(); } } } I included the Leadwerks.dll from the repository (as a reference). This is the result of the log file: But Leadwerks programs in C++ works fine for me. Can anyone help me start up?
  5. Shard

    Continuum

    At present state it will go until it runs out of memory. Storing 12 floats for 500 objects for 60 frames results in 360000 bytes or 0.00034 Gigs of memory. I have not placed a cap on the rewind time right now but I can easily do that.
  6. Shard

    Continuum

    Sure. The gravity is really simple, I use the gravitational formula to calculate the force that the gun would put on objects around it and then use ForEachEntityDo and apply the force to them (using a pivot that I place at their position, point to the grav source and then TFormVector on it). The rest is all realistic physics. The time control is done a lot less efficiently at the time. I record the position, rotation, velocity and angular momentum in a vector for each object for each frame when its playing forward. When its paused, I set physics mode to off and remove all momentum on the object. And for rewind, I set objects position, rotation, angular momentum and velocity as its played back in time using a pop on the vector.
  7. Shard

    Continuum

    A lil project I've been working on. Unfortunately, I can't post to the gallery as I seem to not have that ability. http://www.youtube.com/watch?v=FDif_bKEbW0 Features: Forward, rewind and pausing of time on all objects. Gravity gun ability on all objects. Future Plans Ability to load a scene (through load scene) and search for all bodies on the map and attach a Time Capsule object to all of them to allow for time warping on all objects.
  8. Nup, actually it didn't. It works fine for things created in code, but not for things loaded by LoadScene. Any ideas on that?
  9. Thanks that worked. However the results aren't quite what I want them to be. Is there another way that I can set the gun to be a constant distance away from the camera (at the center of the screen)?
  10. I'm trying to find the object that the camera is looking at and then set another object at that position. I figured I'd do this by doing a pick to see what is being looked at and then set the object there. Unfortunately, the code below didn't work because it places the object (the gun body) at the points along which the pick function is run, so the body moves back and forth in a line. Pick pick; if(EntityPick(&pick,*camera,1000)) gun.body.SetPosition(pick.GetPosition()); And changing it to Pick pick; if(EntityPick(&pick,*camera,1000)) gun.body.SetPosition(EntityPosition(pick.entity); Didn't move the body at all. Any thoughts?
  11. Similar code but that doesn't seem to work. (Press the Tab Key to activate the effect) [removed]
  12. That doesn't seem to have worked. I'm creating several physics bodies (as in the bodies tutorial) and out of the hundred, only one is affected. Sine ENTITY_BODY is an enum that is 8 I tried some other values (1-7) and none of those worked and every odd number caused an exception. Any other ideas?
  13. Is it possible to find all physics bodies on the map? (Even the ones that are Lua loaded/loaded with a model)
  14. Is there a way to access the TList members (using Framework?) listed here?
  15. Thanks. Just realized I needed another bit of functionality. I need it to only affect physics bodies >,> How would I do that?
  16. Default, its just a framework camera.
  17. Please take a look (Can't imbed videos for some reason. I can't seem to figure out why its doing that.
  18. Thanks for that. While that definitely works, it turns out I actually need different functionality. Instead of a radius, it need it to affect every object on the map and the strength of the effect would be dependent on the distance from the object. So basically what I need is to be able to iterate through all the objects in a map, do a distance formula and then do the effect.
  19. Is there a way to find objects in a scene? For example, I'm trying to locate all the objects (meshes,models) that are within a certain radius of a different model without keeping track of each thing (which is hard to do with Lua scene loading)
  20. It would. Think about a rocket. Its moving forward with a force. If I don't set that, then when it stops rewinding, it won't have the forward force and just fall to the ground. I fixed the velocity and then added the omega which made it work perfectly. I did change my update, but now physics happens much faster (more realistically?) What is the difference between this and just a regular update?
  21. I'm working on a small little side project I've named Time Warp. Basically the idea is to keep track of position, rotation and force for each frame of an object and then in the rewind play it back by setting the object to those values. Everything works, except for the force. Below is a video. http://www.youtube.com/watch?v=Rdysi8XnbvA For some reason the boxes would "pop" and go flying all different ways. So I tried to set the forces, but that lead to a new problem. When the boxes were done moving, they would shoot off in a random direction, as if all the forces supplied were applied at once. Below is my code with the Cap ([Time] Capsule) object. #include "leo.h" using namespace LEO; #include <stdio.h> #include <vector> using namespace std; struct Cap { BodyBox *body; Mesh mesh; vector<TVec3> rot; vector<TVec3> pos; vector<TVec3> force; bool timeForward; Cap() { body = new BodyBox; timeForward = true; body->Create(1,1,1); body->SetMass(1); body->SetType(1); } void Update() { if(timeForward) Forward(); else Backward(); } void Forward() { rot.push_back(body->GetRotation()); pos.push_back(body->GetPosition()); force.push_back(body->GetVelocity()); } void Backward() { if(pos.size() > 0) { this->body->SetPosition(pos.back()); this->body->SetRotation(rot.back()); SetBodyForce(*this->body,force.back()); pos.pop_back(); rot.pop_back(); force.pop_back(); } else Swap(); } void Swap() { //If forward then set to backward if(timeForward) { body->SetGravityMode(0); timeForward = false; } else { body->SetGravityMode(1); timeForward = true; } } }; int main(int argc, char** argv) { Engine engine("Time Warp", 800, 600); Framework frameWork; frameWork.Create(); frameWork.SetStats(2); Camera *camera; camera = &frameWork.GetMain().GetCamera(); //Set Lua variable BP L=GetLuaState(); lua_pushobject(L,frameWork); lua_setglobal(L,"fw"); lua_pop(L,1); //Create Light DirectionalLight light; light.Create(); //Ground BodyBox ground; ground.Create(1,1,1); ground.SetScale(Vec3(10,1,10)); ground.SetPosition(Vec3(0,-3,0)); ground.SetType(1); camera->SetPosition(0,20,-80); DebugPhysics(); vector<Cap*> boxes; float x; float z; for ( int n=1 ; n<=100; n++ ) { Cap *bod = new Cap; x = -5+((float)rand()/RAND_MAX)*10; z = -5+((float)rand()/RAND_MAX)*10; bod->body->SetPosition(Vec3(x,n,z) ); boxes.push_back(bod); } bool timeForward = true; bool resume = false; //Main loop while(!KeyHit(KEY_ESCAPE)) { if(KeyHit(KEY_SPACE)) { for(int i = 0; i < boxes.size(); i++) boxes[i]->Swap(); } for(int i = 0; i < boxes.size(); i++) { boxes[i]->Update(); } //Update the world frameWork.Update(); frameWork.Render(); //Swap the front and back buffer Flip(); } return engine.Free(); }
  22. Can I ask why there is always so much secrecy about coming features? I think you would keep our attention better if you just told us what the feature was as well as be able to attract more customers because they would want this future feature.
  23. Shard

    LETKControl

    Hi I had a couple of questions about LETKControl. 1) Is this free for commercial use? I didn't see a license on the webpage. 2) In the C# thread, Lazlo said that its possible that it can be used with any language. I've tried to get it to work with a C++ Windows Form Application but I was unable to get the window to draw anything. Can anyone give me a sample project/code so I have something that I can start off on?
  24. Please see the UML chart below. I'm trying to make a UML chart for my program but I can't seem to find the program/template that it was made with. I've tried Visio 2010 but it still doesn't look the same. Anyone know how it was made?
×
×
  • Create New...