• Create Account

# granberg

Member Since 28 Apr 2011
Offline Last Active Sep 23 2011 10:59 AM

### In Topic: Transform

23 September 2011 - 10:59 AM

Could someone draw a easily understand figures of how to transform the rotor to me,my imagination is not very clear,thanks!

### In Topic: Transform

09 September 2011 - 10:45 AM

positionColorEffectWVP.SetValue(world * cam.viewMatrix
* cam.projectionMatrix);

// 5: draw object - primitive type, vertices, # of primitives
two calls darw the primitive

### In Topic: Transform

09 September 2011 - 09:20 AM

Hi guys,I think you shoud consider the code I was telling you,because the rotor and propeller always sideway control by this section of code.

### In Topic: Transform

09 September 2011 - 08:58 AM

still doesn't make sence,I just think the peoblem is within that function show to you,you should check that code for the result.

### In Topic: Transform

09 September 2011 - 05:36 AM

I can't understand popMatrix and pushMatrix,but now I can show my code,could you check the error for me

private void DrawRotor()
{
Vector3 RotorPosition = new Vector3(airplanePosition.X +0.7f - 0.2f + 0.25f, airplanePosition.Y - 0.3f , airplanePosition.Z + 0.4f); ;
Matrix RotorTranslation, world, scale, rotationZ, OrbitTranslation, OrbitRotateY;
scale = Matrix.CreateScale(0.3f, 0.7f, 0.0f);
OrbitRotateY = Matrix.CreateRotationY(RotationAngle() - 0.04f);
rotationZ = Matrix.CreateRotationZ(propellerSpin);
OrbitTranslation = Matrix.CreateTranslation(1.04f , 0.0f, 0.2f);
RotorTranslation = Matrix.CreateTranslation(RotorPosition);
world = scale * rotationZ * OrbitTranslation * OrbitRotateY * RotorTranslation;
// world = scale * rotationZ * RotorTranslation;
// 4: set shader parameters
positionColorEffectWVP.SetValue(world * cam.viewMatrix
* cam.projectionMatrix);

// 5: draw object - primitive type, vertices, # of primitives

RotorPosition = new Vector3(airplanePosition.X + 0.7f - 0.2f + 0.22f, airplanePosition.Y + 0.3f, airplanePosition.Z);
RotorTranslation = Matrix.CreateTranslation(RotorPosition);
OrbitTranslation = Matrix.CreateTranslation(1.17f, 0.0f, 0.0f);
OrbitRotateY = Matrix.CreateRotationY(RotationAngle() + 0.04f);
world = scale * rotationZ * OrbitTranslation * OrbitRotateY * RotorTranslation;
// world = scale * rotationZ * OrbitRotateY * RotorTranslation;
// 4: set shader parameters
positionColorEffectWVP.SetValue(world * cam.viewMatrix
* cam.projectionMatrix);

// 5: draw object - primitive type, vertices, # of primitives