Recent Posts

Pages: 1 ... 8 9 [10]
91
General Jo Engine Help / Re: 3D 1st person view with TileMap
« Last post by b1tsh1ft3r on October 24, 2017, 03:16:58 am »
I have seen the demo, however its a bit advanced for me just starting out with 3d programming i have to admit. i understand somewhat but im looking to see if perhaps there is an explanation on some of the functions like the rotate matrix/transform matrix ect.., or perhaps ordering in which some of the commands are called. Id like to get a good grasp on some of the functions and their true meaning and use before trying to dive into piecing something together.
92
General Jo Engine Help / Re: Compiling Jo Engine under GCC 7.2.0
« Last post by mindslight on October 23, 2017, 09:33:20 am »
Hi Xavi92,

I'll check that :)
93
General Jo Engine Help / Re: 3D 1st person view with TileMap
« Last post by mindslight on October 23, 2017, 09:31:18 am »
94
General Jo Engine Help / 3D 1st person view with TileMap
« Last post by b1tsh1ft3r on October 22, 2017, 09:58:19 pm »
Hello everyone!

Just curious if maybe there is a good tutorial explaining some of the 3d functions and best practices with use? I would like to setup something similar to the 3D Map demo included with jo engine but put a 1st person camera view and movement to the demo over a tilemap displayed in 3d. Im familiar with how 3D view space works, but im new to 3d programming. If anyone has any good tips or docs where i could start i would be very greatful!

Thanks!
95
General Jo Engine Help / Compiling Jo Engine under GCC 7.2.0
« Last post by Xavi92 on October 22, 2017, 04:32:17 am »
Hi there,

I heard about your game engine a few days ago thanks to the guys in Sega Saturno forums. As a Linux user, I was a bit puzzled when the README file suggested me to use Wine, so I recompiled GCC version 7.2.0 for the sh-elf target (Jo Engine originally is meant for sh-coff, which seems to be currently deprecated). Surprisingly though, Jo Engine could be easily compiled, but when linking "demo1" against libjoengine.a and SGL libs, GCC complains about not finding "-lc" (standard C library). I haven't extensively read JoEngine's source code, but is it actually supposed to use libc? If so, where can I find an implementation for it?

Thanks for reading.
96
Jo Engine Wish List / Link cable support
« Last post by b1tsh1ft3r on October 21, 2017, 09:09:27 pm »
Not sure if anyone else might find this fun but i think being able to make multiplayer games would be somewhat interesting. I assume this is purely serial data on the communications port.
97
Thanks to both of you. It seems to work OK (but I haven't tried on real hardware). Now returning to work on building a kd tree + PVS.

Me and Danny are also starting to look at the SCU DSP. Do you think it can be used for matrix transformation?
I know most people couldn't get anything out of it, but they were using SGL.
The way I see it would be to do matrix transformation on it and DMA the result in the z-sort buffer, but I'm not sure it's possible (with small meshes only, since the SCU DSP RAM is 256x32 bits, which isn't a problem for me)
98
Nope, the size of a pointer depends of the architecture. (32 bits => 4 bytes, 64 bits => 8 bytes, etc). It's just not portable.
Yes you are correct, I did not explain myself correctly, what I meant is that with void* you don't know the size of what you are pointing to so when you do pointer arithmetic it might not work correctly.
Like you said  the void* size depends on the CPU architecture, all the pointers in an application have the same size and that is why you can simply cast them from one pointer type to another, whatever the data the pointer is pointing to it just contains an address.
You can even have pointers that point to another pointers xD:
Code: [Select]
//have an int
int int_val = 1;
//save its pointer
int* int_pointer = &int_val;
//save the pointer to that pointer
int** pointer_to_int_pointer =&int_pointer ;
//now increase the original int with the pointer to pointer 8D
*(*pointer_to_int_pointer)++;
//int_val will now be 2
99
I think Johannes specified the temp pointer as char because when you use pointer arithmetic like temp_pointer+2 what you really are saying is temp_pointer+(2*sizeof(char));

+1  ;)
I need to read data byte per byte so that's why i'm using a char * (to avoid cast every time)

If you do pointer arithmetic on a int* like int_ptr+2 what you are really saying is int_ptr+(sizeof(int))

Yep :) ptr + 1 gives the same value as ((char *)ptr) + sizeof(*ptr) and also the same values as &ptr[1]

If I remember correctly if you try to do pointer arithmetic on a void* it wont work correctly because void has no size, since it has no size the compiler does not know how much to add.

Nope, the size of a pointer depends of the architecture. (32 bits => 4 bytes, 64 bits => 8 bytes, etc). It's just not portable.




100
Hi friend!
C is a strongly typed language so it enforces correct use of types, but if you know what you are doing you can cast a pointer to something else.
You can cast the return pointer to the type you are using like int* or your_type* or a void* (which matches everything) and the warning will go away.
For example:
Code: [Select]
jo_file file;
char * temp_pointer;
super_duper_type * awesome_thing;
...

jo_fs_open(&file, "FILE.TXT");
jo_fs_seek_forward(&file, 4096); /* I assume that 4096 is the size of the part to skip in the file and to preserve in the buffer */
jo_fs_read_next_bytes(&file, temp_pointer + 4096, 42);
jo_fs_close(&file);

awesome_thing = (super_duper_type*) temp_pointer;
// or like this: awesome_thing = (void*) temp_pointer;

I think Johannes specified the temp pointer as char because when you use pointer arithmetic like temp_pointer+2 what you really are saying is temp_pointer+(2*sizeof(char));
If you do pointer arithmetic on a int* like int_ptr+2 what you are really saying is int_ptr+(sizeof(int))
If I remember correctly if you try to do pointer arithmetic on a void* it wont work correctly because void has no size, since it has no size the compiler does not know how much to add.
Pages: 1 ... 8 9 [10]
SMF spam blocked by CleanTalk