Actionscript 3 :: Calculate The Rendered Size Of A 3D Object In A View?
Dec 15, 2010
I'm working on a project that the user navigates around by clicking on icons in 3d space.When a user engages one of these icons, the camera should pan and zoom so that the selected icon appears in the center of the screen at its original height and size (this is so when the 2d overlay is created over the icon, that it is the same size as its 3d counterpart.My question is how to calculate the size a rendered object in a 3d view, I should mention that this is using the Alternativa 3D platform.So there's a camera at (x1, y1, z1) with a FOV of f, pointing at an icon at (x2, y2, z2), all being rendered in a view of dimensions w and h.
View 1 Replies
Similar Posts:
May 18, 2011
i try to low my flash project size,make it as low as possible.okise here it the my file size before, 50kb and export file size is 8kb
so i know i need to covert some of my pictures and mp3 size,i have covert 2 mp3 file size ,one is 6mb and droped 3.7 ,other one is 7mb and droped to 4.2. so i save my file again, and my flash project file size droped to 18kb and export file is 10kb ??i dont really understand how flash calculate the size.
View 1 Replies
Sep 18, 2011
For example, I've created 2 horizontal lists with different heights: 50px and 100px. I'd like to use 1 item renderer to display both. The item renderer has to create square items, so it has to produce 50x50 items for the first list and 100x100 items for the second one. How should I set up the item renderer to get the result?
View 1 Replies
Sep 28, 2011
My problem is that when I try to pass an object from the navigator.pushView(view, dataobject), I can't figure out how to access the dataobject from actionscript. I can access {dataobject.property} from MXML easily, but I want to set a variable in the new view to the passed dataobjects property.
View 1 Replies
Nov 22, 2011
Does anyone know why the font size in flash is smaller than in Microsoft .NET GDI+.Does anyone know how much smaller?Does anyone know how to calculate the font size to get the 2 to match?
View 2 Replies
Jan 28, 2010
[Code]....
I've been trying to add a resize function to this so that it can be viewed in different size browsers. Exactly like the opening page of this site [URL] So the whole page is always in view and scales until it reaches a set maximum size.
View 2 Replies
Jul 31, 2009
I am tweeing a bunch of rectangles randomly on stage.
Code:
TweenLite.to(thumbArr[i],1,{
x:Math.random () * (stage.stageWidth - thumbArr[i].width),
y:Math.random () * (stage.stageHeight - thumbArr[i].height),
rotation: Math.random () * (60) - 30});
the problem is that after I added random rotation (between -30 and 30 degrees), the corners of my rectangles are still sticking out of the stage at the end of the tween.
If I trace objects width and height after the rotation I get the new values but this still doesnt help me because I am tweening to that rotation.
Code:
mc.rotation = 20;
trace(mc.width);
trace(mc.height);
View 5 Replies
Jul 30, 2009
I am tweeing a bunch of rectangular shaped objects randomly on stage.
Code:
TweenLite.to(thumbArr[i],1,{
x:Math.random () * (stage.stageWidth - thumbArr[i].width),
y:Math.random () * (stage.stageHeight - thumbArr[i].height),
rotation: Math.random () * (60) - 30});
the problem is that after I added a random rotation between -30 & 30 degrees they still stick out of the stage a little.how could I calculate width & height of the these objects based on their final rotation so they dont stick out of the stage?
View 6 Replies
Jan 27, 2010
How to you calculate the total rotation of an object in either direction?
I need to end up with a number of total radinas(or degrees) that is posotive or negative depending which way the object was rotated.
View 4 Replies
Feb 1, 2010
How can I calculate the angle of a 3d object based on the mouse speed?I want to change the rotationZ state based on the mouse position.
View 0 Replies
Nov 2, 2011
I have the coordinates of a player and another object. Both are with geographical coordinates (Latitude and longitude). I have also the direction in what the player is facing (compass). How can I calculate the angle to the other object from the player direction? e.g. I want to know if the object is to the right/left of the player and how many degrees.
View 3 Replies
Jul 1, 2011
I as this working in AS2 and need to update to AS3...shows that AS3 doesn't like sloppy coding. Here's what I need: I pull data from an XML and that works when I put the data into a dynamic text box. However, I can't seem to get the date of birth into a variable. I have some code that calcs age in years but uses a string literal that I thought I could just replace with a variable from my XML...ain't a workin'. Here's the code I have:
ActionScript Code:
import flash.display.*;
import flash.text.*;
import flash.events.*;
[Code]......
View 0 Replies
Dec 9, 2010
apologies if this question doesn't seem very clear, i'm finding it difficult to describe what i mean.can i make object move 'out of view' in a movieclip?for example, in the same waya movieclip can move offstage, i'm trying to find a way to make the content of a movieclip move out of view to the side but within the scope of the movieclip.so if i have a square movieclip size x=100 y=100 with a circle size 10 in the centre, i'm trying to make it so when my circle moves to the left more than the size of the movieclip it starts to move out of view.another example would be if i had a character on a television (the screen being the movieclip
View 3 Replies
Mar 4, 2010
I have a (flex) app that, on the click of a button, resize a div (in javascript) at the bottom of the page and shows your position in google street view in it.
The things is that if I open the browser at 80% of width, click on the button and then maximize the window, the div won't take 100% of width. I have a function that his being called 'onResize' on the body tag of the page, but it doesn't seems to work. Here is the code :
function handleResize()
{
document.getElementById('streetviewDiv').style.width='100%';
}
...
<body onResize="handleResize()">
How can I achieve the auto-resize of the street view? There must be a specific id for that object so that we could get it by javascript, but I haven't found it.
View 1 Replies
Jun 17, 2011
I have a swf File which has the Size 3840 x 800px.Now i want to put it in a html file.[code]...
View 2 Replies
Dec 29, 2009
I'm trying to get an object to increase in size the lower it goes down the stage, and decrease in size the high it moves up the stage.
It only needs to increase or decrease by a small amount. Basically, it's for a game character. To ad realism to his movements, it would be nice to have this feature.
This is where i'm up to so far:
Code:
import fl.transitions.Tween;
import fl.transitions.TweenEvent;
import fl.transitions.easing.*;
[code]....
I think I need something like:
if (object moves up)
decrease
else if (object moves down)
increase
View 6 Replies
Nov 28, 2010
In a game me and a friend is creating, the levels are stored in MCs.In the level MCs there are several other MCs that the player should be able to interact with.
This means the objects in the levels need a stage reference.I can place all the objects manually and pass the stage ref in the constructor of the object's class, but this is a pain when the levels are going to be pretty big.
Is it possible to make sure that flash always passes a stage ref to the object even though it's not placed there by code?
View 1 Replies
Nov 2, 2009
I have a PresentationModel AS class that holds all the values used in SomeView.mxml. The entire class for the model is bindable, and the model property in the view is also bindable. However, I am unable to inject the model into the view using the PropertyInjector tag:
- INFO: Data binding will not be able to detect assignments to model
MainEventMap.mxml
<EventHandlers type="{FlexEvent.INITIALIZE}">[code].....
View 2 Replies
Nov 28, 2010
In a game me and a friend are creating, the levels are stored in MCs. In the level MCs there are several other MCs that the player should be able to interact with.
This means the objects in the levels need a stage reference. I can place all the objects manually and pass the stage ref in the constructor of the object's class, but this is a pain when the levels are going to be pretty big.
Is it possible to make sure that flash always passes a stage ref to the object even though it's not placed there by code?
View 1 Replies
Jun 24, 2011
Does there exist a Flex view component that you could just pass it a custom object with all public fields/properties that it could reflect over and produce a basic UI view using flex components. Is it possible to use something like the Spark DataGrid with one item laid out vertically. It would only have to support:
[Code].....
View 3 Replies
Aug 3, 2010
I'm about to have to write a web page/app that will serve the agenda for circa 100 people on a page. One line per person, one column per day with 3 clickable zones in each cell. In HTML, the page is way complex for the browser to load quick and there is no possibility to click on a border between 2 cells to for example split an event that spreads among several cells. So I search an not too overkilling technology to render this kind of view. I begun with a PHP generated HTML page but the number of elements in the page make the mouse move jerky.
Moving to JAVA would give me better performances regarding the reuse of the generator of the view but it will still be an HTML page. So, here is my question: do you think that going forward with JAVA and its graphical capability is the simple solution or is Flash a better option for this part of a Web App? I'm afraid of the code I'll have to write in JAVA to handle the GUI presentation as well as the events generated by the 1000's cells plus borders of the page. In Flash, the graphical part seems simpler even if the actions handling is still huge.
View 2 Replies
Aug 15, 2011
I'm currently using RobotLegs with the Presentation Model pattern to develop a Flex 4 project. I understand that all business logic related to a View resides in the Presentation Model associated with that view, however, I am confused when it comes to View specific logic.For example, I have an indicator that needs to be positioned relatively to list items depending on which list item is selected. Is it acceptable in the Presentation pattern to put the logic that will position the indicator in the View and simply have that logic run in reaction to a selectedIndex property changing in the presentation model?The reason I am considering this is that since the Presentation Model does not have a reference to the view it is difficult to come up with an ideal solution for manipulating view components.
View 1 Replies
Mar 18, 2010
I am wondering how to make a 360º view bubble, like they use for Google Street View, but have no idea how to go at accomplishing this task... i have the string of photos that i attached in photoshop(so that if you connected the left to the right it would be a full 360º view).
View 1 Replies
Nov 25, 2010
I am using Flash CS4 AS3.. When I open my browser "Internet Explorer 7" it opens normal. But When I open a link using the following Flash code it opens half in length and half in width. I need to click on "Maximise" button to view in full. How to solve the problem? It is our Intranet link.
PM3.addEventListener(MouseEvent.CLICK,PM3ClickHandler);
function PM3ClickHandler(event:MouseEvent):void { navigateToURL (new URLRequest ("http://engineering/history/thisyear/ceomessage.htm"));
}
I tried modifying the line as well. It also doesnt work.
navigateToURL(new URLRequest ("http://engineering/history/thisyear/ceomessage.htm"), "_blank");
View 3 Replies
Jun 13, 2010
I have one .mxml file (the Application) with a ViewStack (with 4 views) and a ControlBard, obviously I can change the views with it, but what I want to do is: in view #1 I have an image which I want to convert to a "hyperlink", so when I click it I go to View #2, is this doable? Also I would like to pass somehow some data (like a String) to that View #2 (lets say the it's a user avatar I click so I want to go to the second view which will show me his profile, that's why I need his name/id).
View 1 Replies
Oct 8, 2009
in flash, I encounted a source file that is cropped and I cannot move it, is there some sort of cropped view in flash I dont know about? I cannot find anyinformation about it, it has rulers displayed as far as I remember.
Basically you cannot move in the file to edit anything viewpoint wise, everything outside of the movie area is invisible and not there? As if cropped.
View 0 Replies
May 26, 2009
I recently posted a .swf inside a new window with javascript. everything works fine on a PC, the movie will load on a mac. You should be able to click and drag to "spin" the object within the movie (it cycles a series of photos to give a 360 view), but when on a mac the cursor changes but images are not cycling. i'm sure it could be a number of different things but I'm unsure where to start.
View 5 Replies
Mar 22, 2010
According to the ActionScript 3.0 documentation, the TextFormat classes size property is an Object. Why is this? Clearly this is a number! When I check its type (using typeOf()), it returns Number. So whats the deal?
View 3 Replies
May 20, 2010
I'm working with a Flash movie and I'm trying to get the size of the player itself (i.e. the height and width Flash has to work with from the object/embed tag). As far as I can tell, Flash doesn't make this available to ActionScript.
I'm able to use this.root.loaderInfo.width and this.root.loaderInfo.height to get the "intended" size of the flash movie (what's specified on export), but if the dimensions are different on the page, this isn't helpful.
View 1 Replies
Nov 12, 2011
In Java, what is the best way to determine the size of an object?
In Actionscript I can usually just do:
var myVar:uint = 5;
getSize(myVar)
//outputs 4 bytes
How do I do this in Java?
View 3 Replies