Author Topic: There are many ways to go to Rome.  (Read 53438 times)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: There are many ways to go to Rome.
« Reply #165 on: April 18, 2019, 01:21:28 pm »
ptInCircle, is currently not used, it is there to remind me on how to do it.
All silly 1-byte large bools have been changed throughout the entire OR sources to 4-byte BOOLs to ensure proper alignment of structure members on DWORD boundaries.

Quote
Thanks for the texture!
You're welcome! Alternatively, you can as well use the UV checker texture or, in fact, anything that helps maintain a clear view of your whereabouts.

Quote
I didn't even thought of those ;)
Frankly, I thought you should've incorporated .TGAs and .DDS's directly into your GDImage long ago. They are no worse than your beloved .PNG or .TIF formats that GDImage handles intrinsically.

Quote
Did you try to click on the check ListView to select a specific mesh?
Naturally, I did. Nothing happens in either carousel.obj or many more other meshes even if I manage to select a correct texture thumbnail in the list of textures irrelevant to the given mesh material. ;)

Quote
I did try to use something visible hover any texture background...
I'm not talking about the wireframe or bullet colors but rather about their blurriness (out-of-focus-ness) as the zoom-in ratio increases towards its maximum. I still insist that the thickness and size of lines and bullets at any magnification should stay 1 px and 3x3 pxs, respectively.

Quote
About small texture size, i did not focuse on that problem, because until now my main concern was to find a relying way to move the hot spot in real time.
Hopefully, you'll come back to that issue (I believe it is inherent in GDImage's implementation of Tor's inner functionality) when you have time for scheduled GDImage code maintenance.

Quote
Now that texcoord update is solved, we can start to add bells and whistles.
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1980
    • zapsolution
Re: There are many ways to go to Rome.
« Reply #166 on: April 18, 2019, 02:34:22 pm »
looks like we have to find the good algo to convert correctly 3D coordinates into 2D coordinates…

Quote
I'm not talking about the wireframe or bullet colors but rather about their blurriness (out-of-focus-ness) as the zoom-in ratio increases towards its maximum. I still insist that the thickness and size of lines and bullets at any magnification should stay 1 px and 3x3 pxs, respectively
.
This is because i had to make a choice between speed and quality, speed means stretching the same bitmap what ever the zoom being used, that is of course causing the blur effect.  :-\

I have some urgent home work to perform first, before i could work more for my hobby.  ::)
« Last Edit: April 18, 2019, 02:50:58 pm by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1980
    • zapsolution
Re: There are many ways to go to Rome.
« Reply #167 on: April 18, 2019, 10:02:56 pm »
Quote
I thought you should've incorporated .TGAs and .DDS's directly into your GDImage long ago

I am working on it...
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: There are many ways to go to Rome.
« Reply #168 on: April 19, 2019, 08:07:54 am »
Excellent! :)
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1980
    • zapsolution
Re: There are many ways to go to Rome.
« Reply #169 on: April 19, 2019, 08:21:44 am »
I shall post a Pandora's update today to let Tor be OR compliant :).
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: There are many ways to go to Rome.
« Reply #170 on: April 19, 2019, 08:25:33 am »
I'm looking forward to testing it against some of my TGA/DDS models! :)
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1980
    • zapsolution
Re: There are many ways to go to Rome.
« Reply #171 on: April 19, 2019, 10:01:44 am »
Here is pandora to test with your DDS/TGA models (with the updated source).

I only checked with TGA (Lion).

Next step, we must figure what to do to render correctly the 2D changes into the 3D view  :-\
« Last Edit: April 19, 2019, 01:27:26 pm by Michael Lobko-Lobanovsky »
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: There are many ways to go to Rome.
« Reply #172 on: April 19, 2019, 12:41:27 pm »
Here is pandora to test with your DDS/TGA models (with the updated source).
It works correctly for both .TGA and .DDS for me, thanks! Can the TGA and DDS code be now excluded (at least partially) from the OR code proper?

Quote
Next step, we must figure what to do to render correctly the 2D changes into the 3D view  :-\
Obviously you failed to get the meaning of my hints correctly... (which is of course entirely my own fault)

The 2D UV changes are rendered OK in the 3D viewport now. What you're seeing below is an absolutely correct effect of making the UV quadrangle occupy a twice smaller area in its texture. The LT/RT/RB/LB tags have drifted out of, and beyond, the 3D mesh borders, each in its respective direction.

Dragging the textured quadrangle hot spots towards its center to make it smaller in 2D is equivalent to dragging them away from its center making it larger in 3D. That's why the movement of a bullet in 2D and 3D is perceived to be taking place in opposite directions.

The four corners of the mesh in the 3D viewport is not the same thing as the four corners of its texture in the UV editor!!! :)
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1980
    • zapsolution
Re: There are many ways to go to Rome.
« Reply #173 on: April 19, 2019, 01:44:29 pm »
Quote
Can the TGA and DDS code be now excluded (at least partially) from the OR code proper?
I have to export them, and i did change the name from LoadTGATexture and LoadDDSTexture, to LoadTGA /LoadDDS.
I shall do this first thing.

Quote
Obviously you failed to get the meaning of my hints correctly…
The four corners of the mesh in the 3D viewport is not the same thing as the four corners of its texture in the UV editor!!! :)
I still have to figure what to do exactly :-[

I have also to check for small texture size...
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: There are many ways to go to Rome.
« Reply #174 on: April 19, 2019, 01:57:05 pm »
I still have to figure what to do exactly :-[

Please do not hesitate to ask in case anything is still not clear to you regarding the differences in 2D and 3D views. I know you must feel a bit dizzy till you get fully accustomed to considering the UV coords (and UV wireframe!) in 2D space as something different from, and not related to, the vertex geo coords and vertex wireframe in 3D space. And I know it takes time. :)
« Last Edit: April 19, 2019, 11:03:40 pm by Michael Lobko-Lobanovsky »
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: There are many ways to go to Rome.
« Reply #175 on: April 19, 2019, 02:06:21 pm »
Tell you what, Patrice.

We must have a system-wide unlimited undo-redo stack in ObjReader similar to what you see in your C4D, and I see in all my 3D editors, in order to be able to revert some of, or discard entirely, our changes to UVs, or vertex positions (when we have a vertex editor), or lighting colors, to any depth at any time before we save our changes to disk. The stack must be universal to store efficiently any kind of data affected by our possible changes.

In case you just don't know what to do next with Tor, do you think you could design and implement such a stack?
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: There are many ways to go to Rome.
« Reply #176 on: April 19, 2019, 02:27:46 pm »
Tor's another very handy feature could be as follows.

(I think the zoom control should not rely on mouse hover on the hot spot to select it automatically. Selection should instead be done manually in response to an LMB down on the hot spot of interest only.)

So, when the LMB down occurs anywhere within the zoom control other than on a hot spot, it should be used (as the cursor shape currently suggests!) for clutching the zoom control viewport and dragging it around within the texture bounds similar to how the red square can now be dragged in the zoom widget. Then the user won't have to lose time aiming at the scroll bars to drag the 2D viewport here or there just a bit. Let the scroll bars stay for those who don't care about their time but also allow those who do care to be able to work in the 2D viewport more efficiently. :)
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: There are many ways to go to Rome.
« Reply #177 on: April 19, 2019, 02:44:59 pm »
In the same vein, arrow keys are OK to control the selected bullet in test mode but generally, bullet repositioning should be done by LMB down and drag. It is much faster and handier and intuitive than what we have now.
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1980
    • zapsolution
Re: There are many ways to go to Rome.
« Reply #178 on: April 19, 2019, 06:43:01 pm »
Here is a dual patch.

pandora.zip with new exported functions
C_IMPORT long      ZI_IsFileImage(IN WCHAR* zFileName);
C_IMPORT long      ZI_LoadTGA(IN WCHAR* ImgName, OUT LONG_PTR* img);
C_IMPORT long      ZI_LoadDDS(IN WCHAR* ImgName, OUT LONG_PTR* img, OUT LONG* nSwapColors);

Tor.zip (all DDS/TGA code removed)
Tor.cpp, Main.cpp, mobj.h, globals.h, GDImage.h, Tools.h

The 2D to 3D texCoord problem is still not solved, search in Tor.cpp for
// SetTexCoordinate

Solving TexCoordinate is the priority, i have to search on Google for a source of inspiration on how to convert efficiently 2D coordinates to 3D UV's (except if you remember what you did in your old FSBL code).

Quote
(I think the zoom control should not rely on mouse hover on the hot spot to select it automatically. Selection should instead be done manually in response to an LMB down on the hot spot of interest only.)
This is the purpose of ptInCircle to create a tolerance when selecting a hot spot with the mouse rather than mouse hover.
« Last Edit: April 19, 2019, 07:51:19 pm by Michael Lobko-Lobanovsky »
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: There are many ways to go to Rome.
« Reply #179 on: April 19, 2019, 07:50:54 pm »
Thanks for the mods, Patrice! They fit in my .DDS and .TGA arsenal perfectly.

Can you please give me an exact description in your own words (don't mind the English grammar or do it in French if you find it easier) of what seems so problematic to you in your current implementation of 2D<->3D transform? What bad effects exactly the existing transform produces in the respective viewports?
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)