I always get distracted when I get some new code to play with, lol, but I am making a centipede/snake demo game using the code (not finished yet). I also wrote a blog post describing how I use the function for simple AABB collision detection. I will upload the centipede demo and source to wiibrew as soon as I finish it.by owen - Coding
When talking about Java hard versus C hard we are talking about 2 different kinds of hard. Java hard is slugging through tons of API's, documentation and a IDE which is HUGE! C hard is in turns of learning error messages, for-loops and variables - general learning to program stuff. Being that he mentioned Unity I guessed that he really wants to keep using the Unity IDE and tools - so goiby owen - Coding
I love the animations when you run out of money, lol. Nice job guys! :) Do one where your great uncle leaves you money in his will.by owen - Homebrew Applications
With the final touch by Titmouse. I think that after 2 months it is finally working! with z roll and everything! I am going to have to create a neat little demo and put it on wiibrew. Just a little more bug testing to do! here are the raw functions; guVector rotate_vector_to_angle( guVector player_target, guVector player_position, float angx, float angy, float angz ){ static guVby owen - Coding
Took me forever to hack together the demo showing the problem but I am pleased to say I have it for download here; Its a devkitpro grrlib project with 700 lines of C code. When you run it you will see a white box and a red box. The red box is the target which you can move. The white box is always facing the red box. I draw a green box at each end of the cube by using the function rotate_vby owen - Coding
well then you will have to learn how to program in C or C++ without the fancy tools that you get from Unity. Nothing but text files. But you get accustomed to it if you stick it out. If not you will be better off sticking to with unity on computers.by owen - Coding
whats the difference between guMtxRotAxisDeg(); and guMtxRotDeg(); ? they seem like the same thing with different parameters.by owen - Coding
You could probably get by on using a lua interface but on the wii its either go hard or go home. I suggest you maximise your skills programming on the computer before you try jumping on the wii. Unless you want to do a very simple game which you are willing to struggle through. What kind of game are you planning to build?by owen - Coding
@titmouse I see your rotation code but its not encapsulated, its doing too many things at the same time. I am currently coding up a small demo so you can see how I am using the code. The function is ONLY doing barrel rolls on the -Z access (http://youtu.be/L5uTi3xs9EY). I need barrel rolls on the axis that the model is facing. I think I need to do the barrel roll after I calculate the new posby owen - Coding
Email the people behind Unity Support but my guess is no.by owen - Coding
@Titmouse you the function works, it solves a different problem. This function is moving points - not calculating angles. Here is a video of the problem; in the video; The cyan boxes are the things that I am rotating (for collision detection). In order for the my simple collision detection to work properly I have to be able to follow the roll animation of the plane as close as possible. Ifby owen - Coding
Hooo! Great job. The bank was kinda confusing at first - I kept trying to put in my pin number but it would not go anywhere!by owen - Homebrew Applications
Hey guys, how you all are well. I came across another problem while I was doing collision detection. The function (shown below) works well when rotating around X and Y. It works by moving the position_vec z around the center point by rot_deg_x and rot_deg_y. However if I try to rotate around the Z it fails. What happens is that the Z rotation is ALWAYS around the same direction axis. I wby owen - Coding
QuoteTitmouseOwen, have a think about using C++ & STL containers - lends itself well to things like that. I am still hacking away at c. Not ready to make the C++ jump yet. I'm trying to keep everything nice and tight so I'm going to put the flight paths/patterns in an array of structs.by owen - Coding
I plan to do enemy patterns similar to these;by owen - Coding
QuoteTitmousetueidj - I see, thanks for the info. Sorry Owen, hitting your thread a bit hard now wth off subject matters ;) No problem I got the answers that I were looking for, my enemy ships are flying along a nice flight path now. All I have left to do now is draw the paths.by owen - Coding
QuoteTitmousewilco2009 – do you have any open projects (i.e. shared Google code) with these techniques. (your wii brew link is blocked) Things like guVecScale(&player_front, &player_front, -1); // to flip, is something I would not thought of doing, obvious now I've seen it! Infact I've never though about changing things like the up,left vectors, to alow for 360 rotation without issuesby owen - Coding
there are tons of them around the place. I will see if I can find the english version.by owen - Ideas, requests
@titmouse yeah I know about gimbal lock but its a matrix operation shouldn't it work fine? I am just going to be spinning asteroids so it may not be much of a problem for me if it gimbal locks. (collision detection will be the next problem, probably should start another thread)by owen - Coding
@wilco2009 That is advanced stuff! I hope you are still working on that example program. @titmouse here is the current vector point rotation function based on wilco's code. try this function to see if it works for you; guVector rotate_vec_to_angle( guVector position_vec, guVector center_vec, float rot_deg_x, float rot_deg_y, float rot_deg_z ) { guVector orig_direction = positionby owen - Coding
FINALLY GOT IT TO WORK! guVector get_rotation_degrees_to_face_target(guVector current, guVector target ) { float dx=target.x-current.x; float dy=target.y-current.y; float dz=target.z-current.z; float hyp = sqrt(dx*dx + dz*dz); float rx= atan2(dy, hyp); float ry= atan2(dx, dz); rx= rx * 57.2957795; ry= ry * 57.2957795; return (guVector){rx, ry, 0}; } usageby owen - Coding
Have you seen any of these projects on the wii?by owen - Ideas, requests
It will never happen because nearly all video games interact with the internet in a different way. It would take too much work to hack features into old games. Sorry, it will never happen.by owen - Ideas, requests
@titmouse I don't know my build doesn't seem to like the values I pass to sqrt(). I get no results. I think I know why none of these methods are working for me. It may not be a problem that can be solved with pure math. I think the model is always facing -z. It does not matter where player_position and player_direction is located, the GRRLIB model is always facing the same directby owen - Coding
Tried it but the wii doesn't seem to like this line of code at all theta_y=acos( dot / ( sqrt(a.x+a.y+a.z) * sqrt(b.x+b.y+b.z) ) ) * 57.2957795; I think its generating so kinda weird number that crashs anything I pass it to :( plus weird graphical artifacts show up on the screen. I'm not sure whats wrong with it. @titmouse I tried some the roll pitch think that you are doing butby owen - Coding
I can't test it until I get home in the next 2 hours but this is what I have written out so far; guVector a, b; float theta_x, theta_y, theta_z; float dot=0; a = (0,0,-1); b = player_direction; b.y=0; //we doing y dot=guVecDotProduct( &a, &b ); theta_y=acos( dot / ( sqrt(a.x+a.y+a.z) * sqrt(b.x+b.y+b.z) ) ) * 57.2957795; //repeat about for x, z GRRLIB_Objeby owen - Coding
@bmeier sorry for the confusion. There are actually 2 problems in this thread, the first problem was rotating the player_direction vector around the player_position (on the y-axis) was solved using matrix rotation by wilco2009. The second problem is rotating the model to face the player_direction vector similar to what you have in picture number 2. For example; player_position = ( 9, 50,by owen - Coding
Hello hope you guys had a good weekend. Still no luck in getting the correct orientation of the model following a path in 3d. rotation.x = atan2( player_position.y, player_direction.z) * 180 / M_PI; rotation.y = atan2( player_position.x, player_direction.z) * 180 / M_PI; rotation.z = atan2( player_position.x, player_direction.y) * 180 / M_PI; I have a track which is currently a squareby owen - Coding