Author Topic: Change grid  (Read 43518 times)

Offline vadali

  • *
  • Posts: 30
  • Karma: +0/-0
    • View Profile
Reply #15 on: March 18, 2008, 09:12:09 AM
Alright then, i must go now to class, but ill go home afterwards, and we will get this to work. it has worked already, so have no worries, it will work again!

Good day,
Vadali



Offline vadali

  • *
  • Posts: 30
  • Karma: +0/-0
    • View Profile
Reply #16 on: March 19, 2008, 04:11:01 PM
Hey,
I checked it, and it seems to generally work.. wanna load up the image you are failing with? did you try a different image?

Vadali



Offline UndCon

  • Support Admin
  • *
  • Posts: 566
  • Karma: +11/-3
    • View Profile
    • UndCon
Reply #17 on: May 01, 2008, 06:17:44 AM
Did you work this out ?



Offline vadali

  • *
  • Posts: 30
  • Karma: +0/-0
    • View Profile
Reply #18 on: May 01, 2008, 07:12:25 AM
Hey,
doug didnt say anything else so far, so I dont know if it worked for him or not, did you try?

anyhow, I had no time recently to go into d3d programming, but i did manage to learn a bit of opengl.

There is already a project that does the desktop VR in linux and opengl in c++ (http://www.wiimoteproject.com/wiimote-desktopvr/vr-headtracking-in-linux-with-opengl-working-t812.0.html), I checked out the code, and it seems like it would be much easier to rewrite this entire image finger manipulation based on his code using opengl rather then messing around with d3d.

by the way, if anyone is interested in opengl, there is a great video tutorial of it (which makes it really a piece of cake), here http://www.videotutorialsrock.com/ , and more specifically for our needs, an opengl texture mapping tutorial (this is what we will basically be doing - texture mapping with rotation only around the z axis plus transformation) here, http://www.nullterminator.net/gltexture.html .

As soon as I have some time, i will do that, but work and school have been eating up my days recently

peace,
vadali



Offline UndCon

  • Support Admin
  • *
  • Posts: 566
  • Karma: +11/-3
    • View Profile
    • UndCon
Reply #19 on: May 03, 2008, 03:03:59 AM
Yes Vadali - I got it to work!

But initially i didnt copied all your modifications so part of the code was missing.

I searched for your name as you wrote // vadali on some locations but not all so i failed getting the code needed.

Then i replaced my "WiiMultipointGrid.cs" with yours, modified some code to suit my needs (searchpath to image, and some settings on screen)

Then i got it to work!

I had to adjust the settings like this


PanelTexture = Direct3D.TextureLoader.FromFile(
                                device,
                                "C:\\manhattan.png",
                                2400,
                                1350,


I simply wrote the width and height of the image...

But it starts out as a very small image in the lower left corner that i have to grab and move in order to have something fun to do with...and despite me entering the exact measures of the image its a square... (ill have to do more with the code)
//UndCon
« Last Edit: May 03, 2008, 03:10:06 AM by UndCon »



Offline vadali

  • *
  • Posts: 30
  • Karma: +0/-0
    • View Profile
Reply #20 on: May 03, 2008, 06:06:49 AM
I am happy it works for you UndCon,
What happen if you dont put the exact length and width of the image?

well, ill update here whenever I get a chance to make this work on multiple images.

be good,
Vadali



Offline UndCon

  • Support Admin
  • *
  • Posts: 566
  • Karma: +11/-3
    • View Profile
    • UndCon
Reply #21 on: May 03, 2008, 07:44:19 AM
I'm not sure about the effect or how it works when implemented
(i never programmed anything for direct3d before)

I did delete most of the code

        PanelTexture = Direct3D.TextureLoader.FromFile(
                                device,
                                "C:\\manhattan.png");
(check intellisense 5 alternatives when deleting the "," after device and adding it again)

I still havent figured out where to change the code to work with image size - i think it has to be in the grid's code or the fact that the code for image is as you wrote "// Change the grids to reflect the image"

So the image is square...as the grid is...changing numGridLines does not affect image

I changed
int gridColor = 0xffffff; //White - was 666666

Ideally we could fill an 2 dimensional array with images from a source like a folder - or Flickr (move stuff into config.ini)

BTW - I didnt try to include a 2nd picture so all that code is deleted...

« Last Edit: May 03, 2008, 08:23:24 AM by UndCon »



Offline vadali

  • *
  • Posts: 30
  • Karma: +0/-0
    • View Profile
Reply #22 on: May 03, 2008, 10:21:11 AM
Ideally we could fill an 2 dimensional array with images from a source like a folder - or Flickr ...

That is what I basically was trying to do.
The actual size of the picture doesn't matter that much, because as long as the ratio of height to width is similar, you can stretch it how you like.

I tried to make it work with two images, but i didnt have the strength to deal with the d3d stuff (and it didnt really work that good). opengl seems so much easier, and iam sure we can make something like that or even better.

I was thinking more in the direction of choosing a directory (or any other image source), displaying them all on the screen, and then you can kinda move them around, rotate and zoom each image, place them on top of each other etc..

This really seems easy, since texture mapping is easy in opengl, and rotating and scaling the textures is also pretty straight forward. So we only have to deal with knowing which image we are "holding", and maintaining some kind of z-order of the images.

just need some freaking time ;)

vadali



Offline UndCon

  • Support Admin
  • *
  • Posts: 566
  • Karma: +11/-3
    • View Profile
    • UndCon
Reply #23 on: May 03, 2008, 10:52:47 AM
Yes that is about the same ideas i got.

In my case the picture is in grid 2.2 and the same size as 1 square as long as gridlines are 20
(starting counting squares bottom left corner)

If we take 20*20 pictures and make sure they are width = height I think we can fill the grid with 1 picture / square

I know 20*20 is alot of pictures- but it's just an example...


About OpenGL - I must look into that...
//UndCon



Offline vadali

  • *
  • Posts: 30
  • Karma: +0/-0
    • View Profile
Reply #24 on: May 03, 2008, 11:23:50 AM
About OpenGL - I must look into that...

you should really check out these video tutorial of opengl i posted above, they really make it simple.. do you do some linux too or just windows?

I know 20*20 is alot of pictures- but it's just an example...

well, we can even start with 2x2 in the beginning, the idea is that once you make this, you can make any N*N.

I really wouldn't bother with d3d, so its a bit of work to port this to opengl, but we really have it almost all done for us by this dude who did the DesktopVR for linux (i only wonder if that could be compiled under windows too, just to be friendly..), its really nice, and only one cpp file long (and its not that long too :) )

vadali



Offline tarunsayal

  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile
Reply #25 on: August 19, 2008, 03:42:02 AM
Hey Vadali gr8 work yaar
well can u tell me a solution of this increasing the size of the image in directX itself as m not knowing openGL at all

Plz help me out as soon as possible.

thanks
Regards
Tarun Sayal



Offline triwyd

  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Reply #26 on: August 19, 2008, 11:14:49 AM
Hi Vadali,

I am a newcomers in this area. I just found the video of Jhonny Lee and downloaded the finger tracking program already. I am not a programmer and don't have any programming skill. I can change the stad image on Desktop VR program from Jhonny Lee, but I can't do that on the finger tracking.
From your previous posted message, I notice that you already have a script that can change the grid with others picture. Can I have the script because I can not find any download link or written script on your previous posted message.
I really need your help, thanks.

Regards,

Tri



Offline tarunsayal

  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile
Reply #27 on: August 19, 2008, 11:25:53 PM
Hiiiiiiii

Hey Tri

http://www.wiimoteproject.com/wiimote-finger-tracking/change-grid/
check out this link this have an attached file of wiimotegrid.cs file in one of the forums now replace the whole project's wiimotegrid.cs with this attached file.
there u will get the solution and the thing u wanted

Well Vadali need ur help.
the code u wrote was the image to be put into one square of the grid.
can u tell me out the way to put the image in the whole grid inspite of putting it in only one grid.


thanks
 and
Gr8 wrk

Tarun Sayal



Offline triwyd

  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Reply #28 on: August 20, 2008, 08:57:33 AM
Hi Tarun,

Thanks for your information, I got the file already.
Can you inform me more detail on how to handle this source file? I already have the C# application on my computer. I proceed the script by replace the text in line 281 with the directory of the picture on my computer. But after this stage i am totally blank and don't know what i have to do next. Can you help me please?

Regards,

Tri



Offline tarunsayal

  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile
Reply #29 on: August 20, 2008, 09:58:32 AM
Hi Tri

No issues after that dude.edit the Path given in the file which refers to the directory and replace it with the image present in your directory.
after u have written the file path the TextureFile function will take the image from the directory path u have given.
execute the program and then u will see that the image is picked and pasted as a texture to one square of the grid.

In case if u try to find out that how to paste the image on the whole of the grid please let me know.

otherwise your issue is solved dude.