• Advertisement

ICUP

Member
  • Content count

    170
  • Joined

  • Last visited

Community Reputation

140 Neutral

About ICUP

  • Rank
    Member
  1. GLSL & Matrix Math Help

    You were right. Thanks.
  2. GLSL & Matrix Math Help

    I'm new to 3-D math so I'm not sure if I'm doing this correctly.   I currently have a GLfloat[ 36 ] pyramid set to the buffer, and that data is sent to an vec4 Vertex in the shader.   #version 400 core layout( location = 0 ) in vec4 Vertex; uniform mat4 Model; void main() {     gl_Position = Model * Vertex; }   I then setup a 4x4 matrix to rotate around the y-axis, and send that as a uniform to the "Model" variable in the shader.   glm::mat4 ModelR(         cos( rStepAngle ), 0.f, -sin( rStepAngle ), 0.f,         0.f, 1.f, 0.f, 0.f,         sin( rStepAngle ), 0.f, cos( rStepAngle ), 0.f,         0.f, 0.f, 0.f, 0.f         ); GLint ModelLoc = glGetUniformLocation( programs.basicShader, "Model" ); glUniformMatrix4fv( ModelLoc, 1, GL_FALSE, glm::value_ptr( ModelR ) );   I'm getting nothing on my screen except the clear color. I think I may be misunderstanding something here. Vertex is going to be 3 components (technically 4, with 0 at the end), that gets multiplied by the Model rotation. How many times is the main() of the shader being run? My understanding of it was that main() is run until all 12 vertices of the pyramid are multiplied by the Model matrix. Is this correct?   There's probably something wrong with my math...
  3. I have several questions concerning resolution. The first thing I'm wondering is, if I allow users of a game to change resolution, by how much do I scale the different sprites/logos/HUD? Is there some sort of formula to this? Second, let's say I want my game to be crisp/clear in 1080p resolution. How do I create art assets for this resolution? Someone suggested to me that I open up adobe photoshop, create a new document that is 1080p in height. I find that strange, because why would you draw a small character sprite in such a huge window? If I end up using a virtual resolution, at what point do I scale objects? It seems to me that if I'm drawing everything to a virtual 1280x1024 resolution, but when it is actually displayed on the user set resolution, let's say 800x600, the scaling would have to be done each and every call to a draw which is alot, and would slow things down immensely.
  4. Thanks Steve. I'm new to C# and XNA (come from a C++, SDL background). Can you give me a little more detail on how to use it? I'm looking at the msdn documentation right now and I'm not sure how to use one of the three overloaded methods.
  5. Can meshes not be loaded once and drawn in two viewports? How can meshes be shown in two or more viewports? I'm able to get a mesh drawn in one window, but if it tries to draw in a second, I get this error: "Both a vertex shader and pixel shader must be set on the device before any draw operations may be performed." If I only draw in one viewport, it works fine and the meshes show up.
  6. Another Breakout clone

    Nice! I just finished a breakout clone too. You did alot better than me.
  7. Frame Independence and Speed

    I'm assuming you meant something like: yOffset += ballVelocity * sin( radians ) * ( deltaTicks / 1000.f ) The problem with that is that the ball, when launched, is suddenly drawn 30 pixels in the angle direction.
  8. I tried using the methods on lazyfoo's site for frame rate independence. One problem I'm having though is that my game is running at different speeds on different computers. The differences are drastic. For example, on a Core 2 Duo 2.4 ghz 2gb ram PC, the ball will move extremely fast, but the paddle moves slowly. On an Intel Centrino laptop running Win7 w/plenty of ram, the ball moves slowly, but the paddle moves fast. On older computers like a Pentium 4 2.4 ghz, 768 ram computer, the ball moves realllllllllyyyyyyy sllllooowwww. Yes, that slow. What might be some reasons this is happening, and how can I fix it? I can only assume that the code I wrote that deals with frame rate independence is wrong. Here are the relevant parts of the code. (btw, it's a breakout clone). Code to move the ball [code]bool Ball::MoveBall( Uint32 deltaTicks ) { ..... // X-COORDINATE xOffset += cos( radians ) * ( ballVelocity / 1000.f ) * flipx; ballPosition.x = (Sint16)xOffset; ....... // Y-COORDINATE yOffset += sin( radians ) * ( ballVelocity / 1000.f ) * flipy; ballPosition.y = (Sint16)yOffset; ..... }[/code] Code to move the paddle [code]void Paddle::Move( Uint32 deltaTicks ) { xOffset += xVel * ( deltaTicks / 1000.f ); paddlePosition.x = (Sint16)xOffset; }[/code] Main loop [code].... .... while ( SDL_PollEvent( &gEvent ) ) { handle.PaddleInput( &gEvent, stick ); if ( gEvent.type == SDL_QUIT || gEvent.key.keysym.sym == SDLK_ESCAPE ) quit = true; } stick.Move( time.GetTicks() ); if ( ball.MoveBall( time.GetTicks() ) ) wallSound.Play(); if ( ball.CheckPaddleCollision( stick ) ) paddleSound.Play(); if ( ball.CheckBrickCollision( brickmap ) ) brickSound.Play(); if ( ball.IsBallDead() ) { ball.ResetBallPosition(); stick.ResetPaddlePosition(); stick.SetPaddleState( Paddle::RESET ); launched = false; draw.GameObjects( lvl, brickmap, stick, ball ); } draw.GameObjects( lvl, brickmap, stick, ball ); time.Start(); draw.Refresh(); ..... ....[/code]
  9. How do you statically link?

    I'm using SDL 1.2.14 under LGPL. I'll be providing full source.
  10. I'm done with a game I made and want it to be statically linked against SDL so that I don't have to distribute .dll files and VC++ redist. files. What is the exact process I need to take? I downloaded the SDL, SDL_image, SDL_mixer, and SDL_ttf source code, recompiling them as static libraries with /MT and /MTd. When using the newly compiled object library files, I get errors from SDL.lib and SDL_mixer.lib about unresolved externals (basically all the functions can't be found). One thing I'm unsure about: when I compile the source, for some subsystems like SDL_mixer, there are subprojects, (something like) Timidity. Do those also need to be set to static library output? Do those code generation settings need to be set to /MT or/MTd? I did this, but didn't work.
  11. I usually only use primitive data types in my programs. I think I've read in various places thought that not all primitives are the same on every system. To make my programs more portable, what data types should I be using? I've seen those Uint32, Uint16, etc. types before. Should I be using these if I'm concerned about portability? Also, which ones do SDL provide and where are they defined?
  12. internals of cout?

    cout is a class object (I think, of ostream) that is part of the C++ standard library. When you use cout you usually use it along with the stream insertion operator <<. Whatever class cout belongs to, I think it's ostream, ostream has overloaded operator <<, with many different signatures, most likely the primitive types. So, overloading operator<< is basically the same thing as: cout.operator<<( "hello world" ); As for how it actually prints characters to the screen I have no idea. Probably assembly language type stuff going on there.
  13. [font="arial, verdana, tahoma, sans-serif"][size="2"][I hope this is the right place to post this. I posted here since I'm looking for feedback on a project as guided by the Your Announcements posting guidelines][/size][/font] [font="arial, verdana, tahoma, sans-serif"] [/font] [font="arial, verdana, tahoma, sans-serif"] [/font][font="arial, verdana, tahoma, sans-serif"][size="2"]Hi, my team members and I just completed a quarter long project for a software engineering course. We created a product built around the theme of "Empowering Society through Adult Learning." The idea we came up with was to create a website that teaches the basics of kung-fu. I would much appreciate it if you could fill out this short survey to give us some feedback. Here's a little blurb with instructions followed by a link to the survey.[/size][/font] [font="arial, verdana, tahoma, sans-serif"][size="2"][font="Tahoma, Verdana, Arial, sans-serif"][b] [/b][/font][/size][/font] [font="arial, verdana, tahoma, sans-serif"] [/font][font="arial, verdana, tahoma, sans-serif"][size="2"][font="Tahoma, Verdana, Arial, sans-serif"][b][quote]How Tu Kung Fu Usability Survey [color="#666666"][i]How Tu Kung Fu was created for a school software engineering class project. At the beginning of the quarter, students had to come up with a software product idea that was based on the theme "Empowering Society through Adult Learning." One group came up with the idea for a website to teach kung-fu as a teaching and helping aid for those beginning kung-fu or those that are not practicing, but are interested.The purpose of this survey is to get feedback on the usability of the website and content.NOTE: The website is currently in a beta stage and features and contents may not all be working.If you have not already done so, please visit www.kungfusoft.net and accomplish the following tasks:1. Find and watch a video on kung-fu stances.2. Find and watch a video on the high block.3. Explore the site at your leisure[/i][/color][/quote] [/b][/font][/size][/font][font="arial, verdana, tahoma, sans-serif"][size="2"][url="http://tool.surveypirate.com/Survey.aspx?surveyid=28768&sp.mac=Lgaq%2f70wJlf7SV4TkdmVVw%3d%3d"]Kungfu Software Survey Link[/url] [/size][/font][font="arial, verdana, tahoma, sans-serif"] [/font][font="arial, verdana, tahoma, sans-serif"] [/font] [font="arial, verdana, tahoma, sans-serif"][size="2"]Link to the project website:[url="http://www.kungfusoft.net"]www.kungfusoft.net[/url] [/size][/font] [font="arial, verdana, tahoma, sans-serif"] [/font] [font="arial, verdana, tahoma, sans-serif"][size="2"]Thank You[/size][/font]
  14. Parkour Ninja Alpha 1

    Nicely done! I like the 2.5D perspective. The game mechanics were fun. The only weird spot was that part where you have to swing but I was able to figure it out.
  15. Some mostly obvious beginner questions...

    Hey, if you're a comp sci major I'm sure you'll do fine. [quote name='Genotic' timestamp='1299203582' post='4781620'] What language is used mostly in designing a networking aspect of games? Sorry if I don't know how to word this very well. I mean like in an MMO, the main draw is the ability to connect many players to one centralized game, but what language is doing the work behind the scenes of getting everything connected? Is C++ still the reigning champ in network programming or are there better alternatives when authenticating and handshaking to dedicated servers are your primary goals? [/quote] This is a somewhat educated guess as I've never done networked games before. Most of the time, you're going to be sticking with the language that you're working with to create the game. When you choose a development library like SDL or SFML (which both use C++), they have functions to add networking to your game, so most of the time I don't think you'll be switching to a different language to add networking. I haven't worked with DirectX, but I'm sure they have networking functions. Others like OpenGL which is just a graphics API, lack networking functions, but can be mixed with other libraries like SDL which has networking subroutines (functions/methods).
  • Advertisement