<?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 Dynamic hotspots behaving erratically in GDL</title>
    <link>https://community.graphisoft.com/t5/GDL/Dynamic-hotspots-behaving-erratically/m-p/627564#M6949</link>
    <description>&lt;P&gt;Hello everyone!&lt;/P&gt;
&lt;P&gt;I have a quite complex object where I had hotspots controlling height, which behaved weirdly. I tried to make a new, much simpler object, and I still have the same problem, and I can't figure out why.&lt;/P&gt;
&lt;P&gt;My hotspots are supposed to be in the corners of the object och every level, but they keep jumping in the Z direction, and I can't see a pattern of it. Can anyone figure out why? It's really annoying me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;!3D SCRIPT

DIM shape[][]

shape[1][1]=0
shape[2][1]=0
shape[3][1]=15
shape[1][2]=A
shape[2][2]=0
shape[3][2]=15
shape[1][3]=A
shape[2][3]=B
shape[3][3]=15
shape[1][4]=0
shape[2][4]=B
shape[3][4]=15
shape[1][5]=0
shape[2][5]=0
shape[3][5]=-1

FOR i=1 TO 5
	PUT shape[1][i], shape[2][i], shape[3][i]
NEXT i

FOR i=1 TO num_stories
	PRISM_ 5, story_height[i],
		USE(NSP)
	ADDZ story_height[i]
NEXT i
DEL num_stories

unID=0

FOR i=1 TO num_stories
	current_height=0
	FOR j=1 TO i
		current_height=current_height+story_height[i]
	NEXT j
	FOR k=1 TO 4	
		!Story height hotspots
		unID=unID+1 : HOTSPOT shape[1][k], shape[2][k], current_height-story_height[i], unID, story_height[i], 1 + 128
		unID=unID+1 : HOTSPOT shape[1][k], shape[2][k], current_height, unID, story_height[i], 2
		unID=unID+1 : HOTSPOT shape[1][k], shape[2][k], -1, unID, story_height[i], 3			
	NEXT k
NEXT i&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My only parameters are the standard A and B for the size, story_height (an array of lengths) and num_stories (an integer between 1-10)&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Kaj_AL_0-1724422892250.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/74593iBADA0CEB47EC968B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Kaj_AL_0-1724422892250.png" alt="Kaj_AL_0-1724422892250.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;/Kaj&lt;/P&gt;</description>
    <pubDate>Fri, 23 Aug 2024 14:30:32 GMT</pubDate>
    <dc:creator>Kaj_AL</dc:creator>
    <dc:date>2024-08-23T14:30:32Z</dc:date>
    <item>
      <title>Dynamic hotspots behaving erratically</title>
      <link>https://community.graphisoft.com/t5/GDL/Dynamic-hotspots-behaving-erratically/m-p/627564#M6949</link>
      <description>&lt;P&gt;Hello everyone!&lt;/P&gt;
&lt;P&gt;I have a quite complex object where I had hotspots controlling height, which behaved weirdly. I tried to make a new, much simpler object, and I still have the same problem, and I can't figure out why.&lt;/P&gt;
&lt;P&gt;My hotspots are supposed to be in the corners of the object och every level, but they keep jumping in the Z direction, and I can't see a pattern of it. Can anyone figure out why? It's really annoying me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;!3D SCRIPT

DIM shape[][]

shape[1][1]=0
shape[2][1]=0
shape[3][1]=15
shape[1][2]=A
shape[2][2]=0
shape[3][2]=15
shape[1][3]=A
shape[2][3]=B
shape[3][3]=15
shape[1][4]=0
shape[2][4]=B
shape[3][4]=15
shape[1][5]=0
shape[2][5]=0
shape[3][5]=-1

FOR i=1 TO 5
	PUT shape[1][i], shape[2][i], shape[3][i]
NEXT i

FOR i=1 TO num_stories
	PRISM_ 5, story_height[i],
		USE(NSP)
	ADDZ story_height[i]
NEXT i
DEL num_stories

unID=0

FOR i=1 TO num_stories
	current_height=0
	FOR j=1 TO i
		current_height=current_height+story_height[i]
	NEXT j
	FOR k=1 TO 4	
		!Story height hotspots
		unID=unID+1 : HOTSPOT shape[1][k], shape[2][k], current_height-story_height[i], unID, story_height[i], 1 + 128
		unID=unID+1 : HOTSPOT shape[1][k], shape[2][k], current_height, unID, story_height[i], 2
		unID=unID+1 : HOTSPOT shape[1][k], shape[2][k], -1, unID, story_height[i], 3			
	NEXT k
NEXT i&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My only parameters are the standard A and B for the size, story_height (an array of lengths) and num_stories (an integer between 1-10)&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Kaj_AL_0-1724422892250.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/74593iBADA0CEB47EC968B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Kaj_AL_0-1724422892250.png" alt="Kaj_AL_0-1724422892250.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;/Kaj&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2024 14:30:32 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Dynamic-hotspots-behaving-erratically/m-p/627564#M6949</guid>
      <dc:creator>Kaj_AL</dc:creator>
      <dc:date>2024-08-23T14:30:32Z</dc:date>
    </item>
    <item>
      <title>Betreff: Dynamic hotspots behaving erratically</title>
      <link>https://community.graphisoft.com/t5/GDL/Dynamic-hotspots-behaving-erratically/m-p/627566#M6950</link>
      <description>&lt;P&gt;Because in your last for loop you are doing another one, this is unnecessary.&lt;/P&gt;
&lt;P&gt;So the `current_height = current_height+story_height[i]` can run in the main loop (which already runs over all stories...).&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2024 14:32:53 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Dynamic-hotspots-behaving-erratically/m-p/627566#M6950</guid>
      <dc:creator>runxel</dc:creator>
      <dc:date>2024-08-23T14:32:53Z</dc:date>
    </item>
    <item>
      <title>Betreff: Dynamic hotspots behaving erratically</title>
      <link>https://community.graphisoft.com/t5/GDL/Dynamic-hotspots-behaving-erratically/m-p/627567#M6951</link>
      <description>&lt;P&gt;Oh. Bah. That was embarrassingly simple, I don't even know why I though I needed to complicate it like that. Thank you so much!&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2024 14:37:25 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Dynamic-hotspots-behaving-erratically/m-p/627567#M6951</guid>
      <dc:creator>Kaj_AL</dc:creator>
      <dc:date>2024-08-23T14:37:25Z</dc:date>
    </item>
  </channel>
</rss>

