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 wilco2009 - Coding
@Owen: I was trying to solve the problem of first and third person view, and until now I can't find a solution. The solution proposed by Titmouse and you is not working if the angle is bigger than 180º. In this case your solution is doing a mirror of the model. I've found a solution using matrix calculation and I'll try to explain you below. First person mode: When you wantby wilco2009 - Coding
atan give you the values in radians. You have to convert to degrees (degrees = radians* 180 / PI)by wilco2009 - Coding
For the calculation of the angle for each rotation axis, you have to take the other two coordinates. - To calculate rotation around x axis you have to take y and z coordinates ------> angle = atan2(y,z) - To calculate rotation around y axis take x and z coordinates -----> angle = atan2(x,z) - To calculate rotations around z axis take x and y coordinates ------> angle = atan2(x,y)by wilco2009 - Coding
Yes, this is a possible method. If you know the player vector direction is easy to calculate it. Player direction is the tangent of the angle, then you only have to calculate the arctangent of the x component divided by z component: angle = arctg(player_direction.x/player_direction.z)by wilco2009 - Coding
If I understand, you try to draw the car of the player. The angle needed is exactly the same that you used to setup the camera. You have to apply this angle before to move the object to player_position. For instance, if player car is a cube the code could be something like....: GRRLIB_ObjectViewBegin(); GRRLIB_ObjectViewRotate(0,angle,0); GRRLIB_ObjectViewTrans(player_position.x,pby wilco2009 - Coding
Hi Owen, I can't understand your question. You are trying to find the angle to draw the player car?by wilco2009 - Coding
Aceleration and gravity is probabily easier than it can seems. A computer program doesn't works with continuous time. Due to it we have to work with discrete ecuations, theese means we will works with addtions instead products. At the end, to simulate velocity we only have to increment position using a constant factor, and to simulate aceleration is enough to increment velocity using anotheby wilco2009 - Coding
Sorry again. I solved another little bug. guVecMultiply have to be used at the end to apply the matrix result: Mtx m,om; guMtxIdentity(m); guMtxApplyTrans (m, om, -player_position.x, -player_position.y, -player_position.z); guMtxRotDeg(m, 'y', angle); // rotate around y axis by 60 degrees guMtxConcat(m, om, om); guMtxIdentity(m); guMtxApplyTrans (m, m, player_position.x,by wilco2009 - Coding
Bellow you can find a tested code: Mtx m,om; guMtxIdentity(m); guMtxApplyTrans (m, m, -player_position.x, -player_position.y, -player_position.z); guMtxConcat(m, om, om); guMtxRotDeg(m, 'y', angle); // rotate around y axis by 60 degrees guVecMultiply(m, &orig_direction, &player_direction); guMtxConcat(m, om, om); guMtxIdentity(m); guMtxApplyTrans (m, m, pby wilco2009 - Coding
To combine the tueidj's ecuation with the position vector you have to use player_position as origin of coordinates before to rotate "player_direction". Due to it you have to move player_direction in the following way: player_direction' = player_direction - player_position. then rotate and then move again in oposite direction: player_direction'' = player_directionby wilco2009 - Coding
OK, If I understand you have a player postion (camera vector) and you need to calculate the lookat vector. Isn't it? If it is correct the process is the following: - You need to keep the direction vector as an unitary vector. For instance you can start looking at front (0,0,1) - If you want to rotate the view direction you have to turn the direction vector a certain angle: angle=Deby wilco2009 - Coding
@owen - As tueidj says, to rotate a position point has not sense. The rotation have to be applied to the direction vector, and then to increment position vector based on the direction vector. angle=DegToRad(60); player_direction.y = player_direction.y; player_direction.z = player_direction.z*cos(angle)-player_direction.x*sin(angle); player_direction.x = player_direction.z*sin(angle)+playby wilco2009 - Coding
If you wanna do the calculations manually the easiest way is using two easy formulaes. I suppose the vector rotates on the Y axis. z' = z*cos(angle)-x*sin(angle) x' = z*sin(angle)+x*cos(angle) Please take in account that sin and cos functions works in radians. Due to it you have to use DegToRad function.by wilco2009 - Coding
I'm trying to use a specular light with a textured object and I get a crazy black&white image. If I use the same object but without textures, specular light works as expected. Somebody knows what could be wrong. My code as follows: GRRLIB_SetLightSpot(1, (guVector){ 5.0f, 0.8f, 0 }, (guVector){ 0.0f, 0.0f, cubeZ }, -4.0f, 5.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0xFFFFFFFF);by wilco2009 - Coding
Yes, if I do that you say, the image still crashing. I thing it is a bug in the library. By other hand, your library seems great. It is very interesting and I'll will try to use it in my programs.by wilco2009 - Coding
Chapter 8 will include mp3, ogg and raw sounds, and file access, but I think you know a lot of all theese matters. The example program is a photo/music viewer. My question in the another topic in this forum ("jpg images crashes loading twice") have relation with chapter 8.by wilco2009 - Coding
I display only one file same time. When user press a button, the program calls to function leeimagen, and in this function, before to load the new image, memory is released with GRRLIB_FreeTexture. The program works fine with pngs, and some jpg files, but with others GRRLIB_LoadTextureFromFile crashes the following time I call the function. This happens when you user press next and then bacby wilco2009 - Coding
You have to take in account you export to raw format with exactly the same sound frecuency and mode than you uses in your ASND_SetVoice function.by wilco2009 - Coding
Hi dirfinyu! Nice to see you here. Play more than one mp3 stream simultaneusly is not possible because MP3Player uses always (and only) sound channel 0. OggPlayer is also using channel 0, due to it is not possible to play an ogg file and a MP3 file simultaneusly. Oggplayer source is public. Perhaps you can modify Oggplayer to play more than one song in parallel.by wilco2009 - Coding
I'm writting a GRRLIB tutorial for a Spanish web, and I'm finishing a chapter about textures. The example code is a "image/music" viewer, and I found a problem with jpg images. When I load a png image I haven't found problems with the same code (only resolution diferent than x4 files are not showed, but it is known), but if the image is a jpg the file is showed once but if Iby wilco2009 - Coding
@giantpune. Thank you, I'll examine Gecko OS source code. Could be very interesting. @tueidj. Thank you. After read you answer it seems obvious. I didn't try it.by wilco2009 - Coding
Somebody knows how is possible to insert ppc assembler code in a c for wii program? I know the __asm () function but only allows to insert one assembler line. thank you in advanceby wilco2009 - Coding
Just update your system by official Nintendo method, throught the internet or using a game.by wilco2009 - Getting Started
I know there are some problems with same sd brand cards. If you can you should try with another card. Better if you try with a standard SD card smaller than 2Gb.by wilco2009 - Homebrew General
Download it from this page Create an /apps folder on the root of your SD card (e.g. E:/apps). Copy the homebrew_browser folder to the /apps folder on your SD card. Ensure that the little write lock switch on your SD card is off. Launch via the Homebrew Channel.by wilco2009 - Getting Started
I think turbo mode consists to remove sincronization delay. GB processor is slower than GBA processor and then is easier to emulate by the Wii. Due to it, is logical that GB programs works faster in turbo mode than GBA programs.by wilco2009 - Homebrew Applications
I mean this list list. I inserted my apps before summer and one or two weeks after I saw them on the homebrew browser. In August I publish a new release, and my app still present in the mentioned list but is not updated in the homebrewbrowser. I thought this list is maintained by somebody on wiibrew, but if not I'll post in codemii forum.by wilco2009 - Homebrew General
I published two of my applications on homebrew browser just inserting them in the homebrew browser list of wiibrew. My question is, how can I inform about new releases to codemii. I published a new release in Wiibrew in august, but so far not been published in the homebrew browser.by wilco2009 - Homebrew General
I also got itby wilco2009 - Old Announcements