Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

HLSL translation question


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 ShadowMan777   Members   -  Reputation: 292

Like
0Likes
Like

Posted 19 June 2012 - 05:01 PM

I am new to 3d graphics, so consequently I am bad at matrix math. Here is my question. I have an object that has a world position. I want to translate it to this position. The input world matrix is putting the object at -25, and I want to translate the object to instancetansform. How would I do this? Thank you.


InstancingVSoutput InstancingVS(InstancingVSinput input, float4 instanceTransform : POSITION1)
{
InstancingVSoutput output;

float4 pos = input.Position + instanceTransform;//this is the world position of the object i want to translate to
float4 worldPosition = mul(input.Position, World);
float4 viewPosition = mul(worldPosition, View);
//WHAT DO I DO HERE?

pos = mul(viewPosition, Projection);
output.Position = pos ;


return output;
}

Edited by ShadowMan777, 19 June 2012 - 05:18 PM.


Ad:

#2 ShadowMan777   Members   -  Reputation: 292

Like
0Likes
Like

Posted 20 June 2012 - 12:33 AM

resolved.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS