Author Topic: Individual Mesh Rotation  (Read 21030 times)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1980
    • zapsolution
Re: Individual Mesh Rotation
« Reply #60 on: June 13, 2018, 05:54:13 pm »
Code: [Select]
there are no "bad looking transformations" in sight, and these meshes aren't spheroid or cuboid at all.
I shall wait for your new mobj.h, because the one i am using doesn't preserve the correct axis alignment as you can see on the attached screen shot.

Test.mtl being used
Code: [Select]
#wallpaper ambiant.png

newmtl tire_4
#rotate 1.0 1.0 0.0 0.5
Ka 1 1 1
Kd 0.18823529779911 0.18823529779911 0.18823529779911
illum 7

newmtl tire_3
#rotate 1.0 1.0 0.0 0.5
Ka 1 1 1
Kd 0.18823529779911 0.18823529779911 0.18823529779911
illum 7

newmtl tire_2
#rotate 1.0 1.0 0.0 0.5
Ka 1 1 1
Kd 0.18823529779911 0.18823529779911 0.18823529779911
illum 7

newmtl tire_1
#rotate 1.0 1.0 0.0 0.5
Ka 1 1 1
Kd 0.18823529779911 0.18823529779911 0.18823529779911
illum 7

newmtl bolt_4
#rotate 1.0 1.0 0.0 0.5
Ka 1 1 1
Kd 0.75 0.0 0.0
Ks 1 0 0
Ns 50
illum 7

newmtl bolt_3
#rotate 1.0 1.0 0.0 0.5
Ka 1 1 1
Kd 0.75 0.0 0.0
Ks 1 0 0
Ns 50
illum 7

newmtl bolt_2
#rotate 1.0 1.0 0.0 0.5
Ka 1 1 1
Kd 0.75 0.0 0.0
Ks 1 0 0
Ns 50
illum 7

newmtl bolt_1
#rotate 1.0 1.0 0.0 0.5
Ka 1 1 1
Kd 0.75 0.0 0.0
Ks 1 0 0
Ns 50
illum 7

newmtl rim_4
#rotate 1.0 1.0 0.0 0.5
Ka 1 1 1
Kd 0.86274510622025 0.86274510622025 0.86274510622025
Ks 1 1 1
Ns 50
illum 7

newmtl rim_3
#rotate 1.0 1.0 0.0 0.5
Ka 1 1 1
Kd 0.86274510622025 0.86274510622025 0.86274510622025
Ks 1 1 1
Ns 50
illum 7

newmtl rim_2
#rotate 1.0 1.0 0.0 0.5
Ka 1 1 1
Kd 0.86274510622025 0.86274510622025 0.86274510622025
Ks 1 1 1
Ns 50
illum 7

newmtl rim_1
#rotate 1.0 1.0 0.0 0.5
Ka 1 1 1
Kd 0.86274510622025 0.86274510622025 0.86274510622025
Ks 1 1 1
Ns 50
illum 7

« Last Edit: June 13, 2018, 05:56:19 pm by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: Individual Mesh Rotation
« Reply #61 on: June 13, 2018, 07:47:10 pm »
Test.mtl being used

Patrice,

You aren't using the values correctly. You are supposed to use +-1/0 or +-1.f/0.f to specify the optional rotation directions and axes, just like when using glRotate().

glRotate() normalizes non-nulls to +-1.f, which #rotate doesn't do. I warned you about that because I thought you might find some interesting usages for this effect. But regretfully, you didn't:

If the array values are other than those two, the mesh exhibits strange scaling effects. But I think you may find them amusing and probably useful too in some of your future implementations. :D

No big thing tho. I can apply normalization to non-nulls when parsing the #rotate meta.
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: Individual Mesh Rotation
« Reply #62 on: June 15, 2018, 10:45:08 am »
Mike

Would it be possible to have the change(s) you have done in mobj.h, to avoid me to use an extra hidden circle around the objects ?

Thank you.
« Last Edit: June 15, 2018, 11:47:20 am by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: Individual Mesh Rotation
« Reply #63 on: June 15, 2018, 07:36:03 pm »
Here you are, Patrice.
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: Individual Mesh Rotation
« Reply #64 on: June 15, 2018, 08:30:47 pm »
Thank you my friend.
Patrice
(Always working with the latest Windows version available...)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1980
    • zapsolution
Re: Individual Mesh Rotation
« Reply #65 on: June 18, 2018, 05:57:57 pm »
Mike

Don't you think that we could release officially version #2.52.
New SyncTimer
New #rotate meta
both seems to be quite reliable for now, then i could post updated animated projects showing the rotation feature in context.

Your thought ?
« Last Edit: June 18, 2018, 06:04:43 pm by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: Individual Mesh Rotation
« Reply #66 on: June 18, 2018, 08:01:58 pm »
Yes, please do, Patrice.

But if somebody wants the sources, I think it will be reasonable to provide the older mobj.h (the way it was in my latest zip) -- without the attempted #group meta. It isn't working yet as I think it should, so its implementation may change with time, and until then it's going to be just dead code.
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)