Jump to content
  • Advertisement

TheRealSmolt

Member
  • Content Count

    11
  • Joined

  • Last visited

Community Reputation

0 Neutral

About TheRealSmolt

  • Rank
    Member

Personal Information

  • Role
    Amateur / Hobbyist
  • Interests
    Programming

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. TheRealSmolt

    Engine UI

    Man I got a lot of info... What I'm trying to do is stick to c++ and use something like ImGui. Because displaying the game in the actual engine seems to be a ton of unnecessary work, what I'm planning on doing is just have the engine like more of a scene editor and asset generator, and the the actual project run the game. Thanks!
  2. TheRealSmolt

    Engine UI

    Thanks all info!
  3. TheRealSmolt

    Engine UI

    I'm currently in the early stages of programming a cross platform game engine. My goal is to create an engine kind of like Unity, but I'm stumped on how to do it. In Unity, the engine and the game are the same program, with the game window inside and in a different project. I don't know how to achieve this. The game's running, but also not, in a different project, but also not, and can be editted while sorta running? I have no clue how to pull this off. Any help would be appreciated, don't hesitate to ask questions. Thanks.
  4. TheRealSmolt

    Calculating Vertex Normals

    Ohhhhhhhh. Okay thanks. I found out the my issue was that the normals where flipped on certain faces for some reason, but thanks, and for the tip about weighted normals.
  5. TheRealSmolt

    Calculating Vertex Normals

    Sorry, I don't understand.
  6. TheRealSmolt

    Calculating Vertex Normals

    This is what it's doing. It's dividing by the length of its array of vectors, right?
  7. TheRealSmolt

    Calculating Vertex Normals

    So I'm programming a game engine with LWJGL and I'm making a method that generates vertex normals using an indices array and a vertices array. My idea was to have a list of normals, add the face normals to them with a loop, and then average the variables. However when I tried that I get really odd effects with the lighting. This is my code: public static Vector3f calculateNormal(Vector3f a, Vector3f b, Vector3f c) { Vector3f out = new Vector3f(); GeometryUtils.normal(a, b, c, out); return out; } public static float[] buildNormals(int[] indices, float[] vertices) { List<List<Vector3f>> rawNormals = new ArrayList<>(); for(int i = 0; i < vertices.length / 3; i++) rawNormals.add(new ArrayList<>()); for(int i = 0; i < indices.length; i += 3) { Vector3f a = new Vector3f(vertices[indices[i] * 3], vertices[indices[i + 1] * 3], vertices[indices[i + 2] * 3]); Vector3f b = new Vector3f(vertices[indices[i] * 3 + 1], vertices[indices[i + 1] * 3 + 1], vertices[indices[i + 2] * 3 + 1]); Vector3f c = new Vector3f(vertices[indices[i] * 3 + 2], vertices[indices[i + 1] * 3 + 2], vertices[indices[i + 2] * 3 + 2]); Vector3f normal = calculateNormal(a, b, c); rawNormals.get(indices[i]).add(normal); rawNormals.get(indices[i + 1]).add(normal); rawNormals.get(indices[i + 2]).add(normal); } float[] normals = new float[rawNormals.size() * 3]; int n = 0; for(int i = 0; i < rawNormals.size(); i++) { Vector3f value = new Vector3f(); for(Vector3f v : rawNormals.get(i)) value = addVectors(value, v); int size = rawNormals.get(i).size(); normals[n] = value.x / size; normals[n + 1] = value.y / size; normals[n + 2] = value.z / size; n += 3; } return normals; } Is there anything that looks wrong with it? Thanks.
  8. TheRealSmolt

    Rotating vector by vector with vector

    httpdigest had the answer I was looking for, the only with was that i needed to reverse the rotation for some reason. Thanks.
  9. TheRealSmolt

    Rotating vector by vector with vector

    This is definitely feasible, but I only generate the transformation matrix on render, not to store my data. Is there any way to "apply" rotation to a translation before applying it? (without the use of a Matrix4f)
  10. TheRealSmolt

    Rotating vector by vector with vector

    Thanks for the responses, but I was very vague, so not what I was looking for. I have rendering done properly and working. I have a class on each Entity class called Transform that holds position as a vec3, rotation as a vec3, and scale as a vec3. I can create a matrix to render it properly, but my issue is within my code, that's where I was probably confusing. Within my Transform class, I have two methods: translate and rotate. Right now they simply add the incoming value. I want them to factor in rotation so that when I say transform.translate(new Vector3f(0, 0, 1)); I want the entity to move forward along the local z axis, not along the global z axis. I need some sort of math to rotate a point. If it's still vague feel free to ask questions, Thanks.
  11. Right now I'm using LWJGL for a game engine I'm working on. My problem is that I need the ability to rotate a point around another point on each axis at the same time (as in Vector3 for position and Vector3 for rotation too). Basically, when translating an entity, I need to be able to translate it on a local axis. For example, if the camera is pointing halfway between the x and z axis, and I translate the camera along the z axis, I want the camera to move forward not at an angle. I'm using the "Minimal OpenGL" custom configuration of LWJGL with JOML, and I'm pretty sure that the ability to do this is somewhere in JOML but I don't know where. Thanks in advance.
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!