• Content count

  • Joined

  • Last visited

Community Reputation

115 Neutral

About richy19

  • Rank
  1. For a while now I have been trying to accomplish nice smooth and somewhat complex terrain generation, in the long run I would like to evolve this into a planet generator. Started out with reimers tutorials in XNA [IMG][/IMG] Then moving onto pure OpenGL and trying to accomplish creating and displaying the map via shaders: [IMG][/IMG] Which takes me to my last attemp [IMG][/IMG] [IMG][/IMG] I have recently been looking up quadtrees [media][/media] But im stuck as to what to do next. My thoughts are: Generate a large and detailed plane, say 10.000x10.000 units Use some noise function to give it height Create normals Then create index list Create a quadtree of max level 100(for example) then using the current quadtree level, use it as a stride for the index list (so at level 0 I draw a single quad using each corner of the plane as a vertice, at level 1 its subdivided into 4 quads and so on untill the max level) But I dont know if this is how it works, can anyone give me some advice? Also If anyone has some resources on Procedural Terrain on Procedural Planets it would be much appreciated. Thanks
  2. [quote name='Krum110487' timestamp='1345250216' post='4970714'] I could be wrong, but you might have your near a bit off on the orthographicOffCenter, try: CreateOrthographicOffCenter(0.0f, 1.0f, 1.0f, 0.0f, -1.0f, 2.0f); [/quote] It ended up being the z distance thanks. I dont really understand tho, say I put 0 and -2 as the near and far distance. Am I correct to assume that anything with a Z value between these will be displayed? Let me rephrase the question, is the zFar value a point in 3d space (making my logic valid) or is it a length in the negative direction from the zNear value(which is what it seems to be)? by the second explanation I mean for example using -1 and 3 would make anything visible between -1 and -4
  3. I was trying to port some of my old OpenGL stuff to OpenTK however I couldnt get it to work. I am now trying a simple program to display a triangle: This is my setup: MVP = Matrix4.CreateOrthographicOffCenter(0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 2.0f); where the screen is: [source lang="plain"] 0 - 0 1 - 0 --------------------------------------------- | | | | | | | | | | --------------------------------------------- 0 - 1 1 - 1[/source] And these verticies: [source lang="csharp"] float[] vertices = { 0.5f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f };[/source] The triangle should be right in the midle of the screen, well for some reason it isnt. Heres all the code encase its something other than positioning [source lang="csharp"]// Released to the public domain. Use, modify and relicense at will. using System; using OpenTK; using OpenTK.Graphics; using OpenTK.Graphics.OpenGL; using OpenTK.Audio; using OpenTK.Audio.OpenAL; using OpenTK.Input; namespace StarterKit { class Game : GameWindow { float[] vertices = { 0.5f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f }; int vbo; string fragmentSource = "#version 120\n" + "void main(){gl_FragColor = vec4(1.0f, 0.0f, 0.0f, 1.0f);}"; string vertexSource = "#version 120 \n" + "uniform mat4 MVP; attribute vec4 Position;" + "void main(){ gl_Position = MVP * Position; }"; int shaderProgram, vertexShader, fragmentShader; int MVPID, PositionID; Matrix4 MVP; /// <summary>Creates a 800x600 window with the specified title.</summary> public Game () : base(800, 600, GraphicsMode.Default, "OpenTK Quick Start Sample") { VSync = VSyncMode.On; } protected override void OnDisposed(EventArgs e) { GL.DetachShader( shaderProgram, vertexShader ); GL.DetachShader( shaderProgram, fragmentShader ); GL.DeleteShader(vertexShader); GL.DeleteShader(fragmentShader); GL.DeleteProgram(shaderProgram); GL.DeleteBuffers(1, ref vbo); base.OnDisposed(e); } /// <summary>Load resources here.</summary> /// <param name="e">Not used.</param> protected override void OnLoad (EventArgs e) { base.OnLoad (e); GL.ClearColor (0.1f, 0.2f, 0.5f, 0.0f); GL.Enable (EnableCap.DepthTest); GL.GenBuffers (1, out vbo); GL.BindBuffer (BufferTarget.ArrayBuffer, vbo); GL.BufferData (BufferTarget.ArrayBuffer, (IntPtr)(vertices.Length * sizeof(float)), vertices, BufferUsageHint.StaticDraw); vertexShader = GL.CreateShader(ShaderType.VertexShader); GL.ShaderSource( vertexShader, vertexSource ); GL.CompileShader( vertexShader ); fragmentShader = GL.CreateShader( ShaderType.FragmentShader ); GL.ShaderSource( fragmentShader, fragmentSource ); GL.CompileShader( fragmentShader ); shaderProgram = GL.CreateProgram(); GL.AttachShader( shaderProgram, vertexShader ); GL.AttachShader( shaderProgram, fragmentShader ); GL.LinkProgram(shaderProgram); MVPID = GL.GetUniformLocation(shaderProgram, "MVP"); PositionID = GL.GetAttribLocation(shaderProgram, "Position"); MVP = Matrix4.CreateOrthographicOffCenter(0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 2.0f); } /// <summary> /// Called when your window is resized. Set your viewport here. It is also /// a good place to set up your projection matrix (which probably changes /// along when the aspect ratio of your window). /// </summary> /// <param name="e">Not used.</param> protected override void OnResize (EventArgs e) { base.OnResize (e); GL.Viewport (ClientRectangle.X, ClientRectangle.Y, ClientRectangle.Width, ClientRectangle.Height); } /// <summary> /// Called when it is time to setup the next frame. Add you game logic here. /// </summary> /// <param name="e">Contains timing information for framerate independent logic.</param> protected override void OnUpdateFrame (FrameEventArgs e) { base.OnUpdateFrame (e); if (Keyboard [Key.Escape]) Exit (); } /// <summary> /// Called when it is time to render the next frame. Add your rendering code here. /// </summary> /// <param name="e">Contains timing information.</param> protected override void OnRenderFrame (FrameEventArgs e) { base.OnRenderFrame (e); GL.Clear (ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit); GL.UseProgram (shaderProgram); GL.UniformMatrix4(MVPID, false, ref MVP); GL.EnableVertexAttribArray(PositionID); GL.BindBuffer(BufferTarget.ArrayBuffer, vbo); GL.VertexAttribPointer(PositionID, 3, VertexAttribPointerType.Float, false, 0, IntPtr.Zero); GL.DrawArrays(BeginMode.Triangles, 0, 3); GL.DisableVertexAttribArray(PositionID); GL.UseProgram (0); SwapBuffers (); } /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main () { // The 'using' idiom guarantees proper resource cleanup. // We request 30 UpdateFrame events per second, and unlimited // RenderFrame events (as fast as the computer can handle). using (Game game = new Game()) { game.Run (30.0); } } } }[/source]
  4. Non deprecated tutorials

    As you know with openGL 3.x they have deprecated the fixed function pipeline meaning that everything has to be done with shaders and VBO, so I was wondering if there are any plans to swap all the NeHe tutorials into non deprecated openGL?
  5. another UK university help thread.

    Is there anything you would recommend i put on the personal statement? I see that some of you have been or are at university and you opinion would really help me as i am clueless as to what to put.
  6. another UK university help thread.

    I am thinking of sending them an email just to get their view. So far i have: Quote: Hi. I am currently looking into different universities as i am planing to apply this year. I wish to do some sort of computer programming in the future and have a strong lean towards the games sector. I wondered if you could answer some questions to help me choose between taking the "computer science with games development" or just the normal "computer science" and take some of the modules of the games development course. 1- What percentage of students ultimately end up in the games sector after taking the games development Bsc course? 2- Do you often get studios or companies asking for undergraduates? And if so would you give preference to those students that have taken the games course or would you offer the job to any of the students that was looking to work in that sector? 3- What contacts does the department have within the games sector? Anything else i could add?
  7. another UK university help thread.

    Quote:Original post by HackSlash Before I answer that, take a look at the Skillset accredited courses on their website here. The only course that's accredited at the University of Hull is the Msc Games Programming course and these are the courses that have been praised by the games industry. Y'know, not to make you're decision even more tougher ;) Im not really 100% sure how much i trust that site, im sure their doing there best to research all the courses and such, but derby's course isnt on there and thats meant to be one of the best courses in the country (or so i have heard)
  8. another UK university help thread.

    Sorry I meant that if the lecturers heard of any jobs going, would they give preference to the students in the games course? Or would they just offer it to who ever did the best in their class(and consequently would probably be better at the job) ?
  9. another UK university help thread.

    Would you (or anyone for that matter) recommend doing the: Computer Science with Games Development or Computer Science, and then do the game modules? Someone passed me the undergraduate handbook thing and the only modules that the comp science does that the games one doesn't is an intro into teaching IT which i wouldn't mind taking, however i guess they would give preference of any jobs in the games industry to those that specifically take the games development course. Or would they just offer any jobs to those that do the best in the classes regardless of what course you registered for?
  10. another UK university help thread.

    Do you have any idea as to what companies they have contact with? Also how good would you say there level of teaching was?
  11. Hi i first of all just want to say that all though i haven't posted much on here i have been lurking the forum for a while, and by doing that i have seen a few of the "what course to do" threads. I have read all the information you usually give those people as well as some other stuff i found, the thing is: Next year 2011 i will be starting university and there fore now is the time i have to choose and apply for them, however im having a bit of a hard time choosing what course to do, on one hand i love games and programming and i would love to work as a programmer, on the other hand im realistic and know that its hard enough to get a job at all let alone one in the games industry. So my debate is whether to try and go for derby's programming course(which i have seen people say is very good) or go to one of the other universities and take computer science with a few modules that would benefit a games career. Now until now i wouldn't even of asked however i am reading more and more here and i see that derby's got probably the best course for programming(games wise that is) and they probably have good contacts within the industry, so they would be best suited for say helping me get a summer internship or something. Apart from that i would also like your help with anything i can do at home to further my knowledge into the subject, im currently learning C++ by creating a simple game with SFML as well as learning some advanced maths. Oh and also would it be ok if i posted a personal statement once i have a draft see what you think? As well as if you have any advice on it? Finally i dont know if anyone here goes or has been to Hull university, but anyone know what their contacts in the industry are like and such? Thanks to anyone and everyone that has taken the time to read that, really appreciated.
  12. im confused as to why its in this section :P what language is it made with?
  13. C++ or C# as first C language

    tried googleing but i cant find the answer if i make a game and want to play it on the 360, do i need LIVE Gold or the XNA subscription thing? i know to sell them i do but i didnt know if i needed it just to play homemade games
  14. C++ or C# as first C language

    Quote:Original post by rip-off Flash is probably the dominant language for games made by individuals. no, flash is the devil :P i dont really like flash as its really web based and i want to get into proper languages that offer more than just little web stuff note that i also wish to apply the languages to other things than gaming
  15. C++ or C# as first C language

    just wanted to clear that when i said that they are game specific i meant that there the main languages games are made off usually in C++ however with XNA C# is being used more