Hello
Guest
Home
Help
Search
Login
Register
2D Toolkit Forum
»
2D Toolkit
»
Support
»
Set Sprite Normals up?
« previous
next »
Print
Pages: [
1
]
Author
Topic: Set Sprite Normals up? (Read 4453 times)
brownboot
Newbie
Posts: 2
Set Sprite Normals up?
«
on:
June 13, 2014, 01:55:46 pm »
I have tk2dSprites in my 3d environment that I am billboarding. I need to set their normals to Vector3.up (they pop back and forth a lot as the camera rotates around and I'd rather it approximate ambient lighting; ghetto example:
http://tinyurl.com/oojpphc
). I have a script that works for a MeshFilter but from the documentation I couldn't figure out how to do the same thing targeting the tk2dSprite component and need some pointers... thanks!
Logged
unikronsoftware
Administrator
Hero Member
Posts: 9709
Re: Set Sprite Normals up?
«
Reply #1 on:
June 13, 2014, 11:25:31 pm »
You'll need to modify the code.
tk2dBaseSprite.SetPositions sets up the vertex positions and normals. You can hardcode whatever you like there.
Alternatively... you could simply override the shader and hard code it in there.
Logged
brownboot
Newbie
Posts: 2
Re: Set Sprite Normals up?
«
Reply #2 on:
June 21, 2014, 02:35:17 pm »
Thanks for the pointers! Got me where I needed to be:
For newbie-posterity this is what I added at line 423 of the BaseSprite code: normals
= Vector3.up ;
Logged
Print
Pages: [
1
]
« previous
next »
2D Toolkit Forum
»
2D Toolkit
»
Support
»
Set Sprite Normals up?