View Full Version : increasing the size of objects on the fly
say you have a scene with a Cube attached to a cylinder resting on the ground - you move/translate the cube up the cylinder grows or expands with it vertically and when you move it down it shrinks
also is there a pen function in opengl
03-21-2001, 05:43 AM
OpenGL is a low-level 3D API. What you describe implies knowledge about "objects" and their properties. Sounds like a task for a higher level API (OpenInventor etc.).
Nonetheless, the visualization of this rather simple example can be done with OpenGL with very few efforts.
Do you mean "pen" like pencil or "pan" like panning?
OpenGL does not know about input devices.
Panning is done by adjusing the viewing matrices.
03-21-2001, 07:41 AM
Don't you just need to glScalef it, in the direction you want?
Remember if you do so, you should enable GL_NORMALIZE, or else the OpenGL lighting will get screwed.
Originally posted by Relic:
[B] Nonetheless, the visualization of this rather simple example can be done with OpenGL with very few efforts.
how would you suggest that I tackle this then? What I want to do is say I have an object supported on a pole - if I move the object down the pole gets smaller and increases in size if I move it up - I know I could make the pole large and make it disappear under the floor -(so not using collision detection) but I thought it would be rather nice if there was a way of doing this
I don't think scaling would work because this cylinder would be expanding or shrinking in the y direction without zoom
Do you mean "pen" like pencil or "pan" like panning? [B][/QUOTE]
yes - pen like pencil - I was just wondering if opengl has some sort of a devicewhichich you could perhaps draw round objects on the fly
03-21-2001, 09:26 AM
As Relic pointed out, OpenGL has nothing to do with input devices. You can certainly get your OS to tell you the location of the cursor and have GL draw something there, but there is no direct link. Basically the same deal with the cylinder/cube thingy - GL can draw a cylinder, it can draw a cube, but it really has no idea what it's drawing, and the user can't interact with them directly using OpenGL - you have to write that code yourself.
Powered by vBulletin® Version 4.2.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.