removing objects and timing+objects movement

This may sound stupid…
How Can I delete obejcts after use so that it will deleted from screen???

How can I put time on how long something will stay on screen??? Like I want to show that red cube around here 5 seconds???

How Can I move Objects around Screen???

Those are so basic, that it would hint to me that you simply aren’t familiar with programming in general. You might want to try something easier first to better learn the principles involved. Like make a simple program that prints your name on the screen for 5 seconds then takes it away. If you can do that, then you could do this.

[This message has been edited by DFrey (edited 07-19-2001).]

You know what beginner means?
I know the all c++ **** that they teach us on books… cout << “I am beginner”
And on turials they just show how to make objects and texture and rotate them…
Please I really need help

Just knowing the stuff in books isn’t always good enough. You have to understand it as well, and have to be able to use what you know to achieve what you want. As DFrey said, think about how you would print out “I am a beginner” for 5 seconds and then remove it from the screen. The way you would do it in OpenGL is almost exactly the same. Just as the console doesn’t keep track of letters you send it, OpenGL doesn’t keep track of objects you draw…

Hey, why won’t you guys help stupid? I need help with the same problem.

Give a man a fish, he eats for a day. Teach a man to fish, he eats for a lifetime.

Thanks for nothin’ DFrey. I don’t eat fish.

Uh, nice one Newbie2001. Or should I say cousin ?

I know nothing of OpenGL people. I’m just bored 15 yr. old kid lookin’ for somethin’ to do . So, I ban myself from this forum until I am a true newbie.

ok i will help

if you want to see one object for eyample 5 seconds draw it on screen and dont clear it for 5seconds, and dont draw anything else …

Real answer: every call is only done 1time, never repeated by the api( that mean, if you draw, and then clear the api does not do this again until you say it !!!)

and guys, isnt it so that directx keeps tracking objects … !?! i think it is …

D3D is as stupid as OpenGL. It doesn’t know anything about what is to be drawn, nor what has been drawn, nor does it know what an object is (actually what IS an object? The whole car, or each part of the car?). D3DX, on the other hand, MIGHT know about something like an object. D3DX is a helper library for D3D, similar to GLU I suppose. It includes vector/matrix functions, file loaders and stuff like that.

A suggestion for you other guys. Go to NeHe’s site . He got some nice tutorials on OpenGL programming. He starts from scratch, and all you have to have is some basic programming knowlegde.

Direct3D RM kept track of objects in “frames” (not animation frames, but something that I thought of as planes), but the new combined Direct3D stuff in Dx8, and Direct3D IM in older releases didn’t.

Anyway, so far as the questions, you should basically be clearing and redrawing the scene each frame. If you want to “delete” an object from the scene, just don’t draw it!! Duh! :stuck_out_tongue:

Are you guys so 1337 that you cannot help newbies???
Like I would be teacher and I would not let pupils to my classroom!!!
Grow up people…
And what is Delay(x) command on windows?
And what is the command to delete objects?

You’re still not getting it. If you do not want something to appear on the screen, then you just do not draw it. There is no general delay command (except for sleep but I doubt you want to put the thread to sleep). Instead you have to keep track of time and decide when and when not to draw things. I would suggest you visit and work through the tutorials.

[This message has been edited by DFrey (edited 07-21-2001).]

Hey stupid?, I’m not a real newbie. I was just bored at that time of day. I know nothing of OpenGL, and as of now don’t care to as I am only 15. I have other things to worry about then how to programm at the moment. Sorry if you people except for DFrey thought I was really a newbie. :stuck_out_tongue:

hey maybe you could help me out then, cuz i am a real newbie instead of not helping this kid out ?

Ok these questions are really the basics of Graphics programming using an API. I suggest doing 2d-DirectDraw or just GDI programming before going to 3d. But if you want to know the answers anyway here they are:
It is very simple. When you Display objects
or better vertices, they are calculated and displayed every couple of milliseconds.
So you dont actually delete an object, you stop telling the computer to draw it.
First make a Timer(if you dont know what this is tell me).
Inside the timer use the
glCallList() function
or the standard Primitive functions to display your objects. Put these inside an if clause for example if(planet1).
now to delete these objects just set
planet1 = FALSE;
Ill give you a short example.
(dont copy the code its just an extrakt,
and its only to show the idea)
BOOL planet1 = TRUE;

void Timer()

I will show the example using Timer ticks
not Time.
Make a variable time = 0;

void Timer()
if(time > 100) //example time
time = 0;
planet1 = FALSE;

This you really have to know unless this is your first time graphics programming.
From left to right example
Just make an object with coords
x, y, z and then ad this in the
Timer Function:


Another way to think about it would be something like so… You have a list of C++ objects, each with a member variable that has some timeout variable. Each frame you walk through the list and draw all the objects. If an object times out, or you use some other way to “delete” the object from the scene, you simply remove it from the list so it doesn’t get drawn anymore.

When I got no help I tried my own…
did not see 2 messages above this
I realized that all the tutorials loop the one part of the code forever…
so I made little If function…
now it works…
but getting good timer is mission impossible…