This shows how to make a quasi 3D figure from 2D textures and have the correct texture from each angle.
It's kind of a hack, and I expect someone more trig comfortable will post an improvement.
3D from 2D
Moderator: Moderators
You've got the concept right*, but it can be done much simpler ( instead of a slew of if-statements ). Attached is a example .. that also includes "no-sorting-required" alpha testing ( without use of shaders ) Control with arrow keys.
And in case you want the frame selection to be rotation based instead of position, change the following line ..
Code: Select all
float A = atan2(CurrentModel.Position.X-App.CameraPosition.X,
CurrentModel.Position.Z-App.CameraPosition.Z)+
CurrentModel.Rotation.Y*PI*2;
Code: Select all
float A = (CurrentModel.Rotation.Y-App.CameraRotation.Y)*PI*2;
*Don't use atan2 to "billboard" a sprite!
- Attachments
-
- Monks.jpg (28.98 KiB) Viewed 17742 times
-
- Monks.zgeproj
- (37.02 KiB) Downloaded 1019 times
- jph_wacheski
- Posts: 1005
- Joined: Sat Feb 16, 2008 8:10 pm
- Location: Canada
- Contact: