tunepunk's Recent Forum Activity

  • Thanks R0j0hound.

    I'm still getting some weird behaviour with this solution. It seems like i get like this (and like the image above) no matter what I do. All the wide angles seem off and I'm not getting an exit angle at the same angle if they are perpendicular to the surface angle.

    Any idea of what i need to adjust? The problem seems to be with the exit angle.

    2*ang_surface-ang_in seems to be the problem. Needs adjusting back to isometric?

  • R0J0hound quick question.

    set ang_surface to angle(0,0,cos(ang_surface), sin(ang_surface)*2)

    if this converts to the non isometric angle. ie 26,5 to 45.

    How do i convert something back, from normal angles, 45 to 26,5? i have to reverse this somehow?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Never mind r0j0 i added you formula directly to the normal instead of the surface angle which messed things up.

  • R0J0hound

    There seem to be something wrong. Any idea what it can be? very wide angles tend to be wrong.

  • R0J0hound

    Everything worked perfectly except a small thing.

    angle(0,0,cos(Trace.NormalAngle), sin(Trace.NormalAngle)*2) was supposed to have /2 instead and all worked like a charm.

    Thanks a bunch!

  • alextro Yeah i got that far, but my main problem was calculating the normal vector between two angles (in and out). It's too bad you can't access the collision box angles, directly with events. That would help a lot.

  • R0J0hound Thanks for the detailed explanation. I will try that out, and see how it works.

    I just tried a different approach where the jcw_trace plugin can give me both the normal angle and reflection angle directly without having to fire a bullet and rely on the angle it bounces off. The only problem with the values i get from this plugin is that they are in normal 2D mode.

    using the atan(tan(oldAngle)/2) formula on the normal vector i get there behaves strange as i have to flip it.

    if the normal angle is between 90 and 270 i have to add +180 at the end of the formula, otherwize that formula behaves strangely.

    So with this raycast plugin giving me both normal and reflection(exit) angle, is there a better formula to derectly adjust the exit angle for isometric based on values i can get from this plugin?

    seems better than using a bullet, in this case. Thanks a lot for your help.

  • I seem to be getting closer but i get some weird results again when i try to get the average angle between two angles... Does anyone know how to properly calculate the average angle between 2 angles that takes on to account wrap around?

    what's the angle between 350 and 20?

    I know it could either be 185 or 5, but i always need the closest one.

    What's the correct formula to use to always get the closest angle between to two?

  • Hmmmm..... Just speculating here........

    the normal vector must be entryAngle+exitAngle/2

    Entry angle (225)+ Exit angle (315) /2 = 270 makes sense. That's the normal vector.

    Exit angle = (NormalVector (270)-Entry angle (225) = 45 + Normal Vector ( 315) ... seems correct.

    Soooo .... i need to adjust that Normal vector to get a correct exit angle? atan(tan(oldAngle)/2)

    hmmmmm so basically i need to adjust any vector angle as if it was not in isometric.

  • TELLES0808 Thanks for the example. Adding the difference makes sense but how do i calculate the difference? My main problem is that my isometric objects can have any shape or angle. Everything is not diamond shaped. The formula i found didn't work at all in my case. I was getting weird angles when hitting any other angle that was not "diamond shaped".

    This is what I'm after.

    I need some kind of formula that adjusts the exit angle for any object shape. or any normal vector angle hit.

    EDIT: I can't apply "atan(tan(oldAngle)/2)" directly to the exit angle. It creates weird results. I suppose that formula should be used to the normal vector hit. But since i can't adjust that, I need to adjust that exit angle AS IF it hit an angle adjusted by that formula i suppose?

    EDIT2: Is there any way i can get the normal vector by using entry angle and exit angle? adjust that normal vector with the formula, then calculate a new exit angle based on ently angle and the new adjusted normal vector?

  • Think I found the answer after a bit of intensive googling.

    isometricAngle = arctan( tan(oldangle) / 2

    Will try it out when I get back home. Replacing the angle of motion after bounce with the result i get after using this formula.

  • It seems that the only way to solve this would be to use the movement angle of the bullet before the bounce, and as soon as the bounce happens (when the bullet has a new angle of motion) adjust that angle the next tick, based on some formula, but how to get there I don't know.

    EDIT: Keep in mind, the bullet can hit from any angle, and the obsatcle can be any angle. I even have some round-ish solids.

tunepunk's avatar

tunepunk

Member since 2 Mar, 2014

None one is following tunepunk yet!

Connect with tunepunk

Trophy Case

  • 10-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Coach One of your tutorials has over 1,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

16/44
How to earn trophies