• Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

148 Neutral

About guptan

  • Rank
  1. @Goliath Forge Thanks for clarifying that camera math is right. GDI is slow. I used GDI because other alternatives like SDL, Direct2D etc. comes with a lot of boiler plate codes and extra libraries and DLLs. The students will have trouble downloading them and setting them.And the aim of this project is to teach implementing math behind modelling viewing and projection. I am not going to implement lighting, shading, texture mapping, etc. And for me the project is finished when I implement frustum culling.     @JoeJ I had thought about frustum culling. But the thing holding me back was how to deal with triangles which are partially inside the view frustum. The readings on rendering pipeline say triangles are divided and new triangles are generated in that case. I don't know the algorithm for that. If I reject those triangles which are partially inside viewing frustum I think the rendered image might appear with holes.
  2. I recently coded a wireframe renderer which use GDI calls and a little help from MESA project. The code is here. https://github.com/mmj-the-fighter/SWR   It has a bug:  When the camera comes close to the mesh the application gets non responsive. and the rendered image gets inverted when the camera move past the mesh. When i turn on z buffering it doesn't happen.   Hints for testing: To move camera: (UP arrow key) To turn on z buffering: (search for "vp.scr->EnableDepthCheck(false);" and make 'false' to 'true' )   I am facing this bad bug for a month.  I have no clue how to solve it.    This project aims undergraduate students for teaching them the fundamentals of 3D graphics. So your help is greatly appreciated.   Thanks in advance.  
  3. Is C# in Unity3D worth learning?

     C# is worth learning. Microsoft uses C#. They have opensourced .NET too so that they can propagate C# and its siblings to all platforms. Unity solves the basis tasks in rendering, physics, networking etc. It means it takes a lot of perspiration from our side to produce a game of industrial standards. For example think about making a racing game. We are provided with interfaces like [rigid body] http://docs.unity3d.com/Manual/class-Rigidbody.html , [spring joint] http://docs.unity3d.com/Manual/class-SpringJoint.html etc only. Think about how to add the enemy car logic. And also think about making the software design of the game(class diagram etc.). The project will have minimum budget in terms of time and money. Say for eample 2 months. Now you will agree working with Unity is hard.   Finally C++ is not just for console. Take a trial of VisualStudio, you will understand. And tell to those who say Unity3D is too simple  to write a complex shader for Unity3D.
  4. Instead of targeting a language I think you should target a genre and platform. That will get you which language and tools you should make and / or learn.
  5. Hi, The following is a shader I wrote for rubix cube. I can see it has some educational value. Feel free, this is in [b]public domain[/b]. //FragmentProgram [code] varying vec4 color; void main() { gl_FragColor = color; } [/code] //VertexProgram [code] varying vec4 color; const mat4 pal0 = mat4(1,0.55,0,1,0,0.9,0,1,1,0,0,1,0,0,0.8,1); const mat4 pal1 = mat4(1,1,1,1,1,1,0,1,0,0,0,0,0,0,0,0); void colorRubix() { if( abs(gl_Normal.x) > 0.5 ) { if(sign(gl_Normal.x) > 0.0) { color = pal0[0]; //orange; } else { color = pal0[1]; //green } } else if( abs(gl_Normal.y) > 0.5 ) { if(sign(gl_Normal.y) > 0.0) { color = pal0[2]; //red } else { color = pal0[3];//blue; } } else if(abs(gl_Normal.z) > 0.5 ) { if(sign(gl_Normal.z) > 0.0) { color = pal1[0];//white } else { color = pal1[1];//yellow } } } void colorNormalDebug() { color = vec4( clamp(abs( (gl_Normal + 1.0) * 0.5),0.0,1.0), 1.0 ); } void colorHashed() { //Note:under construction, experimental vec3 n = (gl_Normal + 1.0); float k = 4.0 * n.y + n.z; k += 2.0*n.x; k += 5.0; k = clamp(k,0.0, 6.0); //use k as an index to fetch a color; } void main() { color = vec4(1,1,1,1); colorRubix(); ///colorNormalDebug(); //fallback option gl_Position = ftransform(); } [/code]
  6. random points around an axis

    Thank you. I did it with your help.
  7. random points around an axis

    I will give you more details to my question. This is originally for spewing a set of billboards. When the player shoots a target, a ray is casted towards the target to find the hit point. now hit point - rayDir * randomDistance will give me a point along the ray. Now I want this point to be rotated around the negated rayDir at an angle. How do I do that?
  8. I want to get a set of random vectors from a hit point when I cast a ray. The random vectors should be inside a cone. Please help.
  9. animals behavior

    Thanks, I will check it out.
  10. animals behavior

    Thanks a lot.
  11. animals behavior

    I am making a wild life game in which animals are expected to do the following. They wander most of the time in the jungle with terrain. The animals will attack the player on sight follow the player closely to kill, it will avoid obstacles, but will not climb large slopes. My question is: with out a waypoint graph or navigation graph on the terrain, can i make it. Eg.I can make use of this techniques: http://www.red3d.com/cwr/steer/
  12. I hoped you would point me to some video trailers.
  13. Thank you. Since I had made a working solution, what I really need is some references. Do you know any game which does this?
  14. Hi, I am trying to make a camera animation. The prototype which I made using unity3d works ok but I need to watch some professional quality solutions. I need to orbit the camera around the avatar when it is killed, in a circular orbit for some time. eg. I need to know does the obstacles on the way become translucent. Or does the camera avoids obstacles and move towards target etc. I know Project IGI game has this kind of animation. If you know any other references please reply. Sorry that I don't play games too often.
  15. You must be knowing how to write shaders for opengl 4.2 and make it running. Try a port of the following code(most probably no change), for matrix calculations (translation, rotation, scaling etc.) to get the uniform variables that you pass to your shader. http://opengles-book-samples.googlecode.com/svn/trunk/iPhone/Common/esTransform.c
  • Advertisement