ATTENTIONThis FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices. |
flexsim.com |
#1
|
|||
|
|||
Problems about tansparency
I tried to make a big box which contains a small box. The big box is a tank. The small box that represents water in the tank is draw by drawcube() command in the tank's Custom Draw Code trigger. I would like to make the big box transparent in order to have a look at the quantity of water. So I used Glass texture for big box and it became transparent. But when I tried to draw the small box. Is it not visiual. What's the problem?
Thanks for your help! |
#2
|
|||
|
|||
It's about the order in which things are drawn. By returning 1/true you can prevent the default drawing and draw the Box object yourself and so control that order.
Code:
drawtomodelscale(current); double currentContent = getvarnum(current, "curcontent"); double maxContent = getvarnum(current, "maxcontent"); double height = (currentContent/maxContent)* getnodenum(spatialsz(current)); drawcube(0, 0, 0, 1, 1, height, 0, 0, 0, 0, 0, 255); drawtoobjectscale(current); drawobject(view,getshapeindex("fs3d\\General\\Box.3ds"),gettextureindex("fs3d\\Glass.bmp")); return 1; |
The Following User Says Thank You to Jason Lightfoot For This Useful Post: | ||
Chunyan Liang (10-14-2010) |
#4
|
|||
|
|||
Could you check that the shape and texture are both loaded into the media list by running the following commands in script windows? They should return a positive number if loaded.
getshapeindex("fs3d\\General\\Box.3ds")and then gettextureindex("fs3d\\Glass.bmp")Also you can check the list directly under the menu Tools->MediaFiles. |
The Following User Says Thank You to Jason Lightfoot For This Useful Post: | ||
Chunyan Liang (10-17-2010) |
#5
|
|||
|
|||
You will probably need to remove the 3D Shape reference in the General tab and in version 4 the drawshape should probably be:
Code:
drawobject(view,getshapeindex("fs3d\\texturebox.wrl"),gettextureindex("fs3d\\Glass.bmp")); |
The Following User Says Thank You to Jason Lightfoot For This Useful Post: | ||
Chunyan Liang (10-17-2010) |
Thread | Thread Starter | Forum | Replies | Last Post |
Problems with the file | Ariel Estrada | Pre-sales Questions | 5 | 06-21-2010 10:01 AM |
4.5 download problems | Shankar Narayan | Installation | 2 | 03-10-2009 04:25 PM |
Problems with wrl file | Steven Hamoen | Q&A | 1 | 01-25-2008 06:00 AM |
Graphics problems | Yaghm | Installation | 5 | 09-28-2007 02:12 PM |