Or you can use x number of maps, each with a different scale, and each scale in a frame. Then using some logic, "zoom" into the particular sprite frame.. Ok, a lot of work to put it together, but at least it's still only 1 resource
This forum is now archived!
- Welcome to the archive!
News:
The 3DRad community can be found at classdev.net.
- 3D Rad - Free 3D game maker - Forum >
- General Category >
- 3D Rad - User-created Sample Projects, Scripts, Tutorials >
- Little Useful Projects
Author Topic: Little Useful Projects (Read 27718 times)
jestermon
OK but.. if the map is a sprite & attached to a separate cam, then scaling the sprite wont matter cause the new cam can have a smaller limited on screen display area.. just like a rear view mirror, but square..
hi TinSoldier... thanks for interest... I was thinking about that before making the minimap resource, with no luck... the main problem is that we can't use sprites as masks so we must have the complete map always visible... if you zoom in to the map, the sprite will be scaled... I'm pretty sure you don't want this...
however, maybe this can be solved with shaders, but unfortunately I can't help you on this... surely shadmar have an answer for us
psikotropico
well... I'm thinking on a circle with soft edges... with a moving map into the circle, zooming relatively to the speed... all that is posible except the masking... I don't like the idea of a square map but if you can integrate it well in your HUD, you got it... the it's definitely is possible...
@jess... that solves the scaling but not the movement or masking...
ahhh!!!... that remembers me the need of sprite masks!!!...
@jess... that solves the scaling but not the movement or masking...
ahhh!!!... that remembers me the need of sprite masks!!!...
jestermon
The other option is a dedicated camera way off somewhere in space, so it has it's own "display area", then you use:
1.. Camera for map .. Can't be round, but it's a start (Layout as in rearview mirror)
2.. Billboard background
3.. Imposters for dots or icons.
4.. Can move and zoom the camera as you wish
5.. Equals 1 cam + 1 billboard map + 1-2 master billboard for imposter icons = 3-4 resources .. oops almost forgot + 1 script.
1.. Camera for map .. Can't be round, but it's a start (Layout as in rearview mirror)
2.. Billboard background
3.. Imposters for dots or icons.
4.. Can move and zoom the camera as you wish
5.. Equals 1 cam + 1 billboard map + 1-2 master billboard for imposter icons = 3-4 resources .. oops almost forgot + 1 script.
however, maybe this can be solved with shaders, but unfortunately I can't help you on this... surely shadmar have an answer for us
You should be able to this with all the current _user_ shaders, but it needs abit of scripting.
To control texture zoom you can use
iShaderFloatSet(OBJ_X, "TileCount", float); //the lesser float the more texture get zoomed
For moving texture around you could use :
iShaderFloat2Set(OBJ_X, "UVW", floatX, floatZ); // X and Z texture offset.
Also TileCount doesn't zoom texture center, so when you zoom texture I'd guess it needs to be a combination of the two functions to make it work. (I haven't tried)
well this sounds good, a square map moving around would be ok mostly because it would depend on the map / ground design, could be round or square .
Just need some code to play with now..
Just need some code to play with now..
well... I'm thinking on a circle with soft edges... with a moving map into the circle, zooming relatively to the speed... all that is posible except the masking... I don't like the idea of a square map but if you can integrate it well in your HUD, you got it... the it's definitely is possible...
@jess... that solves the scaling but not the movement or masking...
ahhh!!!... that remembers me the need of sprite masks!!!...
Playing around iv found that i can use 2 sprites and setting the "priority" to 0 & the second to 1 to adjust rendering order.
the second sprite is the "HeadingIndicator.3dr" project. ( set -90 to 90 so the sprite rotates in the opposite direction).
This gives a basic radar as a beginning.
Whats needed now is a scaled movement process for the ground map sprite to keep the radar host position located on the map properly.
And a zoom for the sprite. ( maybe starting with a large sprite ( the maximum zoom level)) then setting a zoom default as maybe %50 percent as a start point.
also there would need to be a input control for the zooming, so we would could add the "configurecontrol" to allow user customizing of the controls.
Also maybe a user settable transparency or just a default of %50 ? .
the second sprite is the "HeadingIndicator.3dr" project. ( set -90 to 90 so the sprite rotates in the opposite direction).
This gives a basic radar as a beginning.
Whats needed now is a scaled movement process for the ground map sprite to keep the radar host position located on the map properly.
And a zoom for the sprite. ( maybe starting with a large sprite ( the maximum zoom level)) then setting a zoom default as maybe %50 percent as a start point.
also there would need to be a input control for the zooming, so we would could add the "configurecontrol" to allow user customizing of the controls.
Also maybe a user settable transparency or just a default of %50 ? .
Ok played around some more & this is what i have..
It two projects combined and pretty much gives a basic radar that im looking for.
the map alignment/rotations are a little out of wack, but its a good start.
Check out the included project, using 3drad v6.50 if it matters.
this is a combination of the "HeadingIndicator.3dr" project &
the "minimapdemo.3dr" projects (found elsewhere on the forum, but included here for ease of use.
Iv included path info for the files so unzip it with paths to install it properly, or manually extract files to their respective folders, your choice)
It two projects combined and pretty much gives a basic radar that im looking for.
the map alignment/rotations are a little out of wack, but its a good start.
Check out the included project, using 3drad v6.50 if it matters.
this is a combination of the "HeadingIndicator.3dr" project &
the "minimapdemo.3dr" projects (found elsewhere on the forum, but included here for ease of use.
Iv included path info for the files so unzip it with paths to install it properly, or manually extract files to their respective folders, your choice)
jestermon
There is often a need to center a model to the world 0,0,0 coordinates. Sketchup does not have this feature built in, so I searched the web for a solution. I found this little gem of a ruby script that almost does the job.
The plugin Center_Group_Bottom was found on a forum, made by someone named Dick.. Thanks Dick.
The original script centers the model in world, but places the model on the "floor", which is great for buildings and such. I changed the script a little, so the model is centered along the Z axis (up-down) as well. This change is needed for most models used in a game engine, such as balls, guns etc.
There are 2 scripts. Center_Group_Bottom, and Center_Group (my little change)
Unzip the little file, and place both scripts in your Sketchup plugin directory.
Once you model is ready, select everything and make it into a group or a component.
From the plugin drop-down menu, select the desired plugin, and it will do it's job for you.
Enjoy.
The plugin Center_Group_Bottom was found on a forum, made by someone named Dick.. Thanks Dick.
The original script centers the model in world, but places the model on the "floor", which is great for buildings and such. I changed the script a little, so the model is centered along the Z axis (up-down) as well. This change is needed for most models used in a game engine, such as balls, guns etc.
There are 2 scripts. Center_Group_Bottom, and Center_Group (my little change)
Unzip the little file, and place both scripts in your Sketchup plugin directory.
Once you model is ready, select everything and make it into a group or a component.
From the plugin drop-down menu, select the desired plugin, and it will do it's job for you.
Enjoy.
*Screaming like a little girl getting a huge ice scream.*
Thank you soooo much Jestermon! This is just what I needed! Thank you!
Will this post be deleted to keep this topic clean?
Thank you soooo much Jestermon! This is just what I needed! Thank you!
Will this post be deleted to keep this topic clean?
jestermon
This is the useful goodies thread - All the ice cream and chocolates can be found here. You will notice that this thread is full of comments and feedback, so yours will also stay. But don't worry, No one can hear you scream in cyberspace.
Is it because you can't open .rar files? If that is the problem, then download Winrar to extract them.
MINIMAP
Simple but powerful thingee: get the car's location (x,y) and transfer it to the sprite location (x,z).
Read the script's code to get more info.
HOW TO INSTALL
Download and extract the .rar file to your desktop. Just add the two sprites to your sprite/data folder and run the project.
Files:
- MiniMapDemo.3dr
- MAPdemo_Terrain.tga
- MAPdemo_Vehicle.tga
WOULD IT BE POSSIBLE TO UPLOAD A ZIPPED VERSION, COZ I CANT EXTRACT .RAR FILES!