This site requires JavaScript, please enable it in your browser!
Greenfoot back
GreenHouse
GreenHouse wrote ...

2013/10/2

Greenfoot 3D

1
2
3
4
5
GreenHouse GreenHouse

2013/10/21

#
@davmac & danpost: sorry, i didn't see that :/ :) @erdelf: the latest greenfoot 3d .jar uses
public Actor3D rotateX(float x) {
   this.object.rotateX(x);
   return this;
}
(I downloaded the jar, and looked up the code..) Like you see, you can pass a float in here :/ Furthermore, the incompatible types java exception always shows the types that caused this exception, so i'm not sure what you mean. Can you mail me the console/error log pls?
erdelf erdelf

2013/10/21

#
I looked in this source aswell, but ok, if u dont believe me
GreenHouse GreenHouse

2013/10/21

#
Try something rotateX(1.2f) - this will surely work. The incompatible types isn't the 'wrong parameter' error i suggested - your error happens because earth.getRotation() can't be cast to float (or?).
danpost danpost

2013/10/21

#
NVM
danpost danpost

2013/10/21

#
Sorry, again. It appears that I do not know what I am saying, because I am not familiar with the method you are using and exactly what it does. But I think it should work if you drop the 'earth =' part. However, you may have to put parenthesis around '(Actor3D)earth'
GreenHouse GreenHouse

2013/10/21

#
Ah, i see :D you cannot cast to Actor3D. Just remove the (Actor3D) and it will work, because earth.rotateX() returns the object (the Earth) again.
erdelf erdelf

2013/10/21

#
@GreenHouse, the cast doesnt matter, if i dont cast it, i get the same error. and why should the cast of a float to a float doesnt work`? Edit: still doesnt work @danpost, the paranthesis u suggested would destroy the reason i used the cast Actor3d here
GreenHouse GreenHouse

2013/10/21

#
earth = earth.rotateX(0.2f); tell me if this line works for you; if yes then earth = earth.rotateX(earth.getRotation()); will also work
danpost danpost

2013/10/21

#
Why does the 'rotateX' method return 'this' back to the calling method? The calling method must already have a reference to 'this' object just to call the method.
GreenHouse GreenHouse

2013/10/21

#
Yeah :D good question ;) the return is for something like this: earth.rotateX(0.2f).rotateY(0.1f).rotateZ(0.3f); Otherwise, you need to write earth.rotateX(0.2f); earth.rotateY(0.1f); earth.rotateZ(0.3f); which is the same, but a bit longer and not so cool to read :)
erdelf erdelf

2013/10/21

#
ur line earth = earth.rotateX(0.2f); doesnt work. idk why same error
GreenHouse GreenHouse

2013/10/21

#
Yeah, earth.rotateX() returns an Actor3D, which cannot be cast to Earth. Remove the earth = .
danpost danpost

2013/10/21

#
Or put the whole expression in parenthesis with '(Earth)' in front. But, since you are only using one method (not stringing them), removing 'earth =' would be the way to go. Actually, you should never need 'earth ='; no matter what.
erdelf erdelf

2013/10/21

#
oh ok, thx that works
GreenHouse GreenHouse

2013/10/29

#
Does someone suspect what this is going to be?
There are more replies on the next page.
1
2
3
4
5