<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Hotspot rotation example that rotates horizontally and vertically in GDL</title>
    <link>https://community.graphisoft.com/t5/GDL/Hotspot-rotation-example-that-rotates-horizontally-and/m-p/642134#M7228</link>
    <description>&lt;P&gt;The problem is you do not want to rotate the horizontal hotspot code (ROTz) horizontally but you do want to rotate it vertically.&lt;/P&gt;
&lt;P&gt;And you don't want to rotate the vertical hotspot code (ROTx) vertically but you do want to rotate it horizontally.&lt;/P&gt;
&lt;P&gt;And you actual object you want to rotate both.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, just thinking out load without actually testing it myself, you would need to ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ROTz&amp;nbsp;&amp;nbsp; !!rotate vertical hotspot horizontally only&lt;/P&gt;
&lt;P&gt;code for vertical hotspot&lt;/P&gt;
&lt;P&gt;DEL 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ROTx&amp;nbsp;&amp;nbsp;&amp;nbsp; !!rotate horizontal hotspot vertically only&lt;/P&gt;
&lt;P&gt;code for horizontal hotspot&lt;/P&gt;
&lt;P&gt;DEL 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ROTz&lt;/P&gt;
&lt;P&gt;ROTx&lt;/P&gt;
&lt;P&gt;code for object&lt;/P&gt;
&lt;P&gt;DEL 1&lt;/P&gt;
&lt;P&gt;DEL 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Barry.&lt;/P&gt;</description>
    <pubDate>Tue, 03 Dec 2024 15:00:01 GMT</pubDate>
    <dc:creator>Barry Kelly</dc:creator>
    <dc:date>2024-12-03T15:00:01Z</dc:date>
    <item>
      <title>Hotspot rotation example that rotates horizontally and vertically</title>
      <link>https://community.graphisoft.com/t5/GDL/Hotspot-rotation-example-that-rotates-horizontally-and/m-p/642126#M7227</link>
      <description>&lt;P&gt;Hi all!&lt;/P&gt;&lt;P&gt;Can someone proved me with an example code of 2 hotspots that rotate&amp;nbsp;horizontally and vertically&lt;/P&gt;&lt;P&gt;For example you have a box that you rotate 35 degrees horizontally and then rotate it 35 degrees&amp;nbsp;vertically (hotspot follows rotation)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2024 14:12:23 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Hotspot-rotation-example-that-rotates-horizontally-and/m-p/642126#M7227</guid>
      <dc:creator>Domagoj Lukinic</dc:creator>
      <dc:date>2024-12-03T14:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: Hotspot rotation example that rotates horizontally and vertically</title>
      <link>https://community.graphisoft.com/t5/GDL/Hotspot-rotation-example-that-rotates-horizontally-and/m-p/642134#M7228</link>
      <description>&lt;P&gt;The problem is you do not want to rotate the horizontal hotspot code (ROTz) horizontally but you do want to rotate it vertically.&lt;/P&gt;
&lt;P&gt;And you don't want to rotate the vertical hotspot code (ROTx) vertically but you do want to rotate it horizontally.&lt;/P&gt;
&lt;P&gt;And you actual object you want to rotate both.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, just thinking out load without actually testing it myself, you would need to ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ROTz&amp;nbsp;&amp;nbsp; !!rotate vertical hotspot horizontally only&lt;/P&gt;
&lt;P&gt;code for vertical hotspot&lt;/P&gt;
&lt;P&gt;DEL 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ROTx&amp;nbsp;&amp;nbsp;&amp;nbsp; !!rotate horizontal hotspot vertically only&lt;/P&gt;
&lt;P&gt;code for horizontal hotspot&lt;/P&gt;
&lt;P&gt;DEL 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ROTz&lt;/P&gt;
&lt;P&gt;ROTx&lt;/P&gt;
&lt;P&gt;code for object&lt;/P&gt;
&lt;P&gt;DEL 1&lt;/P&gt;
&lt;P&gt;DEL 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Barry.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2024 15:00:01 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Hotspot-rotation-example-that-rotates-horizontally-and/m-p/642134#M7228</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2024-12-03T15:00:01Z</dc:date>
    </item>
    <item>
      <title>Re: Hotspot rotation example that rotates horizontally and vertically</title>
      <link>https://community.graphisoft.com/t5/GDL/Hotspot-rotation-example-that-rotates-horizontally-and/m-p/642222#M7231</link>
      <description>&lt;P&gt;Is the movement dependant or independant? And you are wanting to define them by angle given a set distance?&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2024 01:17:02 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Hotspot-rotation-example-that-rotates-horizontally-and/m-p/642222#M7231</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2024-12-04T01:17:02Z</dc:date>
    </item>
    <item>
      <title>Re: Hotspot rotation example that rotates horizontally and vertically</title>
      <link>https://community.graphisoft.com/t5/GDL/Hotspot-rotation-example-that-rotates-horizontally-and/m-p/642245#M7233</link>
      <description>&lt;P&gt;Yes.&lt;/P&gt;&lt;P&gt;I want to define both rotation by variable, moving hotspot is at a fixed distance lets say at&amp;nbsp; A,0 (End of box) and vertical hotspot is at A/2,0 (half length of box)&amp;nbsp; but when I change the angle, moving hotspot needs to be at that location (see code) the problem is when I set vertical rotation my horizontal plane is wrong. I am imputing the wrong coordinates but I do not know anymore how to it&amp;nbsp;&lt;SPAN&gt;&lt;span class="lia-unicode-emoji" title=":grinning_face_with_sweat:"&gt;😅&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;material mat1
