3D Objects in Game Editor

Post here your demos and examples with the source files.
Forum rules
Always post the games with a screenshot.
The file must have the ged and data files (complete game source)
Use the forum attachment to post the files.
It is always better to use the first post to put the game files

Re: Screensaver

Postby tintran » Mon Jan 16, 2012 12:46 am

Game A Gogo wrote:
tintran wrote:edit: moved some arrays definition from displaywire() to global and solved the memory leak, weird I thought that functions automatically handled memory freeing of arrays that are defined within it.

This pretty much only happens within GE, happened to me before
When a game closes from within GE, I don't think it clears any memory

Good to know.
The weird part is that that function is called everytime the model rotates a little, so 18 times happens all the time when it's running but it won't cause that error.
User avatar
tintran
 
Posts: 157
Joined: Fri Dec 24, 2010 1:34 am
Score: 30 Give a positive score

Re: Screensaver

Postby Game A Gogo » Mon Jan 16, 2012 1:44 am

I think it uses the same memory space every time it runs the function, but then it would need to allocate the already allocated memory.. perhaps it just allocates it once when GE compiles the function? GE doesn't seem to follow the same scoping rules as in normal programming. Though I can't be too sure about this since I don't know much of how GE handles with variable, only that it's buggy if you know how to abuse it.
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: Screensaver

Postby tintran » Mon Jan 16, 2012 10:11 pm

what's a good way of letting user type in a file name and then they hit Enter i can load that .obj file?
I tried using GetKeyState() but the typing seems buggy to the user experience when 2 or more keys are down.
Attachments
fileinput.zip
(295.59 KiB) Downloaded 256 times
teapot.png
User avatar
tintran
 
Posts: 157
Joined: Fri Dec 24, 2010 1:34 am
Score: 30 Give a positive score

Re: Screensaver

Postby skydereign » Mon Jan 16, 2012 11:37 pm

I usually use an any key down event, and use getLastKey and a switch statement (default adding a character defined by getKeyText). The specified cases for backspace, and shift, and perhaps adding an escape.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Screensaver

Postby Game A Gogo » Tue Jan 17, 2012 12:09 am

personally, a text input actor is much simpler to use I find
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: Screensaver

Postby tintran » Tue Jan 17, 2012 12:27 am

oh now i feel like an idiot that that's already built-in too :)
Attachments
textinput.zip
(295.28 KiB) Downloaded 312 times
cessna.png
User avatar
tintran
 
Posts: 157
Joined: Fri Dec 24, 2010 1:34 am
Score: 30 Give a positive score

Re: Screensaver

Postby SuperSonic » Tue Jan 17, 2012 3:21 am

Hey, I have an idea. I havn't taken a deep look into your code so I'm not sure if this will work or not. You could try loading a series of .obj's instead of just one and displaying them as frames of an animation. Like you could have an array and you could have the canvas display one .obj and then the next etc. Would that work at all? :)
A tree never hits an automobile except in self-defence.

Want to use your joystick or controller with Game Editor? Check out my controller engine =D
User avatar
SuperSonic
 
Posts: 1443
Joined: Fri Sep 24, 2010 9:24 pm
Location: Anywhere
Score: 72 Give a positive score

Re: Screensaver

Postby skydereign » Tue Jan 17, 2012 6:05 am

That would work for animations. I did that once using just pixels in canvas (importable animations), but the actual use of this is currently severely limited by the canvas's efficiency. And the reason I don't use the built in text input is mainly due to the repeating keys. But then again, I already have a base ged for mine so I just merge it into a game.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: 3D Objects in Game Editor

Postby SuperSonic » Tue Jan 17, 2012 5:26 pm

@Sky: Cool. I like to do stuff like that too. Make a lot of code an save it as a ged template. Then just merge it :D

@Tintran: So are you gonna try animations? :P
A tree never hits an automobile except in self-defence.

Want to use your joystick or controller with Game Editor? Check out my controller engine =D
User avatar
SuperSonic
 
Posts: 1443
Joined: Fri Sep 24, 2010 9:24 pm
Location: Anywhere
Score: 72 Give a positive score

Re: 3D Objects in Game Editor

Postby tintran » Tue Jan 17, 2012 10:51 pm

I don't think i am going to try animations. It's already slow. plus i think i would have problems coming up with the models that represent each frame.
User avatar
tintran
 
Posts: 157
Joined: Fri Dec 24, 2010 1:34 am
Score: 30 Give a positive score

Re: 3D Objects in Game Editor

Postby SuperSonic » Tue Jan 17, 2012 11:18 pm

It doesn't run slow on my computer. Plus, I can come up with some basic animations for you (like animation cessna.obj) :P
A tree never hits an automobile except in self-defence.

Want to use your joystick or controller with Game Editor? Check out my controller engine =D
User avatar
SuperSonic
 
Posts: 1443
Joined: Fri Sep 24, 2010 9:24 pm
Location: Anywhere
Score: 72 Give a positive score

Re: 3D Objects in Game Editor

Postby skydereign » Tue Jan 17, 2012 11:39 pm

Actually making the animation to work only takes a little bit of string manipulation so you could probably do it yourself, and moving the wirefromfile function into something that repeats. If you set it up right, then you only need to redraw the wireframe every time you want to change the frame, and since you aren't rotating it will generally be fast enough.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: 3D Objects in Game Editor

Postby tintran » Wed Jan 18, 2012 12:56 am

@skydereign: you're right.
@SuperSonic: let's wait for your basic animations, right now i only have examples of static models.
User avatar
tintran
 
Posts: 157
Joined: Fri Dec 24, 2010 1:34 am
Score: 30 Give a positive score

Re: 3D Objects in Game Editor

Postby Hblade » Wed Jan 18, 2012 3:13 pm

This just keeps getting better. the performance is NICE too!

Now if only you could possibly get it to be in full color and texture probably using something similar to the BMP Loading thing that DST made, but heck I wouldn't have the slightest clue how, or how you did this for that matter. I tried reading your code and got super confused haha.

Your an amazing programmer, your going to make awesome games in the future.
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: 3D Objects in Game Editor

Postby SuperSonic » Wed Jan 18, 2012 3:59 pm

tintran wrote:@SuperSonic: let's wait for your basic animations, right now i only have examples of static models.

Here is a simple 10 frame animation of a chest opening. I can add more frames to it if it looks sloppy or anything :wink:

http://www.multiupload.com/MUSNKN9Y81
A tree never hits an automobile except in self-defence.

Want to use your joystick or controller with Game Editor? Check out my controller engine =D
User avatar
SuperSonic
 
Posts: 1443
Joined: Fri Sep 24, 2010 9:24 pm
Location: Anywhere
Score: 72 Give a positive score

PreviousNext

Return to Game Demos

Who is online

Users browsing this forum: No registered users and 1 guest