Werner291

Member
  • Content count

    9
  • Joined

  • Last visited

Community Reputation

149 Neutral

About Werner291

  • Rank
    Newbie
  1. Best languages/tools for simple 3D graphics?

    I find Ogre3D to be quite easy to use. It's for C++, but I believe they have a C# port.
  2. Hello,   I've been working on a game for some time. In short, it is a "sci-fi airplane racing game", set in the far-future, but I'm trying to make the game at least slightly realistic.   It's a huge, oversized project, that I'm completely crazy to start on my own. My current goal is to see if I can at least create a very rough version of it on my own, and maybe team up if that turns out good. It's more a hobby than anything else.   Many things are already in place, but I'm short on ideas for track design, and I'm asking myself: "What are interesting things to race through that actually make sense from a story point of view". It is set in a rather large coastal city that hosts a racing event (anually or something?).   How I see the track before me: Players start out in some kind of stadium that is open on two ends (not shure how that's called) that is located on a cliff, between to higher areas. They then turn and follow the coastline, the "racing area" is limited by floating "beacons". They follow this coastline towards the estuary of a large river that flows through the city,. The players then follow the river into the city, with spectators lining the river banks.   Aaand I'm out of ideas. What would be interesting features of this city that racers can fly through that would make sense? I was thinking about making the river go underground or something, so they fly through a tunnel, but then I'm not shure how to make them exit again.   I'm posting this here in the hope that you might have some cool ideas for this track or maybe the game in general. I'll post some screenshots later (don't expect too much, it's mostly empty terrain).   Here's the starting area:   And the famous (empty) coastline. Maybe I'll add some buildings at the top of the cliffs, and maybe some beaches:   Another shot of the coastline, a small peninsula that you can fly through. This thing needs a bridge.
  3. Hello, I'm trying to write a 3D engine, but I'm having some problems with the management of my shaders and materials.   Mostly, the problem is keeping the two seperate. Some things in my engine require texture splatting, others need to be reflective, others need to glow, yet others should look liquid, and then some more...   I was quite impressed by Ogre3D's material scripts, but I can't make heads or tails out of the enormous amount of source code.   My current approach is to try to automatically generate a shader program for every material, but this seems kinda wasteful. I might for example have two things in the game world that look exactly identical except for a different color.   Also, since the program generation is now locked away in the material, how to I implement things like tesselation and vertex manipulation?   This has been causing me headaches over the past couple days up to the point where I felt like just abandoning, but I'd at least like to understand this before I do.
  4. Aaargh...  typos... Always such errors when I'm doing maths... Why do other people always see such stuff so easily? Thanks.
  5. Good afternoon,   I'm currently developing a game for Android using OpenGL ES 2.0 where users fly through a tunnel, the goal being not to hit the walls.   The tunnel is randomly generated and it is composed of a series of interconnected rings. The rings are supposed to be perpendicular to the direction of the tunnel. See this screenshot when things go well:    [spoiler][/spoiler] Things still look good in this screenshot, but as the tunnel drifts away from the Z axis, the rings do not rotate with it correctly, causing this nice round tunnel to gradually flatten out then turn into an unmanageable mess of lines.   Currently, here's the code that I use to generate the rings: (Java) // Constructor public TunnelSection(GameManager myRenderer, TunnelSection previous) {                  sectionTransform = new float[16];                  float ring_radius =  RING_MIN_RADIUS + (float)(Math.random()) * (RING_MAX_RADIUS - RING_MIN_RADIUS);                  if (previous != null){             mDirection = previous.mDirection;                          Quaternion randomRot = new Quaternion();             randomRot.fromAngles(((float)Math.random()-0.5f)/5f, ((float)Math.random()-0.5f)/5f, ((float)Math.random()-0.5f)/5f);             mDirection = mDirection.mult(randomRot);             mDirection.normalizeLocal();                          Vector3f delta = mDirection.mult(Vector3f.UNIT_Z);                          mPosition = new float[]{previous.mPosition[0]+delta.x, previous.mPosition[0]+delta.y, previous.mPosition[2]+delta.z};         }         else {             mDirection = Quaternion.DIRECTION_Z;             mPosition = new float[]{0,0,0};         }                  ringCoords = new float[(COORDS_PER_VERTEX) * RING_VERTICE_COUNT];                  Vector3f vertLocal = Vector3f.UNIT_X;                  for (int itr=0;itr<RING_VERTICE_COUNT;itr++){             vertLocal.set(android.util.FloatMath.sin((float)Math.PI * 2f * ((float)itr/(float)RING_VERTICE_COUNT )) * ring_radius,                           android.util.FloatMath.cos((float)Math.PI * 2f * ((float)itr/(float)RING_VERTICE_COUNT )) * ring_radius,                           0f);                          vertLocal = mDirection.mult(vertLocal);                          ringCoords[itr*3]   = vertLocal.x;             ringCoords[itr*3+1] = vertLocal.y;             ringCoords[itr*3+2] = vertLocal.z;         } // Initialize the rest...Why is it that the rings do not rotate like they should? It must be something very simple, but I can't find it...
  6. I took your second solution, it works excellently! Here's the resulting code: [source lang="cpp"]Ogre::Vector3 vectorOA = wallStrip[itr-2]; Ogre::Vector3 vectorOB = wallStrip[itr-1]; Ogre::Vector3 vectorOC = wallStrip[itr]; Ogre::Vector3 vectorAB(vectorOB - vectorOA); Ogre::Vector3 vectorBC(vectorOC - vectorOB); Ogre::Vector3 vectorCA(vectorOA - vectorOC); Ogre::Vector3 faceNormal = vectorAB.crossProduct(vectorCA) * (itr%2==0 ? 1.0 : -1.0); // It's a triangle strip if (vectorOA.dotProduct(faceNormal) > 0){ Ogre::Vector3 ABNormal = vectorAB.crossProduct(faceNormal); if (vectorOA.dotProduct(ABNormal) > 0) continue; Ogre::Vector3 BCNormal = vectorBC.crossProduct(faceNormal); if (vectorOB.dotProduct(BCNormal) > 0) continue; Ogre::Vector3 CANormal = vectorCA.crossProduct(faceNormal); if (vectorOA.dotProduct(CANormal) > 0) continue; // The projection falls within the triangle }[/source] It also checks wether the point is on a specific side of the triangle, it's also inside a loop iterating through a vector of these triangles. The point that I'm testing is actually the origin in this case, that's why you don't actually see it in the code. It actually even worked the first time! (That was very unlikely, I'm a champion at typos [img]http://public.gamedev.net//public/style_emoticons/default/tongue.png[/img])
  7. Hello, In 3D, say you have a triangle defined by three non-aligned points (A,B,C). How do I find out if the projection of a fourth point onto the plane that the triangle belongs to is inside the triangle?
  8. Dividing large planets

    An icosahedron is exactly what I need! Too bad there aren't any regular shapes that get closer to a sphere, but this one should work.
  9. Hello, I'm trying to make a 3d online game in a sci-fi environment. I've finally got the connection set up, but I'm not shure how I'm going to handle the planets. I'm planning to make the planets very large to make the game more immersive, leading to the problem that loading something that size into memory at once will probably make something horribly go wrong. In Minecraft, the worlds are also huge, so they are divided into 16x16 square "chunks" that are loaded when approached by the player and unloaded and saved as he or she moves away from them. I'd like to apply a similar system to my planets, but there's one difference: Minecraft worlds are flat, planets are spherical. How do you divide a sphere into "chunks" without things going crazy around the poles, heightmaps becoming deformed, etc... ?