<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[GMan's Mods & Stuff — Transform problems]]></title>
		<link>https://gprogs.com/viewtopic.php?id=262</link>
		<atom:link href="https://gprogs.com/extern.php?action=feed&amp;tid=262&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Transform problems.]]></description>
		<lastBuildDate>Tue, 31 Jul 2007 04:53:17 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Transform problems]]></title>
			<link>https://gprogs.com/viewtopic.php?pid=1069#p1069</link>
			<description><![CDATA[<p>I have absolutely no idea what&#039;s wrong with these.&nbsp; The turning ones don&#039;t work at all, and the position ones do some bizarre strafing thing around a point a ways in front, but then go in to a parabola type thing, can&#039;t quite tell from just moving the camera.&nbsp; HELP!</p><div class="codebox"><pre><code>Function RotateIrrNode(irrnode:ISceneNode Var,rotation:Vector3df)
    irrnode.setRotation rotation
    &#039;Print &quot;rotating node&quot;
End Function

Function RotateIrrNodeVals(irrnode:ISceneNode Var,pitch#,yaw#,roll#)
    irrnode.setRotation _VECTOR3DF(pitch,yaw,roll)
    &#039;Print &quot;rotating node&quot;
End Function

Function PositionIrrNode(irrnode:ISceneNode Var,position:Vector3df)
    irrnode.setPosition position
    &#039;Print &quot;positioning node&quot;
End Function

Function PositionIrrNodeVals(irrnode:ISceneNode Var,x#,y#,z#)
    irrnode.setPosition _VECTOR3DF(x,y,z)
    &#039;Print &quot;positioning node&quot;
End Function

Function TurnIrrNode(irrnode:ISceneNode Var,turn:Vector3df)
    m:Matrix4=Matrix4.create()
    n:Matrix4=Matrix4.create()
    t:Matrix4=Matrix4.create()
    Local vals#[4]
    turn.getAs4Values vals
    
    m.setRotationDegrees irrnode.getRotation()
    n.setRotationDegrees _VECTOR3DF(0,0,vals[2])
    t.setRotationDegrees _VECTOR3DF(vals[0],0,0)
    n.MultEq t
    t.setRotationDegrees _VECTOR3DF(0,vals[1],0)
    n.MultEq t; m.MultEq n
    irrnode.setRotation m.getRotationDegrees()
    &#039;Print &quot;turning node&quot;
End Function

Function TurnIrrNodeVals(irrnode:ISceneNode Var,pitch#,yaw#,roll#)
    m:Matrix4=Matrix4.create()
    n:Matrix4=Matrix4.create()
    t:Matrix4=Matrix4.create()
    
    m.setRotationDegrees irrnode.getRotation()
    n.setRotationDegrees _VECTOR3DF(0,0,roll)
    t.setRotationDegrees _VECTOR3DF(pitch,0,0)
    n.MultEq t
    t.setRotationDegrees _VECTOR3DF(0,yaw,0)
    n.MultEq t; m.MultEq n
    irrnode.setRotation m.getRotationDegrees()
    &#039;Print &quot;turning node&quot;
End Function

Function MoveIrrNode(irrnode:ISceneNode Var,move:Vector3df)
    irrnode.getRelativeTransformation().transformVect move
    irrnode.setPosition move
    &#039;Print &quot;moving node&quot;
End Function

Function MoveIrrNodeVals(irrnode:ISceneNode Var,x#,y#,z#)
    move:Vector3df=_VECTOR3DF(x,y,z)
    irrnode.getRelativeTransformation().transformVect move
    irrnode.setPosition move
    &#039;Print &quot;moving node&quot;
End Function</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (ninjarat)]]></author>
			<pubDate>Tue, 31 Jul 2007 04:53:17 +0000</pubDate>
			<guid>https://gprogs.com/viewtopic.php?pid=1069#p1069</guid>
		</item>
	</channel>
</rss>
