Rotating

0 views
Skip to first unread message

Alex

unread,
Nov 8, 2011, 11:34:08 PM11/8/11
to benv2423-2011
Hi guys,
For my assignment, I am trying to make a roof with solar panels that
rotates according to certain levels of the light intensity from the
sun. I have the values recorded into my XML but whenever I run the
flowgraph it automatically goes to 180 degrees, does anyone know whats
wrong with this flowgraph?

Link: http://www.flickr.com/photos/69585146@N03/6327378759/in/photostream

Rui Wang

unread,
Nov 8, 2011, 11:54:05 PM11/8/11
to benv2423-2011
Hi Alex,

Would you please show me your xml file as well? Then I can check what
is going wrong.

Cheers,
Rui

Rui Wang

unread,
Nov 9, 2011, 12:09:11 AM11/9/11
to benv2423-2011
If you mean every time you run the FGs (in your case when you hit the
"o" key), it starts from the (0,-180,0) direction, it is because
you've set up the start value in your Interpol:Vec3 node to
(0,-180,0).

If you want to make it work in a way of starting from where it was
last time, you need to find a way setting the start value to its
previous end value.

Hope it makes sense.

Cheers,
Rui

Alex

unread,
Nov 9, 2011, 12:17:32 AM11/9/11
to benv2423-2011
Its not that it starts there, it always rotates 180 degress. Below is
what is in my xml file;

<Root data="lighting">
<lights>
<l number="1" value="0"/>
<l number="2" value="0"/>
<l number="3" value="0"/>
<l number="4" value="0"/>
<l number="5" value="0"/>
<l number="6" value="140"/>
<l number="7" value="150"/>
<l number="8" value="270"/>
<l number="9" value="330"/>
<l number="10" value="400"/>
<l number="11" value="480"/>
<l number="12" value="630"/>
<l number="13" value="720"/>
<l number="14" value="850"/>
<l number="15" value="700"/>
<l number="16" value="530"/>
<l number="17" value="340"/>
<l number="18" value="170"/>
<l number="19" value="150"/>
<l number="20" value="140"/>
<l number="21" value="0"/>
<l number="22" value="0"/>
<l number="23" value="0"/>
<l number="24" value="0"/>
</lights>
</Root>

Rui Wang

unread,
Nov 9, 2011, 1:29:35 AM11/9/11
to benv2423-2011
Hi Alex,

I have tried your FGs. What it does now is, every time you enter the
game and hit "o", it starts reading the first line of your xml file,
which is 0, as a result of which it rotates 180 degrees. Since the
next four lines all carry a value of 0, it won't change until you hit
"o" for the 6th time (it turns 320 degrees when it reads the 6th
line).

If you want your FGs read your xml file line by line automatically,
you need to set up a loop. Check out the example I've made here:
http://benv2423rui.blogspot.com/2011/11/rotate-according-to-xml-data.html

Hope it helps.

Cheers,
Rui
Reply all
Reply to author
Forward
0 new messages