Jump to content

[SOLVED] Setting setProjection and setModelview for ObjectMeshSkinned


photo

Recommended Posts

Hi 

 

If my Player is set to :

 

player = new PlayerSpectator();
player.setPosition(Vec3(0.0f,0.0f,0.0f));
player.setDirection(vec3(-1.0f,0.0f,-0.5f)); 
player.setMinVelocity(20.0f);
player.setMaxVelocity(40.0f);
engine.game.setPlayer(player);
 
 
AND my WidgetSpriteNode & ObjectMeshSkinned is set to:
 
spriteWithAnim = new WidgetSpriteNode(gui, screenSizeW, screenSizeH); //change these back 
spriteWithAnim.setNode(spriteWithAnimNode);
 
ObjectMeshSkinned mesh = add_editor(new ObjectMeshSkinned("data/all_unigine_newgame/meshes/Nut_Mesh_All.smesh"));
 
mesh.setMaterial("hazelnut","*");
mesh.setProperty("surface_base","*");
 
spriteWithAnimNode = mesh;
spriteWithAnim.setNode(spriteWithAnimNode); 
spriteWithAnim.setOrder(4);

gui.addChild(spriteWithAnim,GUI_ALIGN_OVERLAP);

 

What will be the setProjection and setModelview  so the model is facing the player; see image:

 

post-1284-0-04716800-1398340036_thumb.png

 

 

PLUS how to make the spriteWithAnim background transparent? (at moment its black)

 

Thanks

Paul

Link to comment
  • 2 weeks later...
×
×
  • Create New...