rotz verticalRot
roty horizontalRot
addy -0.5/2
hotspot	0,0,0
hotspot	0,0.5,0
hotspot	0,0,0.25
block 1,0.5,0.25
del top

unID=000


!=== HORIZONTAL ROTATION ===!
hotspot	COS(verticalRot),SIN(verticalRot),0, unID, horizontalRot, 4: unID = unID + 1                                      			                                                    !--- BASE
hotspot	COS(verticalRot)*COS(horizontalRot)*0.5,SIN(verticalRot)*COS(horizontalRot)*0.5,-TAN(horizontalRot)*COS(horizontalRot)*0.5, unID, horizontalRot, 5: unID = unID + 1		!--- MOVEING
hotspot	0,0,0, unID, horizontalRot, 6: unID = unID + 1																												                        !--- CENTAR
	angleForRefence=verticalRot+90
hotspot COS(angleForRefence)*5,SIN(angleForRefence)*5,0, unID, horizontalRot,7: unID = unID + 1																				                        !--- REFERENCE
!=== HORIZONTAL ROTATION ===!

!=== VERTICAL ROTATION ===!
hotspot	5,0,-TAN(horizontalRot)*COS(horizontalRot), unID, verticalRot, 4+128: unID = unID + 1                                      						                !--- BASE
hotspot	COS(verticalRot)*COS(horizontalRot),SIN(verticalRot)*COS(horizontalRot),-TAN(horizontalRot)*COS(horizontalRot), unID, verticalRot, 5: unID = unID + 1     !--- MOVEING
hotspot	0,0,-TAN(horizontalRot), unID, verticalRot, 6: unID = unID + 1                                           						                !--- CENTAR
hotspot	0,0,5, unID, verticalRot, 7: unID = unID + 1    
!=== VERTICAL ROTATION ===!                                         															                    !--- REFERENCE&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 04 Dec 2024 07:06:48 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Hotspot-rotation-example-that-rotates-horizontally-and/m-p/642245#M7233</guid>
      <dc:creator>Domagoj Lukinic</dc:creator>
      <dc:date>2024-12-04T07:06:48Z</dc:date>
    </item>
    <item>
      <title>Re: Hotspot rotation example that rotates horizontally and vertically</title>
      <link>https://community.graphisoft.com/t5/GDL/Hotspot-rotation-example-that-rotates-horizontally-and/m-p/642282#M7234</link>
      <description>&lt;P&gt;This is better.&lt;/P&gt;
&lt;P&gt;The two hotspots need different radii, other wise you will only be able to select one of them.&lt;/P&gt;
&lt;P&gt;The inner one is horizontal and the outer one is vertical.&lt;/P&gt;
&lt;P&gt;I cheated and rotated the horizontal hotspot script and just substituted the vertical parameter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;material mat1
roty verticalRot
rotz horizontalRot
hotspot	0,0,0
add -0.5, -0.25, -0.125
block 1,0.5,0.25
del 1
del 1
del 1

unID=000


roty verticalRot
!=== HORIZONTAL ROTATION ===!
hotspot	0,0,0, unID, horizontalRot, 6: unID = unID + 1													!--- CENTAR
hotspot	0.5,0,0, unID, horizontalRot, 4: unID = unID + 1                                      			!--- BASE
hotspot	COS(horizontalRot)*0.25,SIN(horizontalRot)*0.25,0, unID, horizontalRot, 5: unID = unID + 1		!--- MOVEING
hotspot 0,0,1, unID, horizontalRot,7: unID = unID + 1			!--- REFERENCE
!=== HORIZONTAL ROTATION ===!
del 1

