playMaker

Author Topic: [SOLVED] Orienting Plane/Decal  (Read 1681 times)

Thomas Pasieka

  • Playmaker Newbie
  • *
  • Posts: 3
    • http://thomaspasieka.wordpress.com/
[SOLVED] Orienting Plane/Decal
« on: December 08, 2014, 09:09:16 AM »
Hey there guys,

I created a little FSM which uses Raycast to shoot a bullet and create a decal/texture on impact (Left Mouse Button will trigger the shooting). So far so good. Everything works as expected (Thanks Lane).

My current problem is that the Bullet Decal (a texture on a plane mesh) doesn't orient itself properly to the normal direction of the meshes. Currently I stored two variables. hitNormal and hitPoint (Vector3).

I can't figure out what I need to do in order for the plane to orient properly. Any help would be appreciated.

Thomas P.
« Last Edit: December 11, 2014, 09:02:52 AM by Lane »

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Orienting Plane/Decal
« Reply #1 on: December 08, 2014, 10:18:04 AM »
Use Get Quaternion From Rotation.

From would be something like 0,1,0 and the Direction is the hitNormal.

The result is a quaternion you apply using Set Rotation.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

Thomas Pasieka

  • Playmaker Newbie
  • *
  • Posts: 3
    • http://thomaspasieka.wordpress.com/
Re: Orienting Plane/Decal
« Reply #2 on: December 08, 2014, 12:25:42 PM »
Thanks for your help on that matter mate ;)