Jump to content

SpiderPig

Members
  • Posts

    2,348
  • Joined

  • Last visited

Everything posted by SpiderPig

  1. Thanks. I just tried a few things and found I was wrong with the reversed axis's. I'm a little confused still on how to create a vertex in between two original vertices...
  2. I'm currently trying to subdivide a triangle in the geometry shader. I put the material using the shader on a plane made from two triangles. However it seems that the coordinates in GLSL are different to that in Leadwerks? That the positive X axis in Leadwerks is actually the negative X axis in the shader. And the same for the Z axis. The Y axis seems fine. I want the shader to turn the plane of two triangles into a more detailed grid for a terrain. I know the shader works on each triangle, so I will have to divide each triangle itself into the appropriate triangles so that the end result in game looks like a uniform grid. I've thought of tessellation but I don't think it'll give me the results I'm looking for. Any help with this is appreciated. Thanks.
  3. Hi Josh, I would like to see more flexible commands surround the surface class. This will make real-time modification of large dynamic meshes much easier and hopefully faster, allowing for more control of what type of games that can be made. AddVertices(vec3** positions) RemoveSurface(int index) RemoveSurfaces(int* indexes) RemoveVertex(int index) RemoveVertices(int* indexes) RemoveTriangle(int index) RemoveTriangles(int* indexes) SetTriangleIndice(int index, in a, int b, int c) Creating a grid of only 256 x 256 vertices seems to take a lot longer than if programming it in a bare C++ OpenGL application using VBO's. Is there a reason for this? Thanks.
  4. Thanks, that did the trick. For those who are interested here's the code I used. float cx = Math::Round(context->GetWidth() / 2); float cy = Math::Round(context->GetHeight() / 2); Vec3 mpos = window->GetMousePosition(); window->SetMousePosition(cx, cy); mpos = mpos * looksmoothing + mousepos * (1 - looksmoothing); float dx = (mpos.x - cx) * lookspeed; float dy = (mpos.y - cy) * lookspeed; Vec3 prot = player->GetRotation(); prot.y = dx; player->SetRotation(prot); Quat phy_rot = player->GetQuaternion(true); player_pivot->PhysicsSetRotation(phy_rot, 1.0); The physics shape is assigned to the pivot, and the model of the player is parented to the pivot.
  5. Thanks Josh, an extra argument would be great. I tried the code but moving the mouse left and right just added to the players rotation so I changed the code from; prot.y += dx; to prot.y = dx; which did help. It gave me a rotation about the Y axis which followed the mouse. But when the player rotates 90 on the X axis and then I use this code in the update loop it goes haywire. Rotating in all manor of directions without stopping. My player is setup like this. Model* model = Model::Cylinder(); model->SetShape(Shape::Cylinder()); model->SetCollisionType(COLLISION::PLAYER); model->SetMass(10.0, 0, -1, 0, 1, 1, 1);//to make it more stable standing up model->SetPosition(Vec3(0, 5, 0)); model->SetRotation(90, 0, 0);//this makes it go hay wire Basically I'm making my own character controller because the player is pulled toward different gravity directions through out the game. So I always want the player to rotate left and right with the mouse no matter what direction is down.
  6. I second this. You would think fog would be one of the first shaders included.
  7. Yeah you're probably right. I just wanted to use a shape that wasn't a primitive.
  8. Seeing through the walls might be the material settings. Make sure depth test and depth mask are checked. Not sure about why it's on multiple walls though...
  9. I'm unsure how exactly to use Transform::Rotation in order to rotate my physics object about it's local Y axis. The code below works when the player is upright, but if it rotates 90 degrees on the X axis (lying down basically) it rotates about the global Y. How can I use this to transform to local? float cx = Math::Round(context->GetWidth() / 2); float cy = Math::Round(context->GetHeight() / 2); Vec3 mpos = window->GetMousePosition(); window->SetMousePosition(cx, cy); mpos = mpos * looksmoothing + mousepos * (1 - looksmoothing); float dx = (mpos.x - cx) * lookspeed; float dy = (mpos.y - cy) * lookspeed; Vec3 prot = player->GetModel()->GetRotation(true); prot.y += dx; Vec3 v = Transform::Rotation(prot, NULL, player->GetModel()); player->GetModel()->PhysicsSetRotation(v, 1.0); Thanks.
  10. Is a PolyMesh() trigger suposed to work? I set one up but every time objects fly straight through without invoking the collision hook. Using a sphere or box though works fine.
  11. This is also exactly what I'm after. Thanks!
  12. Great job! Simple yet fun to play. Love the music to.
  13. I re-downloaded and found no material. But using the diffuse+normal+specular shader I found no issues on either models or with more than one in the scene. I've attached the material I used so you can compare it to the one you are using. I'm not sure what the "paper_m.tex" is used for? I'm not sure if you purposely need a large scale model, but they are quite large. I would suggest playing with your material settings to see if the problem disappears. Mat.zip
  14. Thanks. What shaders are you using in your material? And what textures are in what slot? If you could add your material as well that'd help.
  15. Can you upload the model and material so we can have a look?
  16. Thanks macklebee, Josh's comment at #9 gave me the info I needed. And the script will come in useful too.
  17. Hi, I have made a large sphere shape which is set up as a trigger and I have attached a collision hook to a cube which I fire from the camera at the sphere. The hook is called upon collision but also seems to be called when the cube is inside the sphere. Even if it has been created in the sphere on start-up. Is there a way to only detect a collision with a face? Not the volume as well? I thought of just removing the hook upon first collision, but I'd like it there for collisions that may happen later. Any ideas?
  18. Thanks for the info. It sounds good for changing a mesh in real time, however its the physics shape that has to be changed in real time too. I'd like to see a faster method of PolyMesh (), but i may have to come up with a differnt way of generating the shapes in realtime.
  19. Do you think it will change the physics shape though? Or just the mesh?
  20. Hey guys, What I have is a large dynamic mesh, and Shape::PolyMesh() takes too long to be used in real-time. I want the shapes vertices to change along with the mesh's without using Shape::PolyMesh() all the time. Is it possible to manipulate the vertices of a shape without re-generating it?
  21. I assume it's possible seeing as the editor is doing just that. But how would I go about implementing it? What I want to do is run Leadwerks in a panel or something similar and spread Win32 form controls around it.
  22. The new shader solved the problem perfectly, thanks! In future when I update my project, will the shader convert to the old one or will you update that too?
×
×
  • Create New...