Posted at the same time as the faces answer. Owen - Is the soft edge no good for what your doing (you only need to re-use the same x,y,z values in the normal part)? Don't forget to use guMtxInverse(ModelView,mat); as in the fist example. I really don't think you will see much of a difference for lines. To calculate normal’s from three points I post this code just in case you orby Titmouse - Coding
I've never really thought about what a matrix is all about, you post made me think about it. You will know this but I had no idea, anyway I found out the that GX Mtx[3][4] is able to translate and rotate, having a vector for each x,y,z axis & a vector for translation if I understand things. So any idea what the extra vector in the GL 4x4 does? Maybe it's possible to just drop it thby Titmouse - Coding
This is what I do - took me ages to work out and works well for me. The normal values you are using look more like something that is meant for UV texture coordinates. I use two types of surface lighting, one where the normal’s point away from the surface (gives hard edges), and another where the normal’s simply use the x,y,z part again (gives soft edges) . Maybe swapping to the soft edge liby Titmouse - Coding
Tueidj has said what I was thinking all along, as I final test (if this does not work maybe delete \devkitPro\libogc downloading a fresh copy - as I feel is this does not work then how many other things may go bad too) Take the example template.c found in... devkitPro\examples\wii\template\source & add this code void MyPrintf(char* pText) { printf("Message is %s",pText); } // Call iby Titmouse - Coding
Just thinking it’s not point 4 - that happens for me as the consoles callback is stops.by Titmouse - Coding
These might help tracking down this problem.... (maybe some kind of display problem - but feels like its something else not here!) (1) Direct the output to file (SD card), see if it looks ok from there. (I find using ‘WiiXplorer’ is a nice way to view things, I use it for everything including copying files from the PC onto the SD card to test before a release.) see code (2) Use Dolphin (wiiby Titmouse - Coding
How odd, can you post the latest code example. Looks like I've overlooked something. Also, with printf if needed you can just print a string no need for %s, but what you are saying should still work. char *MystringPointer = "Test123"; printf( MystringPointer ); printf( "message is %s", MystringPointer ); As a test try this code after your console_init, it should work fine.by Titmouse - Coding
Looking at Object3D_LoadModel(const char *fn, const char * fn2, int p ) You need use a pointer(s) when passing the parametets char Text1[] = "model/sspaceship01.obj" char Text2[] = "model/sspaceship01.png", Object3D_LoadModel( Text1, Text2, 2 ); // or another way to do the same thing ... Object3D_LoadModel( &Text1[0], &Text2[0], 2 );by Titmouse - Coding
Here's something that may help, it's in c++ This loads up oggs and wavs. It should be part of Game Framework but the package is a bit out of date (no sound) so I've provided an updated sound manager part here - let me know if you need some example calling code and I'll update the framework to include the sound and a working example or both ogg & wav rather than slapping largby Titmouse - Coding
I like the way you have written this Owen, nice piece of code. Looking at the code the check_diff, has x4 compares. Check_collision calls check_diff, so that 24 compares in total. Try these things out... (1) put the 'check_diff' definition into a header file to help maximize the chance of it becoming inline. (2) To optimise 'check_collision' use logical ORby Titmouse - Coding
Owen can you post that bit of code again, think I can help out performance wise. but the check_diff routine, looks like it has a typo.by Titmouse - Coding
wilco2009 - yes it's a very basic check That’s way I did said: "It's good for a first step test when you need to find out if it's in or out the field of view." Low detail models derived from the working model sounds a good way to go – that way you can dial it up or down depending on the viewing distance using whatever checking method you believe will work best.by Titmouse - Coding
Sorry Owen – that was a bad joke about you using plain C, I would never have a dig at anyone’s coding skills. Apologies for poking fun at you; dire attempt at trying to get you to move over to C++by Titmouse - Coding
No I just check if two points are within a given radius. I just increase the radius to take account of both vessels, no need for anything more complex - keep it simple. As you know its C++ so both of the vessels points are known. Here’s some example calling code, 60*60 is to get rid of the need for sqrt. (I just love C++ containers, dam fast and I not had _ANY_ bugs let alone crash bugsby Titmouse - Coding
Not visited the code forum for a while... I find sphere testing very efficient (the Wii loves floats), here a snip of my code as an example. Change it to pass in guVector* and also include z as part of the equation. It's good for a first step test when you need to find out if it's it in or out the field of view. // note: The radius param takes a squared value so saves using sqby Titmouse - Coding
D'oh, gettime() does indeed give exactly the same u64 results, nice (I problably used something like time() in the past).by Titmouse - Coding
Just take care with anything that might use time_t as at machine level it’s defined as long. ( so something may return u64, but internally uses far less resolution) Can’t remember exactly but when I tried the library supplied timer methods, think it was somewhere around 15 seconds before time wrapped around. This caught me out big time in my timer even code! To get a true u64 high resoby Titmouse - Coding
Thanks for the information tueidj - but I did say "the Wii’s designed top resolution" just to cover myself :) Without tricks the Wii’s designed top resolution still stands at 640x528by Titmouse - Coding
This code is taken from ... it's a nice way to get a hiress 64bit timer. No idea about the (load/save???) serialize suff. u64 timer_gettime() { u32 tb_upper; u32 tb_upper1; u32 tb_lower; u64 time; do { __asm__ __volatile__ ("mftbu %0" : "=r"(tb_upper)); __asm__ __volatile__ ("mftb %0" : "=r"(tb_lower)); __asm__ __volatile__ ("mftbu %0" : "=r"(tb_by Titmouse - Coding
Hi tueidj, don’t think you can squeeze more than 528 due to the hardware design. I agree adding more scanlines does sound plausible, but how would you disable the effect of xfbHeight & efbHeight? Maybe possible for NTSC /PAL60 but Y scaling would still kick in once you pass 528, unless you drop the width to increase the height. Plus if it did work you may not see anything extra anyway. Betterby Titmouse - Coding
ekeeke I know, that's what said!!! // probably top limit for stretching the display onto your TV anyway the EFB maximum is 640 x 528... so thats the max resolution, it's just the way the hardware works. oibaf 640x528 is all the Wii can offer, you just can't pump out 720 pixels per lineby Titmouse - Coding
Found this information about the EFB Maximum capacity of 640 width x 528 height x 6bytes (3 colour & 3 Z buffer) - that’s 2027520 bytes The ogc libs also support these facts saying - "The stride of the EFB is fixed at 640 pixels" As for antialiasing (anyone used this mode?), samples are computed for each pixel - “and the total available number of pixels in the EFB is reduced by half (640 pby Titmouse - Coding
Hi all, I've tried adding '-pg' to my makefile to generate profile information but I'm getting linking errors (undefined reference to `_mcount') Anyone know if the GCC development stuff for the Wii supports this feature? Profiling a simple example 'template' also give the same link error. Currently I'm using a high resolution timer and some homeby Titmouse - Coding
I’ve not seen anyone trying this on the Wii – lots of computer science projects out there that reverse engineering the wiimote to fit other hardware, not yet seen anything that pairs up a Bluetooth device with the Wii. From looking at the Bluetooth base library (bte.h) it’s interface looks good to go – I would of thought it fits the standards. Think your exploring new territory – good luckby Titmouse - Coding
All this has given me another thought! If something is doing tones of maths and not using the FPU, maybe share some of the workload with the FPU so it can do it in parallel. I’m guessing it would work. Now this is a wild guess, but hell you might even find that doing everything in floats is more efficient due to the wii’s architecture, after all the FPU is build to crunch numbers.by Titmouse - Coding
Thanks everyone, Yes looks like one of my bottle necks was mainly I/O I’m now decoding the stream(s) to memory first at game start-up, my plan was to generate wav’s and store them to SD on the very first run, but it looks like it’s going very quick using just memory and decoding each time at start-up. As for Tremor using more CPU time – Floating point emulation just does! I’m not having aby Titmouse - Coding
Anyone know of an optimised Ogg decoder somewhere that uses floating point? Tremor seems very CPU heavy as its integer based. But at a pinch I'm happy to use tremor as it does what I need. This bit may help others.... It took me a while to find the ogg decoder 'tremor-lowmem-ppc.tar' found at (Didn’t look in portlibs at first coz I thought it was about ports - guess it staby Titmouse - Coding
Try out SDL - Simple DirectMedia Layer, its ideal for game programmers and is very portable across platforms. SDL does all the hard bits for you - also you can start programming a game on the PC and port it over to the Wii with very minimal effort. Download some small SDL working examples and work up from there - for the moment use something like a PC for the target while you finding you feet.by Titmouse - Coding
11ssims - What type of game are you making?by Titmouse - Coding
Daid is the 720 x 574 resolution is correct? Where did get these values from as I though 640x576 was the top limit? NTSC @60Hz, 640x480 (USA & Japan) PAL @50Hz, 640x574 (Europe) PAL60 @60Hz, 640x480 (for modern European TVs) Something else worth pointing out as alot of homebrew suffers from this: When coding your display & logic parts; you need to deal with the 50/60 Hz refresh rate aby Titmouse - Coding