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. Hi- I posted the following message to the .Net forum, but I am also interested in how this could be done differently, possibly agnostic to wpf per se. From a graphics programming perspective how could this be achieved and not cost the earth in cpu: Thanks for any advice: Hi, I am looking for some design/graphics advice. I have built a little graph in Wpf, which is a descendant of Canvas. The graphs core design is that it scrolls from right to left, exactly like the CPU performance graph does in the Windows task manager. I achieved this by running through the data points, drawing from left to right. Each time graph is updated I essentially move one data point in, and draw a little from the left of the previous. What this essentially means is that when I have enough data points to fill the actual graph visually, I run from the left position to the right position, pulling out the data points as I go. I have to do this for every update. So if the graph is visually 600 pixels wide, and the refresh rate is every 1 second, that involves drawing each line from left to right, every single time. I am wondering if there is a smarter approach to this type of problem. I knocked up the logic for this as it stands today, so I expect I am doing this completely wrong. This approach seems to be burning CPU time like nobodies business. Any advice? Thanks, D
  6. Hi, I am looking for some design/graphics advice. I have built a little graph in Wpf, which is a descendant of Canvas. The graphs core design is that it scrolls from right to left, exactly like the CPU performance graph does in the Windows task manager. I achieved this by running through the data points, drawing from left to right. Each time graph is updated I essentially move one data point in, and draw a little from the left of the previous. What this essentially means is that when I have enough data points to fill the actual graph visually, I run from the left position to the right position, pulling out the data points as I go. I have to do this for every update. So if the graph is visually 600 pixels wide, and the refresh rate is every 1 second, that involves drawing each line from left to right, every single time. I am wondering if there is a smarter approach to this type of problem. I knocked up the logic for this as it stands today, so I expect I am doing this completely wrong. This approach seems to be burning CPU time like nobodies business. Any advice? Thanks, D
  7. 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
  8. 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
  9. 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
  10. 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
  11. Hi, I would really like some pointers/advice on how I can detect which 3D object a mouse click sits within. I have build a 10x10 grid, looking at it face on. I want to click one of the squares so I can do somethign with it, but I am not sure how I map a mouse click to 3D coordinates and then work out if the click resides within an object. I am using open gl, so my transforms etc are happening through it, so all I have is a square around the origin that is translated when I draw it. I guess I can use the translation calucation to map a position on my x and y plane... Any advice on this would be most appreciated, D
  12. 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.
  13. 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
  14. 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.
  15. Dzogchener

    Beginner: Help getting started in 3D

    Managed to get this working after reading the Red book online. 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!