<?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 3D Rotating Hotspot in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/3D-Rotating-Hotspot/m-p/256654#M4757</link>
    <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;R&gt;Hi, &lt;BR /&gt;
I am playing with the 3D Rotating hotspots. Is there any way to change the plane which the hotspot rotates around? It is currently horizontal/flat but I want it vertical instead. I have used the example given by graphisoft and used the parameters in the code but I don't know how to manipulate it to do what I'd like it to.&lt;BR /&gt;
&lt;BR /&gt;
Any help would be much appreciated.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Here is the Graphisoft example code for it.
&lt;PRE&gt; unID = 1
! --------------------------------------------------------------------------------
! Center
! --------------------------------------------------------------------------------
hotspot 0, 0, 0, unID, ang, 6     : unID = unID + 1

! --------------------------------------------------------------------------------
! Base
! --------------------------------------------------------------------------------
hotspot 0.2, 0, 0, unID, ang, 4     : unID = unID + 1

! --------------------------------------------------------------------------------
! Moving
! --------------------------------------------------------------------------------
hotspot 0.2 * COS(ang), r * SIN(ang), 0, unID, ang, 5     : unID = unID + 1

! --------------------------------------------------------------------------------
! Reference
! --------------------------------------------------------------------------------
hotspot 0, 0, 0, unID, ang, 7     : unID = unID + 1&lt;/PRE&gt;&lt;/R&gt;&lt;/DIV&gt;</description>
    <pubDate>Thu, 04 Jan 2018 11:47:56 GMT</pubDate>
    <dc:creator>JGoode</dc:creator>
    <dc:date>2018-01-04T11:47:56Z</dc:date>
    <item>
      <title>3D Rotating Hotspot</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/3D-Rotating-Hotspot/m-p/256654#M4757</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;R&gt;Hi, &lt;BR /&gt;
I am playing with the 3D Rotating hotspots. Is there any way to change the plane which the hotspot rotates around? It is currently horizontal/flat but I want it vertical instead. I have used the example given by graphisoft and used the parameters in the code but I don't know how to manipulate it to do what I'd like it to.&lt;BR /&gt;
&lt;BR /&gt;
Any help would be much appreciated.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Here is the Graphisoft example code for it.
&lt;PRE&gt; unID = 1
! --------------------------------------------------------------------------------
! Center
! --------------------------------------------------------------------------------
hotspot 0, 0, 0, unID, ang, 6     : unID = unID + 1

! --------------------------------------------------------------------------------
! Base
! --------------------------------------------------------------------------------
hotspot 0.2, 0, 0, unID, ang, 4     : unID = unID + 1

! --------------------------------------------------------------------------------
! Moving
! --------------------------------------------------------------------------------
hotspot 0.2 * COS(ang), r * SIN(ang), 0, unID, ang, 5     : unID = unID + 1

! --------------------------------------------------------------------------------
! Reference
! --------------------------------------------------------------------------------
hotspot 0, 0, 0, unID, ang, 7     : unID = unID + 1&lt;/PRE&gt;&lt;/R&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 04 Jan 2018 11:47:56 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/3D-Rotating-Hotspot/m-p/256654#M4757</guid>
      <dc:creator>JGoode</dc:creator>
      <dc:date>2018-01-04T11:47:56Z</dc:date>
    </item>
    <item>
      <title>Re: 3D Rotating Hotspot</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/3D-Rotating-Hotspot/m-p/256655#M4758</link>
      <description>First thing: The reference hotspot cannot be the same as the centre hotspot. An imaginary vector drawn from the centre hotspot to the reference hotspot forms your rotation axis...like the axel/hub of a wheel.&lt;BR /&gt;
&lt;BR /&gt;
To rotate in the vertical plane, the z-axis coord of the moving hotspot needs to be used, and either the x or y coord left at 0.&lt;BR /&gt;
&lt;BR /&gt;
E.g. to rotate around the x axis, using your parameters, would be:&lt;BR /&gt;
&lt;BR /&gt;
ROTX ang&lt;BR /&gt;
HOTSPOT 0, r, 0, unID, ang, 4 : unID=unID+1  ! Base&lt;BR /&gt;
HOTSPOT 0, r*COS(ang), r*SIN(ang), unID, ang, 5 : unID=unID+1  ! Moving&lt;BR /&gt;
HOTSPOT 0, 0, 0, unID, ang, 6 : unID=unID+1  ! Centre&lt;BR /&gt;
HOTSPOT 1, 0, 0, unID, ang, 7 : unID=unID+1  ! Reference&lt;BR /&gt;
DEL 1&lt;BR /&gt;
&lt;BR /&gt;
I can’t test this right now, but it should be something like this.</description>
      <pubDate>Thu, 04 Jan 2018 15:16:13 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/3D-Rotating-Hotspot/m-p/256655#M4758</guid>
      <dc:creator>Bruce</dc:creator>
      <dc:date>2018-01-04T15:16:13Z</dc:date>
    </item>
    <item>
      <title>Re: 3D Rotating Hotspot</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/3D-Rotating-Hotspot/m-p/256656#M4759</link>
      <description>&lt;BLOCKQUOTE&gt;Bruce wrote:&lt;BR /&gt;First thing: The reference hotspot cannot be the same as the centre hotspot. An imaginary vector drawn from the centre hotspot to the reference hotspot forms your rotation axis...like the axel/hub of a wheel.&lt;BR /&gt;
