<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[GMan's Mods & Stuff — Transform problems]]></title>
	<link rel="self" href="https://gprogs.com/extern.php?action=feed&amp;tid=262&amp;type=atom" />
	<updated>2007-07-31T04:53:17Z</updated>
	<generator>PunBB</generator>
	<id>https://gprogs.com/viewtopic.php?id=262</id>
		<entry>
			<title type="html"><![CDATA[Transform problems]]></title>
			<link rel="alternate" href="https://gprogs.com/viewtopic.php?pid=1069#p1069" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[ninjarat]]></name>
				<uri>https://gprogs.com/profile.php?id=207</uri>
			</author>
			<updated>2007-07-31T04:53:17Z</updated>
			<id>https://gprogs.com/viewtopic.php?pid=1069#p1069</id>
		</entry>
</feed>
