#the default method:
1 messages · Page 1 of 1 (latest)
yeah
yeah!
and I assume the one behind is "inside out" ?
this is from the other side, none are visible
well they are all facing positive Z
while they should all be facing pretty much outwards
ok so all these bedrock, redstone and blue text display are essentially like a group (a single thing), right?
they are indicative blocks of whether everything is correctly rendered
the text displays are what actually renders
yeah
(not always)
I assume fillUp is called six times, once for each face?
yeah
show the entire fillUp method and also where you calll it
you can send screenshots, nobody will copy paste it anyway
private void fillUp(Vector3f overallCenter, ItemDisplay owner, Vector3f ownerPos, Color color, Vector3f p1, Vector3f p2, Vector3f p3, Face face, World world, float pitch, Transformation transformation) {
int blockCount = 8;
Vector3f v1 = new Vector3f(p2).sub(p1).div(blockCount);
Vector3f v2 = new Vector3f(p3).sub(p1).div(blockCount);
for (int i = 0; i < blockCount; i++) {
for (int j = 0; j < blockCount; j++) {
Vector3f pos = new Vector3f(p1)
.add(new Vector3f(v1).mul(i))
.add(new Vector3f(v2).mul(j));
//owner.addPassenger(spawnInwardFacingPassengerDisplay(world, color, ownerPos, pos, pitch, transformation, face.getFaceCenter(), overallCenter));
owner.addPassenger(this.spawnPassengerDisplay(face, world, color, ownerPos, pos, pitch, transformation));
}
}
}
@SneakyThrows
private TextDisplay spawnPassengerDisplay(Face face, World world, Color color, Vector3f carrierPos, Vector3f selfPos, float pitch, Transformation transformation) {
TextDisplay e = world.spawn(new Location(world, selfPos.x, selfPos.y, selfPos.z, 0, pitch), TextDisplay.class);
Vector3f translationCopy = (Vector3f) transformation.getTranslation().clone();
translationCopy.add(selfPos).sub(carrierPos);
Vector3f scale = new Vector3f(2.5f);
Transformation transformationCopy = new Transformation(translationCopy, transformation.getLeftRotation(), scale, transformation.getRightRotation());
e.setBackgroundColor(color);
e.setTransformation(transformationCopy);
e.setAlignment(TextDisplay.TextAlignment.CENTER);
return e;
}
Vector3f translationCopy = (Vector3f) transformation.getTranslation().clone();
translationCopy.add(selfPos).sub(carrierPos);
is due to there being a single carrier where each text display rides it and has its transformation adjusted
wait so you attached all these text displays for each side on some entity? so 6 entities each has 64 text display passengers?
show the method where you call fillUp pls
gosh that's so much code
what's the Face ?
is it an enum?
isn'tttt itttt?
it's okay dw
aand what is Direction?
(it's probably incorrect, but we can differentiate between the faces this way)
so only 'down' is correct
but not entirely
since it's in the correct position, but doesn't render from the other side
omg 😠figure out how FRONT, BACK, LEFT, RIGHT correlate to positive/negative x/z
then when you have the Transformation of each individual text display, for these four faces set it to one of this: java Quaternionf rot = new Quaternionf(); new Matrix3f().rotateY((float) Math.PI).get(rot); transformation.setLeftRotation(rot);
what about this?
yes because it has to face against where you look it from
press f3+b to see where it's facing
I think any yaw changes to it would rotate it around the passenger's loc
ah alright
I'll confirm whether that's the case
my bad you need to use rightRotation instead of left
what if I already have a right rotation assigned?
note that where the entity faces is not the same as where the text is facing
give me a sec
I'm having trouble understanding how to convert angle axis form into quaternion because Transformation.setLeftRotationexpects a quaternion
wrap with new Quaternionf()
alright here are the quaternions for leftRotation ```java
// facing positive X
[0f,0.7071067811865476f,0f,0.7071067811865476f]
// facing negative Z
[0f,1f,0f,0f]
// facing positive Z (default)
[0f,0f,0f,1f]
// facing negative X
[0f,-0.7071067811865476f,0f,0.7071067811865476f]
facing positive Z means you should look towards negative Z to be able to see the text
I'll have to look at how to get them nicely by pi, 2pi, 3pi rotations around Y axis
where do you expect me to apply them?
here ?
wherever you have face
there's so many arguments I cannot keep track of which is which
but here in fillUp you pass a Transformation as the last argument
this will look ugly but you could make a switch (face) inside the for loop then call setLeftRotation(new Quaternionf(...)) based on the face
yeah my methods are not working
I believe that is rightRotation
this stuff
pops u[
it rotates the entity around the carrier's location
I mean if you're not scaling any of these, you should only touch left or right rotation, and leave the other one as default (identity matrix)
uh
do not change yaw and pitch of textDisplays
Understood.
i mean you could but then do not use transformations (except for up/down facing ones)
now I may be wrong here but in most cases left rotation is only what you want, right rotation is just going to skew (e.g. turn a cuboid into paralelepiped)
just realised that changing yaw and pitch works for text displays too lol
sorry @clear wigeon in this case you can just change yaw to -180f, -90f, 0f, 90f
I just told you
I'm not sure why didn't it work for you earlier then
combining entity rotation & text display rotation is just terrible
it just rotates them around that
set their yaw and pitch to 0, 0 then and apply rotation within the Transformation ?
that should work
how exactly?
rotate leftRotation?
I just tested in singleplayer using commands: when text display A is riding on a test display B,
(A is passenger, B is carrier),
changing B's yaw and pitch does not affect A's yaw and pitch
seems like they all have fixed location and yaw&pitch, but different translations, which is okay, you just need to change leftRotation in here based on the Face
so like this?
when the text displays are translated through a Transformation, text's actual position in the world is offset from the entity's position
so if you go and change entity's yaw and pitch, the text would move around too
what is Direction.leftRot?
for UP and DOWN you will need two more quaternions, I'd leave that up to you
but yeah that looks good
yeah
remove that line and
okay nevermind
let me analyse this code a bit
are you sure face.direction is correct and not the same for all faces?
uncomment this e.setText then send a screenshot ingame
it will be all white
huh?
oh
this is the indicator
I ensured that these are indeed opposites
it kind of works if there is no initial right or left rot
otherwise breaks
where would initial left or right rotation come from if not this?
that may be what confused me the entire time
wdym by 'this'?
I simulate generating a block display
this = setting a quaternion
it sounds like you got a rightRotation from somewhere else too and those two combined
btw if you'd like to debug each one separately, you can:
instead of java owner.addPassenger(this.spawnPassengerDisplay(face, world, color, ownerPos, pos, pitch, transformation));do this:java TextDisplay ent = this.spawnPassengerDisplay(face, world, color, ownerPos, pos, pitch, transformation); ent.addScoreboardTag("_" + face.name() + "_" + i + "_" + j); owner.addPassenger(ent); then in game /data get entity @e[tag=_UP_0_0]
and wish to, in its place, render text displays as to show a custom texture
I give it initial parameters in chat
do you really need a rightRotation though?
yes
what for?
not sure
it's a bit too long to explain that now xd
same with why they need to be a passenger
if you want to rotate everything at once, like this #help-development message
you probably should not use rightRotation, but instead combine the global rotation (for the entire thing) with each textDisplay's local rotation (which is different for each side)
(I think multiplying the Direction.leftRot(...) on the left and the global rotation on the right will result in a correct quaternion, but not sure)
also I'm going to sleep now, hope you will manage to figure it out
cheers o/
gn
sorry to hear that 😦
what was the closest you got though?