Jump to content
  • Advertisement

Dzogchener

Member
  • Content Count

    47
  • Joined

  • Last visited

Community Reputation

142 Neutral

About Dzogchener

  • Rank
    Member
  1. Dzogchener

    Wpf, Scrolling Graph and Performance

    Thank you very much for this example. It is major food for thought, thank you. D
  2. Dzogchener

    Wpf, Scrolling Graph and Performance

    Thanks ernow. I am in th emean time doing some research on clipping in wpf....
  3. Dzogchener

    Wpf, Scrolling Graph and Performance

    Hi ernow- Thats a very interesting idea - I would need to do it from right to left rather than the inverse, but I think it would be possible. I havent played with clipping, so will take a look at that approach. you wouldnt happen to know of any examples of this technique online would you? Thanks alot! D.
  4. Dzogchener

    Wpf, Scrolling Graph and Performance

    Hi- That does make total sense to me - many years ago I did Masm+watcom c graphics programming in mode-x (320x240) on the PC. We used to write offline to a 64k buffer and bitblit onto the vgascreen when the crt beam was on its way back to the top (cant remember the term for that). So I was thinking about that approach, perhaps drawing to an offline buffer and then somehow just pasting in the OnRender - I guess its hard for you to know what this is given you dont know wpf. One wrinkle is the window has some transparency, which might not be a major issue. Possibly more of an issue is that I have a rendered grid, and then the lines are drawn onto it. Today on each call to render, I draw the grid, then draw each data series onto the canvas. If I were to look into double-buffering in the theme of above, I think I would need to have one bitmap for the grid, one for the data series, and then xor them onto the same canvas, or something. Thanks for the feedback/food for thought. D
  5. Dzogchener

    Mapping Mouse Click to 3D object

    Hi Mathias, Thanks for your reply yesterday it gave me a lot to think about. In your last reply you mention at the end of performing an inverse calculation to get the initial position. What I cant work out now is given I am using open gl, how I get the world, view and projection matrix so I can do this calculation? I did some more research and found this post: http://www.gamedev.net/community/forums/topic.asp?topic_id=65558. This looks like it essentially goes the other way, producing a value that is in 3D space - maybe if I could then calculate if an object sits within or around that point I could detect which item was selected? Incidentally as I read that post I realise GetDoublev(GL_MODELVIEW_MATRIX) returns the model matrix, which answers my qandry above. Would I be correct in assuming using my own calculations here (eventually) would be more performant than using open gl picking? Samoth mentions calling unproject twice and then doing a collision detection - would anyone have an example of this approach? Many thanks, D
  6. Dzogchener

    Mapping Mouse Click to 3D object

    Hi Mathias, Thanks for your help - much appreciated. Some of my confusion comes from the fact I havent needed to use any matrices yet, beyond the calls to GL. I have a routne that draws a square around the origin using glVertex(..) andI use glTransform and glRotate at particular points. Now that I need to do more math (and I know so far I have got off very lightly), I am not sure if I need to be creating my own matrix objects - I have managed not to use these so far. I will take a look at your links - the first one looks pretty useful in explaining things, albeit for direct x. I appreciate the help, thanks, D
  7. Dzogchener

    Mapping Mouse Click to 3D object

    Hi Mathias, I think you posted just after I did...thanks for the code I will look through it. I found this link just after posting : http://www.opengl.org/resources/faq/technical/selection.htm. This all looks scarily complicated :-( D
  8. Dzogchener

    Mapping Mouse Click to 3D object

    Thanks for the advice.... I found the following link: http://www.glprogramming.com/red/chapter13.html, and wondered why it doesnt mention Unproject and instead mentions selection and picking? Is the red book out of date? Thanks, D
  9. Dzogchener

    Beginner: Help getting started in 3D

    Hi Gauge, My question was a dumb one yesterday and I managed to solve it doing exaclty as you suggest. This now allows me ot build a grid up, and have both the complete grid and the individual squares rotate independently which is what I was after. Again I really appreciate the help. D.
  10. Dzogchener

    Beginner: Help getting started in 3D

    Hi Gauge, Would each square have exactly the same vertices? That is, the only thing that changes is the translation before drawing? Apologies if this is a stupid quesiton. D
  11. Dzogchener

    Beginner: Help getting started in 3D

    Actually I think I have done something wrong... I have created my squares out of quads, and calculated them doing the following: 1. Working out the xplane size and yplane size 2. Workout the number of cols and rows of squares I want to create 3. Map each square onto vertexes around the origin. 4. Set the viewport/camera and translate the z so I see the squares/grid. What this means is if I have an xplane size of say 10 and I want 5 squares, the left square starts at (-5, -5, 0) and extends across x to (-3,-5,0). The next square begins at (-3,-5,-0) and extends to (-1, -5, 0). I never change these vertex values when rendering, I only use the gl.Rotate and Translate to move. I think this is my problem. I am wondering whether each square should be the same, that is (-1, 1, 0) to (1,1,0) with respect to the its dimension on the x axis, and then use rotate and translate to move it. A little lost... Thanks for any help, D.
  12. Dzogchener

    Beginner: Help getting started in 3D

    Managed to get this working after reading the Red book online. Thanks. D.
  13. Dzogchener

    Beginner: Help getting started in 3D

    On the advice from Porsche_Man I have ordered 3D Math Primer. In the mean time I would like to make a bit more progress. I have been reading OpenGL Game Development, but there have been a few things that havent been explained that have left me perplexed. For exampIe I am hoping to port my game to the iPhone eventually, but I have been informed opengl es doesnt support orthographic projection, yet the game development book uses that extensively in all of its examples. Heres what I would just like to do: Create a 10 x 7 grid of squares and have them rendered to most of the screen area. Heres some problems I have: 1. I have a canvas/window that has a height and width - which projection/perspective should I use? 2. What units do I need to be using? If my width is 100 and I dont want a gap between squares, I would work out that the distance is 10 per square. Do you use this approach when building something like a grid here? I have actually managed to build a grid and show it but I had to play with the numbers. I decided some arbitrary numnber to use for the width and height (10.0f) and then divided my area up and plotted using a zero Z value. So I do the following: 1. Set the perspective: Perspective(45.0f, (float)Width / Height, 0.1f, 100.0f) 2. Translate along x,y and z. I set x and y to zero and z to -20f. 3. I then split the view up and draw quads. The grid does appear, but I admit its not exactly clear why, or rather the values arent clear. I just picked 10 out of the air for the width and height. Heres the code in the paint routine (using SharpGL and C#): private void openGLCtrl1_OpenGLDraw(object sender, PaintEventArgs e) { OpenGL gl = openGLCtrl1.OpenGL; gl.Clear(OpenGL.COLOR_BUFFER_BIT | OpenGL.DEPTH_BUFFER_BIT); gl.MatrixMode(OpenGL.MATRIX_MODE); GL.Perspective(45.0f, (float)Width / Height, 0.1f, 100.0f); gl.LoadIdentity(); gl.Translate(translateX, translateY, translateZ); double cols = 10; double rows = 7f; double xplaneSize = 10f; double yplaneSize = 10f; double widthDim = xplaneSize / cols; double heightDim = yplaneSize / rows; for (int c = 0; c < cols; c++) { gl.Begin(OpenGL.QUADS); for (int r = 0; r < rows; r++) { double left = -(xplaneSize / 2) + (c * widthDim); double top = (yplaneSize / 2) - (r * heightDim); gl.Color(0.15f, 0.15f, 0.15f); gl.Vertex(left, top, 0.0); gl.Vertex(left + widthDim - 0.05, top, 0.0); gl.Color(1f, 1f, 1f); gl.Vertex(left + widthDim - 0.05, top - heightDim + 0.05, 0.0); gl.Vertex(left, top - heightDim + 0.05, 0.0); } gl.End(); } } Thanks for any tips on this, D.
  14. Dzogchener

    Help making a start

    Hi, Thanks for the advice, I ordered the book today. D
  15. Dzogchener

    Newbie Help with open GL and 2D

    So I moved the gl.Begin/gl.End into the loop and the grid draws properly. When I change the number of columns x rows I get to a point when the grid stops drawing as a proper table, implying there must be some limit to the number of quads/vertex's you can invoke within gl.Begin/gl.End? Thanks, D
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!