&lt;BR /&gt;
To rotate in the vertical plane, the z-axis coord of the moving hotspot needs to be used, and either the x or y coord left at 0.&lt;BR /&gt;
&lt;BR /&gt;
E.g. to rotate around the x axis, using your parameters, would be:&lt;BR /&gt;
&lt;BR /&gt;
ROTX ang&lt;BR /&gt;
HOTSPOT 0, r, 0, unID, ang, 4 : unID=unID+1  ! Base&lt;BR /&gt;
HOTSPOT 0, r*COS(ang), r*SIN(ang), unID, ang, 5 : unID=unID+1  ! Moving&lt;BR /&gt;
HOTSPOT 0, 0, 0, unID, ang, 6 : unID=unID+1  ! Centre&lt;BR /&gt;
HOTSPOT 1, 0, 0, unID, ang, 7 : unID=unID+1  ! Reference&lt;BR /&gt;
DEL 1&lt;BR /&gt;
&lt;BR /&gt;
I can’t test this right now, but it should be something like this.&lt;/BLOCKQUOTE&gt; Ahh, it works but not how I want it. I want it to rotate around the Y axis. I've managed to get it to rotate that way, however the hotspot doesn't stay in the correct place. Here is my code now &lt;PRE&gt;unID = 1
 HOTSPOT 0.2, 0, 0, unID, ang, 4 : unID=unID+1 ! Base 
 HOTSPOT 0.2*COS(ang), 0, 0.2*SIN(ang), unID, ang, 5 : unID=unID+1 ! Moving 
 HOTSPOT 0, 0, 0, unID, ang, 6 : unID=unID+1 ! Centre 
 HOTSPOT 0, 2, 0, unID, ang, 7 : unID=unID+1 ! Reference &lt;/PRE&gt;

It rotates around the Y axis but the hotspot doesn't stay in the correct place :S &lt;BR /&gt;
&lt;BR /&gt;
Thanks very much for your help!</description>
      <pubDate>Thu, 04 Jan 2018 15:47:56 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/3D-Rotating-Hotspot/m-p/256656#M4759</guid>
      <dc:creator>JGoode</dc:creator>
      <dc:date>2018-01-04T15:47:56Z</dc:date>
    </item>
    <item>
      <title>Re: 3D Rotating Hotspot</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/3D-Rotating-Hotspot/m-p/256657#M4760</link>
      <description>1. Shift the unID = 1 declaration into the Master script.&lt;BR /&gt;
2. In longer scripts, you will need the ROTY -ang command (in my first example) prior to the hotspots to reset the Base hotspot properly - otherwise your hotspot will just follow your geometry, and reset every time&lt;BR /&gt;
3. It's also handy to limit your ang in the Parameter script so it behaves logically, i.e. VALUES "ang" RANGE [0, 360)&lt;BR /&gt;
4. The Z coord for the hotspot needs to be negative in this case.&lt;BR /&gt;
&lt;BR /&gt;
The below script works for me (it's just my quirk to put the unID=unID+1 statement before the HOTSPOT command):&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;

&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;unID=unID+1 : HOTSPOT 0.2, 0, 0, unID, ang, 4 + 128					!Base
unID=unID+1 : HOTSPOT 0.2*COS(ang), 0, -0.2*SIN(ang), unID, ang, 5	!Moving
unID=unID+1 : HOTSPOT 0, 0, 0, unID, ang, 6							!Centre
unID=unID+1 : HOTSPOT 0, 1, 0, unID, ang, 7							!Reference

ROTY ang

BLOCK 1, 1, 1

DEL 1
&lt;/PRE&gt;</description>
      <pubDate>Fri, 05 Jan 2018 00:59:58 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/3D-Rotating-Hotspot/m-p/256657#M4760</guid>
      <dc:creator>Bruce</dc:creator>
      <dc:date>2018-01-05T00:59:58Z</dc:date>
    </item>
    <item>
      <title>Re: 3D Rotating Hotspot</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/3D-Rotating-Hotspot/m-p/256658#M4761</link>
      <description>&lt;BLOCKQUOTE&gt;Bruce wrote:&lt;BR /&gt;
4. The Z coord for the hotspot needs to be negative in this case.
&lt;/BLOCKQUOTE&gt;

Thanks very much! Out of curiosity, why does the Z coord for the hotspot need to be negative? Very much appreciated!</description>
      <pubDate>Fri, 05 Jan 2018 09:58:27 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/3D-Rotating-Hotspot/m-p/256658#M4761</guid>
      <dc:creator>JGoode</dc:creator>
      <dc:date>2018-01-05T09:58:27Z</dc:date>
    </item>
    <item>
      <title>Re: 3D Rotating Hotspot</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/3D-Rotating-Hotspot/m-p/256659#M4762</link>
      <description>It has to do with the direction of rotation in GDL, combined with the ROTY to rotate the geometry.  I still get confused over it, but that's the reason.</description>
      <pubDate>Fri, 05 Jan 2018 10:06:05 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/3D-Rotating-Hotspot/m-p/256659#M4762</guid>
      <dc:creator>Bruce</dc:creator>
      <dc:date>2018-01-05T10:06:05Z</dc:date>
    </item>
  </channel>
</rss>

