|
Subotai posted:Well I have a texture I am dynamically generating and putting text on it and then putting it on a billboard. The billboard size is defined in world space coordinates and I need it to match the texture size which is defined in pixels. If the sizes dont match the text looks stretched or squished. Without knowing exactly what you intend to do with this texture, it sounds like it may be easier to change the projection/viewport so that world space is identical to screen space.
|
# ¿ Nov 26, 2007 03:56 |
|
|
# ¿ Apr 26, 2024 00:27 |
|
The main thing I found the Red Book good for is structuring how you get started exploring GL- first vertices, then transformations, then lighting and shading, and so on.
|
# ¿ Dec 1, 2007 18:17 |
|
tyrelhill posted:I'd have to disagree and say you should start way down at the bottom with simple stuff like Pong and Frogger before you go look at binary search trees and crap like that. I think you missed the point a little. Sure, modding a game won't teach you OpenGL or how a BSP tree works, but it lets you skip directly to the entities and world state - *game* programming, as opposed to just graphics and simulation programming (not to mention input, sound, I/O, etc). The foundation is already there. I agree that examining a complete cutting-edge engine is a very bad way to learn the basics of graphics programming, if that's your objective.
|
# ¿ Dec 2, 2007 06:21 |
|
Nyvinyd posted:That's cool, I don't actually know what XNA is. Graphics is an application (in the original sense, not the computer sense); first you have to learn C++ itself. That learning process will likely not involve graphics, but at the end of it you'll be able to move on to that. It's like how you have to learn Greek if you want to study classical philosophy.
|
# ¿ Dec 4, 2007 02:29 |
|
Twiggy794 posted:Then what would you describe it as? A 3D engine? It's a system architecture focused on game development. It's more comparable to something like SDL rather than a game engine.
|
# ¿ Dec 5, 2007 16:43 |
|
samiamwork posted:drat. I was afraid of that. I was really hoping to avoid using FBOs, but if that's what I have to use, that's what I'll used. Sorry, that's the only way to do it at all. No current 3D API allows reading directly from the render target. quote:Someone else just suggested to me that if I have a vector for the direction I want to move in before the rotation (say (0,1,0)) and I rotate this with the verticies, I could just add this vector * the amount I want to move to the vertcies and it should move them in the direction I want after the rotation. I wont be able to try this for a while, does this sound like it would work though? Yes, but you'll want to periodically regenerate the direction vector from scratch to avoid error accumulation. In general, you don't want to perform endless stacking transformations on the same data when using floats- it's better to have an unchanging base value which is transformed into a current value each frame it is needed. haveblue fucked around with this message at 17:25 on Dec 7, 2007 |
# ¿ Dec 7, 2007 17:23 |
|
Well, the first thing I notice is that your degree/radian conversion is wrong- all those 360s should be 180.
haveblue fucked around with this message at 23:04 on Dec 10, 2007 |
# ¿ Dec 10, 2007 23:02 |
|
Barrackas posted:I can't remember where I picked this up, but it's in the back of my head somewhere that older cards that don't support with NPOT textures will actually deal with them by breaking the NPOT texture down into the a series of POT textures. I think it's something Java3D did. If a graphics card doesn't support rectangular textures then they can't be used in OpenGL, it's an optional extension (at least, it used to be, and rectangular texture support has been present in all 3D cards for the past several generations).
|
# ¿ Dec 20, 2007 17:45 |
|
Even better, you write the loading (and storing) code for the editor and then add those files to the game engine project.
|
# ¿ Dec 22, 2007 05:15 |
|
FlyingDodo posted:I've just finished writing Vector,Quaternion and Matrix classes (c++). I understand vectors and matrices (well I hope I understand enough). I want to make a class which can be used to rotate things through 6dof. I can use the quaternions to make a basic fps camera which works fine but I have no idea how I am supposed to make a 6dof camera. By "basic fps camera" do you mean a camera that uses Euler angles? If you can convert the angle and axis from a quaternion to an orientation matrix, you can use it to transform the camera just like any other object. Then, to spin the camera around a relative axis like in Descent, you transform the target axis with the camera quaternion, convert the result and the magnitude to a quaternion, and multiply it back into the camera orientation. If that didn't make any sense, I can try to find the book I got this from in the first place. It's been a really long time since I had to work with quaternions.
|
# ¿ Dec 24, 2007 06:13 |
|
FlyingDodo posted:No didn't make any sense . I'm not very good at maths. All I want is to be able to do is rotate things around for a space game. Like rotating spaceships around all possible orientations, based on pitch/roll/yaw. And yet, you have a quaternion class There are 2 things you need to be able to do to implement Descent-style movement- change the value of a quat by combining it with another quat, and generating a rotation matrix equivalent to a given quat. These are probably already methods of your class, but if they're not: The first one is accomplished by multiplying the two quats together. If c is the cosine of the angle in the quat and v is the axis around which it is rotated: code:
The next thing you want to be able to do is generate the rotation matrix. I'm guessing you can already do this because you say you can use the quats for a basic camera, but still: code:
Now, to let the ship move along a camera-relative axis, you take the axis you want to move along (say, forward, which is probably along the positive Z axis), transform it by the quaternion, and then add the resulting vector to the ship's position. code:
Rotation is a bit trickier, because after performing the same initial steps you have to modify the quaternion with the result: code:
I should probably admit that I couldn't actually find the book and that's all based on old code, but I remember that it used to work. Hope it helped! haveblue fucked around with this message at 21:33 on Dec 30, 2007 |
# ¿ Dec 27, 2007 07:31 |
|
FlyingDodo posted:I'm a bit lost here. I'm assuming that MultiplyMatrixAndVector(tempMatrix, axis, absoluteDirection); multiplies axis by tempMatrix and stores the result in absoluteDirection. So why is delta made from axis and magnitude. Shouldn't it be absoluteDirection and magnitude? Sorry, you're right. It should be absoluteDirection.
|
# ¿ Dec 30, 2007 21:33 |
|
FlyingDodo posted:I'm still having problems trying to make this all work. I made a class which is easy to use (well if it worked properly it would be). All you have to do is give it axis/angles and it gives back an opengl matrix. For some reason it only works for rotations around one axis at a time, otherwise it goes all weird. I hate to dump a wall of text but could you take a look at my code? There must be some mistake in it somewhere that I can't find. Do you mean that if you use, say, <0,1,0> as the axis it works fine, but <0, .7071, .7071> generates garbage?
|
# ¿ Jan 1, 2008 18:03 |
|
Nibelheim posted:Things are much clearer now. Thanks. Sure. You can populate the tree with static entities representing level geometry, or some sort of reference to a subset of background tiles.
|
# ¿ Feb 18, 2008 23:36 |
|
Murodese posted:Similar to this, how do I go about 3d collision detection for non-regular objects? They won't be massively complex, but something like a bounding sphere or aabb won't be precise enough. Usually the easiest way to do this is to implement a set of primitives and then assign each of your colliding objects a number of these to form their shape. I don't know how complex or precise your collisions have to be, but you can fill just about any model with spheres and cylinders and get it close enough for a 3D game.
|
# ¿ Feb 22, 2008 16:52 |
|
Vinlaen posted:It seems like no game engines include automatic network synchronization... It's very difficult to implement this in a completely general-purpose "free" manner. Too much of it is tied to the expected behavior of the value you're trying to replicate, and there's no room to add metadata to the network traffic. Unreal can do it because they control the virtual machine your game logic runs upon, and because they've been working on it for over ten years.
|
# ¿ Feb 29, 2008 22:52 |
|
eshock posted:This seems like something you'd want to write a shader for. Especially since indexed color is practically deprecated and probably won't work right on modern hardware.
|
# ¿ Mar 12, 2008 22:02 |
|
Pfhreak posted:Yeah. We're using a physics library, and all of the agents will be affected by it. We are defining the world using textured polygons of arbitrary size. Thus, the world isn't tiled. The agents have a bounding box that defines their collision size, and they currently move back and forth by sliding along the ground. (By altering their linear velocity.) Abuse uses tiles, but it'll probably still be useful.
|
# ¿ Mar 16, 2008 04:08 |
|
You're not taking the camera's current orientation into account when rotating, so all rotations are being performed around the same 3 axes. You need to take the axis the key command is supposed to rotate around and rotate *that* to be relative to the camera before using it to change the camera itself. I made a fairly long post about this a few pages back. You already have most of it down, so just look at the last two blocks. haveblue fucked around with this message at 16:24 on Mar 20, 2008 |
# ¿ Mar 20, 2008 16:22 |
|
Murodese posted:So if I'm understanding right, to yaw I should be getting the "y" axis from the current rotation and multiplying the current rotation by the quat generated by (m_x, ("y")) instead, then doing the same for the other axes that need to be rotated that frame? Pretty much. You already have the current camera orientation as a quat. You take the natural Y axis and rotate it with this quat, so that from the camera's perspective it's where the Y axis should be. Then you rotate the camera around this new axis by the amount the user inputted.
|
# ¿ Mar 20, 2008 16:47 |
|
Girl With Huge Tits posted:One of my problems is I can't find any examples of doing something like I want to do, so maybe you could answer this. If I wan't to have normal mapping and toon shading in one shader, should they be different passes in the same technique, or different techniques? You should be able to write a shader that does both. One technique involves calculating the fragment color based on the normal, the other is calculating the normal by a transformation of a texture sample. If you can find examples of both it should be relatively simple to create a shader that does one and feeds the result into the second.
|
# ¿ Mar 22, 2008 00:27 |
|
totalSeconds is not the time of that frame, it's the total time elapsed since your game was launched. You have to calculate the frame time by storing the elapsed time from the last frame and finding the difference.
|
# ¿ Mar 24, 2008 16:33 |
|
ultra-inquisitor posted:So the shader knows which polygon is selected, but how do I get this information back to the actual program? Try using GL's selection mode instead of a shader; it's made for that sort of thing. If you can't do that, you'll have to copy the framebuffer back to main memory with glReadPixels to inspect it.
|
# ¿ Apr 1, 2008 19:40 |
|
I'm not really familiar with GLSL, but I have a hunch it's reacting badly to in-place editing of inputs. What happens if you copy gl_Position to a temp before messing with it?
|
# ¿ Apr 11, 2008 21:09 |
|
The Torque engine from GarageGames would do that. Or Unity.
|
# ¿ Apr 23, 2008 21:20 |
|
e: double post
|
# ¿ Apr 23, 2008 22:43 |
|
If you don't intend to sell your game, you could make it a total conversion for an Unreal or Source title. And I didn't realize Unity didn't have a Windows editor.
|
# ¿ Apr 23, 2008 22:43 |
|
fret logic posted:Anyone here well versed with GLUT? If so how did you get learned in it? I'm not trying to really make anything serious, just kind of getting my feet wet with graphics programming, and I'm not sure if I should be reading up on GLUT specifically or general OpenGL programming. I'm using C by the way. GLUT shouldn't take more than a few hours to learn; it's a very simple API that's just designed to get an OpenGL context and some basic input handling up and running in as little time and code as possible. You still use "general OpenGL programming" for drawing.
|
# ¿ May 2, 2008 15:53 |
|
heeen posted:I'm trying to use glClipPlane here, but no matter what values I send, it doesn't clip anything. If I try a positive and a negative halfspace surely some clipping should be noticable? glEnable(GL_CLIP_PLANE0); Also remember that clip planes use eye coordinates.
|
# ¿ May 14, 2008 23:16 |
|
heeen posted:I have it enabled alright, to no effect. If I try 0,0,1,0 and 0,0,-1,0 or 0,1,0,0 and 0,-1,0,0 as parameters at least one of them should clip something, right? If you set <1,0,0,0> (or <-1,0,0,0>) you should see exactly half of your scene. Are you doing anything weird with your projection matrix? haveblue fucked around with this message at 00:31 on May 15, 2008 |
# ¿ May 15, 2008 00:26 |
|
Jo posted:As an extension of my original question: What blending mode performs a multiply? e: I wasn't thinking. Setting the texture mode to modulate will cause the texel color to be multiplied into the fragment color. If you want the destination to be assigned the product of the results of 2 texture units, you need to use the texture combiner extension. haveblue fucked around with this message at 18:27 on May 15, 2008 |
# ¿ May 15, 2008 18:23 |
|
UberJumper posted:How can i have a day night cycle with a variable speed? =( ambientLightIntensity = sin(currentMilliseconds/millisecondsPerDay*pi*2)? As for the actual ambient light, that depends on your graphics system, but in general you'd want to set up a directional light and rotate it around an axis in the ground plane based on that formula.
|
# ¿ Oct 25, 2009 07:32 |
|
Kennedy posted:EDIT: Bahah, as always, hits me in the face as soon as I post Well, you're using a lookat call, so you have all the info you need right here. Just drop campos to the ground, find the vector extending from it to playerPosition, scale that vector up by however much, and use its new endpoint instead of playerPosition.
|
# ¿ Oct 26, 2009 16:20 |
|
timecircuits posted:I'm not using a library for concurrency because I don't really feel that I learn anything by using Boost and calling it a day. Seeing as how the rest of my programming career is probably going to be writing multithreading-aware code, I should get on this ahead of time. The rest of your concurrency programming career is not going to be done with raw pthread calls or atomic intrinsics. You use those to learn the fundamentals and then move on to something more streamlined and practical, which may as well be Boost.
|
# ¿ Oct 26, 2009 17:06 |
|
GuyGizmo posted:Quick question: What's the programming language and libraries used for non-XNA Xbox 360 development? In particular, the SDK for Xbox Live Arcade? I assume the Xbox 360 SDK uses some kind of variant of DirectX, and I think you can program with it in both C# and C++, but I'm not sure. This is essentially correct. The 360 C++ API is a variant of Win32 and the graphics system is a variant of DirectX 9 with some 10 stuff thrown in like geometry shaders. haveblue fucked around with this message at 14:57 on Oct 27, 2009 |
# ¿ Oct 27, 2009 14:55 |
|
Stanlo posted:It doubled the latency or something? That would be a 50% decrease. A 200% decrease would be performance so bad that the router poo poo itself and dropped traffic for every computer in the room.
|
# ¿ Nov 4, 2009 18:27 |
|
I suggest Prolog
|
# ¿ Nov 20, 2009 20:27 |
|
As long as it's not a ponderous flash gallery or some hideous neon-orange-on-black geocities abortion it should be fine. Clean up any obvious design or HTML errors and make sure it can be navigated quickly.
|
# ¿ Dec 1, 2009 20:15 |
|
guenter posted:Around this time I gave up and started looking at heuristics and stuff =/ What we're doing to pretty good effect to solve the orbiting problem: -Calculate the turning radius of the ship at the current speed -Multiply this distance by the sine of the relative angle of the target (this approximates the length of the chord from the ship's initial position to where it would be in its trajectory if it underwent a turn to the target heading) -If the distance to the target is smaller than this value, the ship is going to overshoot despite turning so reduce speed. This makes the ship spiral in on the target; its final orientation can be anything but it usually stops on a dime where directed. I'd need to draw a diagram to properly justify this but it seems to work well enough. haveblue fucked around with this message at 23:33 on Dec 21, 2009 |
# ¿ Dec 21, 2009 23:29 |
|
|
# ¿ Apr 26, 2024 00:27 |
|
What you're seeing is normal behavior. Each time you change the camera orientation, you're also changing the axes around which future orientation changes will be made. The effect adds up so that when you make that input you don't end up exactly back where you started.
|
# ¿ Mar 1, 2010 02:41 |