Jump to content
  • Advertisement
Sign in to follow this  
BytePtr

OpenGL How this can done in OpenGL? [video example]

This topic is 3442 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Here is one video.
There is a textured grid. Grid is fixed size, each cell has it's own X,Y value. If user presses mouse button and drags mouse there is blocks (with size 64x64) drawn on the grid!! I have actually this grid, each block has fixed size (64x64), there is 256*256 (width*height) of them (this is grid max size). Is there anything general (algo, example, book) that helps me achieve that? I make a grid, and when dragging with mouse i draw blocks at mouse cursor. And i need this in OpenGL. I know that i must translate screen coords to world coords. OK, but how to draw blocks at mouse. One such block (minimum) always must be there. With mouse user can draw them more. And i have this example: But it doesnt draw cubes, but planes on grid. "From 2d to 3d in opengl, opengl coordinates tutorial" http://www.og.delcode.com/ Any help with that?

Share this post


Link to post
Share on other sites
Advertisement
The technical knowledge it takes to do this is not so vast that it is out of the reach of a new programmer, however, it does take some understanding of linear algebra.

To briefly sum it up, the method used involves taking the 2d position of the mouse on the screen and using the view matrix to generate a ray. This ray, as it moves, creates a cuboid.

If you want to get into this the first thing you need to do is to learn about linear algebra, in particular, how matrices and vectors are used in 3D rendering.

Share this post


Link to post
Share on other sites
Thanks for reply. Im willing to learn anything that is needed to finish my project.

But mainly im like hacker. Im hacking code together until it starts working and works for me. So far this approach worked for me. Somehow im learning like that.


It's 03:15 A and im not sleeping. I just (hacked) solved this problem
http://www.gamedev.net/community/forums/topic.asp?topic_id=528945

This was indeed memory allocation problem. Allocated enough and works fine.


Thanks Brother Bob.

Share this post


Link to post
Share on other sites
hi,
the video looks verry good,
perhaps this links can you help:
-> MayaCamera & FloatyCamera
i dont know whats your os is: (linux & win)
here the Link:

http://www.cis.njit.edu/~nichol/courses/it360/

hope its helpful
regards nomads

Share this post


Link to post
Share on other sites
Thanks nomads for the sources.
But i don't have problems with camera or rotation. I solved them.

I have problems figuring out how to draw boxes with mouse in 3D.
Like in video.


I need examples about this. I have only one.


I need more sources related to drawing with mouse, ray picking and so on.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!