Comments (11)
i guess you cant use wiki markup in tickets then!
Original comment by [email protected]
on 16 Aug 2011 at 9:01
from libgdx-users.
in theory:
To archieve this, the decal's normal must have the same orientation as the
camera's direction vector.
If there is an issue with frontside/backside and therefore the decal being
culled away the direction of the decal's normal must match the camera's
negative direction, as well.
I don't know if decals have a concept of a normal, but they sure have vertices
(or at least an origin, h and w dimensions, and another 3d attribute) from
which the normals could be calculated?
Original comment by [email protected]
on 16 Aug 2011 at 9:21
from libgdx-users.
"To archieve this, the decal's normal must have the same orientation as the
camera's direction vector."
-> craps...
To archieve this, the decal's normal must have the same orientation as the
vector between the camera's position and the decal's center. This way the
decal's offset from the camera's viewing center is taken into calculation as
well.
Original comment by [email protected]
on 16 Aug 2011 at 9:26
from libgdx-users.
decals seem to be viewable from any angle (no back culling), so dont think the
normals will be a big problem?
Original comment by [email protected]
on 16 Aug 2011 at 9:43
from libgdx-users.
right, forget the note on culling I mentioned.
The decal's normal is just for calculation of the needed rotation angle round
the y-axis.
Original comment by [email protected]
on 16 Aug 2011 at 9:54
from libgdx-users.
Needed: rotation angle alpha around decal's center
In our case we just have to take the x,z plane into concideration.
I have attached a scan so we get the naming convention right to issue the
formulas.
We could get the angle by using trigonometric laws for arbitrary angled
triangles that are made up by the vectors shown in attached scan (decal's
normal, a vector camposition->decalcenter, and the connection vector decal's
normal->cam's position).
For trigonometric calculations only the vector's length are relevant which can
be calculated by libGDX functions.
Original comment by [email protected]
on 16 Aug 2011 at 10:28
Attachments:
from libgdx-users.
[deleted comment]
from libgdx-users.
I mentioned DecalSprite's class having an empty method faceCamera which could
be called in DecalWall demo by
wall.faceCamera(oCam)
once it is filled with the maths above.
Original comment by [email protected]
on 16 Aug 2011 at 10:59
from libgdx-users.
is x/z all we need? potentially if the camera is a bit from above maybe we
need all three axes?
but for 95% of uses just the Y rotate should be fine i think...
Original comment by [email protected]
on 16 Aug 2011 at 11:04
from libgdx-users.
I thought the Decals should stay perpendicular to the floor and just rotate
round y Axis to face the camera.
Calculating everythin in 3d would take care of facing the cam in all 3 axis.
Depends on what you'd like to have...
Original comment by [email protected]
on 16 Aug 2011 at 5:56
from libgdx-users.
In the end it turned out being a lot more down to earth as expected.
It's just 3 lines of code actually *sigh*
documented it here:
http://code.google.com/p/libgdx-users/wiki/decalsLookAt
and opened enhancement request here:
http://code.google.com/p/libgdx/issues/detail?id=393
/closed
Original comment by [email protected]
on 16 Aug 2011 at 7:37
- Changed state: Fixed
from libgdx-users.
Related Issues (20)
- add OOTB working "hello world" package for applet deployment
- ArrayIndexOutOfBoundsException when loading md2 model HOT 2
- Particle editor jar for macosx
- crash in emulator: "Can not use IndexBufferObject with GLES 1.0, need 1.1 or 2.0" HOT 2
- SpriteCache.draw (int cacheID, int offset, int length) can't draw Sprite normally
- Freetype natives problem in applet
- where is the demo code to download? HOT 1
- PatternSyntaxException in AndroidFileHandle.java HOT 1
- Ninepatch scaling problem HOT 6
- Some fonts in 0.96 rendering as solid white blocks HOT 2
- [error] Unable to create directory __libgdx_setup_tmp HOT 13
- setListener (addListener) removed from ButtonGroup
- Soft-keyboard not picking up backspace on Android 4.2 HOT 1
- ArrayIndexOutOfBoundsException with DualShock USB Controller
- HTML5 Build: application doesnt start with empty BitmapFont Constructor
- java.lang.NumberFormatException in class com.badlogic.gdx.graphics.g2d.TextureAtlas
- SpriteBatch needs an interface
- Sound + request for new feature (no hurry)
- [error] Unable to create directory __libgdx_setup_tmp
- The project was not built since its build path is incomplete. Cannot find the class file for org.robovm.cocoatouch.uikit.UIApplicationDelegate$Adapter. HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libgdx-users.