Sir LoLz's Recent Forum Activity

  • I am not sure if I need it but it seems to be working without.

    no doubt there is a cleaner way of doing this but my solution is to get the dot product for both the front and side. this way I can see how forward and how sideways facing the entity is. I then compare the front dot value to see if it is front or rear facing and then compare the side dot to see what side is facing.

    Video of the effect in action. I am not sure if it's perfect but it seems ok to me.

    Subscribe to Construct videos now
  • oh ok that makes sense. and yes after some more test you are right it does return a positive number or negative number even if it's high.

    I might normalize later but I seem to have found another way? I either am normalizing the vector unintentionally or my math is only working in this isolated case. But either way it's working in the range of -1,1

    by multiplying the distance between the enemy and player by 3 and then dividing the dot product by that it seems to be returning a value between the range 1,-1

    as you can see in the photo when the only thing that has changed between the two snapshots is the distance the manipulated dot product has not changed (roughly as I manually placed the instances so it was not moved on a straight line)

  • mmm I am trying my hardest but I must be overlooking something.

    after digging this was the simplest understanding of dot product I could find. ( (a1,a2)•(b1,b2) = a1b1 + a2b2 )

    but the code is not working as implemented (is not returning a number between 1 or -1)

    It might be looking me right in the face but I am stuck right now. any input?

  • Hello.

    I am working with a 3d plugin and want to do doom style graphics were enemies are sprites. I am stuck trying to figure out how to make the correct animation play depending on what direction an enemy is facing relative to the player though.

    I have 8 animations named something like "action0) were "action" is what the animation is of the character doing (idle,walking, ect) and the number at the end is the direction.

    I first looked at finding the difference of angles between the camera and enemy but quickly found out that would not return the correct angle of facing.

    any help would be appreciated

    Thanks

    UPDATE: So after some extra digging I know I need a dot product. This is the equation as I understand it ( (a1,a2)•(b1,b2) = a1b1 + a2b2 )

    but the test I set up does not seem to be working (is not returning a number between 1 and -1 ). no doubt its staring me in the face but I have brick walled. any input?

    UPDATE 2: so I think I solved it

    the above math was correct in that it was indeed giving a positive or negative value related to the facing of the enemy relative to the player. it just was not in the range of 1,-1

    I seem to have gotten it inside that range though regardless of the distance by taking the distance of the player and enemy and multiplying it by 3. and then dividing the dot product by this number. it seems to be working so I will stop with this result.

    as you can see in the two screenshots in the image the dot product is now inside the 1,-1 range regardless of the distance.

    UPDATE 3: seem to have the solution implemented.

    no doubt there is a cleaner way of doing this but my solution is to get the dot product for both the front and side. this way I can see how forward and how sideways facing the entity is. I then compare the front dot value to see if it is front or rear facing and then compare the side dot to see what side is facing.

    Video of the effect in action. I am not sure if it's perfect but it seems ok to me.

    Subscribe to Construct videos now
  • Has anyone figured out how to do sprite billboarding in with Q3D in C2? I would like to do doom style rendering with sprites that will change the animation based on what direction the other sprite is facing. But I can't figure out how to determine what sprite to display based on the direction of the entity relative to the player.

  • problem is that is a big hurdle. most of the short comings can be worked around. but not being able to play 3d animations well is a major hurdle.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • coming to this late. but what is the advantage of this plug in over the normal multiplayer plugin?

  • This is an awesome plug in. Thanks.

  • oh I figured it out and as I suspected it was something simple I was overlooking. the camera option in the Q3d master was set to Orthogonal. not Perspective.

    Thanks

  • I have attached a copy of the capex to this post. There should not be that much going on.

    https://www.dropbox.com/s/x8xntm7tp8239fr/mode%207%20game.capx?dl=0

  • I must be missing something trivial because it's still not working.

    I added a new variable called "scale" that takes the pre existing size of objects and multiplies to that scale. It will also multiply the cameras distance by said scale.

    However the culling still happens. if I move the camera high enough yes it stops. but at that height it stops being behind the player.

    Also there is an odd distortion going on. I must be overlooking something.

  • I seem to be having issues with culling.

    I am working on a mode 7 style project. I have a plane with a texture and a box that would represent the player. however the plane is getting culled before it reaches the bottom of the screen.

    I tried fixing it with the "near plane" in frustum setting. but this does not seem to do anything.

    ideas?

Sir LoLz's avatar

Sir LoLz

Member since 1 Oct, 2014

Twitter
Sir LoLz has 58 followers

Trophy Case

  • 10-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Popular Game One of your games has over 1,000 players
  • Famous Game One of your games has over 10,000 players
  • Viral Game One of your games has over 100,000 players
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

17/44
How to earn trophies