rotz horizontalRot
rotx -90
!=== VERTICAL ROTATION ===!
hotspot	0,0,0, unID, verticalRot, 6: unID = unID + 1													!--- CENTAR
hotspot	0.5,0,0, unID, verticalRot, 4: unID = unID + 1                                      			!--- BASE
hotspot	COS(verticalRot)*0.30,SIN(verticalRot)*0.30,0, unID, verticalRot, 5: unID = unID + 1		!--- MOVEING
hotspot 0,0,1, unID, verticalRot,7: unID = unID + 1			!--- REFERENCE
!=== VERTICAL ROTATION ===!
del 1
del 1
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Barry.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Dec 2024 08:54:32 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Hotspot-rotation-example-that-rotates-horizontally-and/m-p/642282#M7234</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2024-12-04T08:54:32Z</dc:date>
    </item>
    <item>
      <title>Re: Hotspot rotation example that rotates horizontally and vertically</title>
      <link>https://community.graphisoft.com/t5/GDL/Hotspot-rotation-example-that-rotates-horizontally-and/m-p/642446#M7241</link>
      <description>&lt;P&gt;If stacking angle hotspots does not work, you could script intermediate x, y and z parameters that feed back into the angles. One advantage of this is that you can use the x and y coordinates in 2D to control both the pitch and yaw.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Barry, your vertical reference axis needs to shift for the given horizontal rotation else the hotspot vs object rotation axis do not match. Adjusting the base, reference and sometimes centre hotspot in relation to a different transformation is a pain...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Edit:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Transformation in the OPs code is indepentant.&lt;/P&gt;
&lt;P&gt;Transformation in Barry's code is dependant.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the issue here is that the gizmo is not lining up with the rotation when a pitch that isn't zero, this is caused by your centre hotspot not moving. The gizmo rotation is based on the plane formed by the centre, base and moving hotspot with the orientation being defined by the reference, hence with your static centre point, this plane rotates out of line with the actual rotation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ling.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2024 09:15:03 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Hotspot-rotation-example-that-rotates-horizontally-and/m-p/642446#M7241</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2024-12-05T09:15:03Z</dc:date>
    </item>
    <item>
      <title>Re: Hotspot rotation example that rotates horizontally and vertically</title>
      <link>https://community.graphisoft.com/t5/GDL/Hotspot-rotation-example-that-rotates-horizontally-and/m-p/642795#M7243</link>
      <description>&lt;P&gt;The only working (with some drawbacks) solution would be to have movement hotspot (with constraints) and then calculate the angles from vector from say 0,0,0 to the hotspot. (ofc + some overrides/safety catches for trig functions have to be done...depending on the vector)&lt;/P&gt;</description>
      <pubDate>Sat, 07 Dec 2024 17:02:04 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Hotspot-rotation-example-that-rotates-horizontally-and/m-p/642795#M7243</guid>
      <dc:creator>Piotr Dobrowolski</dc:creator>
      <dc:date>2024-12-07T17:02:04Z</dc:date>
    </item>
    <item>
      <title>Re: Hotspot rotation example that rotates horizontally and vertically</title>
      <link>https://community.graphisoft.com/t5/GDL/Hotspot-rotation-example-that-rotates-horizontally-and/m-p/642839#M7244</link>
      <description>&lt;P&gt;The only drawback would be the added complication in the script? It is also by far the most user friendly, as then there is just a single hotspot that they move to point where they want.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2024 01:22:11 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Hotspot-rotation-example-that-rotates-horizontally-and/m-p/642839#M7244</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2024-12-09T01:22:11Z</dc:date>
    </item>
    <item>
      <title>Re: Hotspot rotation example that rotates horizontally and vertically</title>
      <link>https://community.graphisoft.com/t5/GDL/Hotspot-rotation-example-that-rotates-horizontally-and/m-p/642879#M7245</link>
      <description>&lt;P&gt;Basically yes, the angle to coords on glob_modpar_name and vice versa, but also for user point of view it might not look straight.&lt;/P&gt;
&lt;P&gt;make a lin_ and hook it to the movement hotspots and see how it looks first - as from user point of view&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2024 11:05:07 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Hotspot-rotation-example-that-rotates-horizontally-and/m-p/642879#M7245</guid>
      <dc:creator>Piotr Dobrowolski</dc:creator>
      <dc:date>2024-12-09T11:05:07Z</dc:date>
    </item>
  </channel>
</rss>

