Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, dr_panther), 821 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Need help with this code snippet #440896
05/05/14 15:34
05/05/14 15:34
Joined: Mar 2013
Posts: 18
USA - East Coast
D
DarkProgrammer Offline OP
Newbie
DarkProgrammer  Offline OP
Newbie
D

Joined: Mar 2013
Posts: 18
USA - East Coast
I need some help with this code. Just started playing around Lite-C. after running it the display is blank. I expected a rotating sphere to appear. I thought the line ENTITY* sphere = ent_create("sphere.mdl",vector(0,0,0),NULL); would create a sphere primitive shape that would get rotated. Any advice would be helpful, so, thanks in advance.

Code:
#include <acknex.h>
#include <atypes.h>
#include <default.c>

function  main()
{
   level_load(""); // open an empty level. you can use NULL instead of ""
   ENTITY* sphere = ent_create("sphere.mdl",vector(0,0,0),NULL); // create sphere model at position (0,0,0)
   while(1) 
   {
      sphere->pan += 1; // rotate the sphere with 1 degree per frame
      wait(1);  // wait one frame
   }
}


Re: Need help with this code snippet [Re: DarkProgrammer] #440897
05/05/14 15:41
05/05/14 15:41
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
works everthing perfect (and as excpected ;))
You don't see the sphere because you are IN the sphere. Create the sphere at
vector(100, 0, 0)
and try again


Visit my site: www.masterq32.de
Re: Need help with this code snippet [Re: MasterQ32] #440898
05/05/14 15:45
05/05/14 15:45
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
There's one small other thing to note and that is that you may see a different sphere in the engine than you have in your work folder (I'm not completely sure, though). Should it happen then the reason is that CUBE_MDL (probably "cube.mdl") and SPHERE_MDL are pre-defined objects and will/ could override your objects called cube and sphere. (The obvious solution is to change your model names.)


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Need help with this code snippet [Re: Superku] #440899
05/05/14 16:24
05/05/14 16:24
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
the internal models are _cube.mdl and _sphere.mdl so SHOULD not matter


Visit my site: www.masterq32.de
Re: Need help with this code snippet [Re: MasterQ32] #440900
05/05/14 16:31
05/05/14 16:31
Joined: Mar 2013
Posts: 18
USA - East Coast
D
DarkProgrammer Offline OP
Newbie
DarkProgrammer  Offline OP
Newbie
D

Joined: Mar 2013
Posts: 18
USA - East Coast
Thanks guys, the help is awesome.

Re: Need help with this code snippet [Re: DarkProgrammer] #440901
05/05/14 16:48
05/05/14 16:48
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
You are right, the defines/ file names have changed (German thread: http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=399489#Post399489).


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1